Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_npc_castle_addison_Create_0

(view raw script w/o annotations or w/e)
1
var lineup = 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; } function scr_flag_name_get(arg0) { if (!global.is_console) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } else { return ""; } } function scr_getflag(arg0) { return
scr_flag_get(arg0);
}
(792);
2
addison_sell_sprite = 1174;
3
addison_buy_sprite = 1178;
4
ad_a_sprite = 4898;
5
ad_b_sprite = 1512;
6
ad_c_sprite = 3348;
7
if (lineup == 1)
8
{
9
    addison_sell_sprite = 1170;
10
    addison_buy_sprite = 1174;
11
    ad_a_sprite = 5086;
12
    ad_b_sprite = 1512;
13
    ad_c_sprite = 3348;
14
}
15
if (lineup == 2)
16
{
17
    addison_sell_sprite = 1172;
18
    addison_buy_sprite = 1170;
19
    ad_a_sprite = 3507;
20
    ad_b_sprite = 5086;
21
    ad_c_sprite = 4898;
22
}
23
if (lineup == 3)
24
{
25
    addison_sell_sprite = 1178;
26
    addison_buy_sprite = 1172;
27
    ad_a_sprite = 1512;
28
    ad_b_sprite = 4898;
29
    ad_c_sprite = 3348;
30
}
31
ad[0] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(700, 60, ad_a_sprite);
32
ad[1] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(878, 20, ad_b_sprite);
33
ad[2] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(905, 77, ad_c_sprite);
34
for (var i = 0; i < array_length_1d(ad); i++)
35
{
36
    with (ad[i])
37
    {
38
        
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
39
        image_speed = 0.1;
40
    }
41
}
42
var addison_sell_npc = instance_create(810, 90, obj_npc_room);
43
addison_sell_npc.sprite_index = addison_sell_sprite;
44
with (addison_sell_npc)
45
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
46
var booth = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(810, 65, spr_npc_addison_stand);
47
booth.depth = addison_sell_npc.depth - 10;
48
var booth_collider = instance_create(booth.x - 40, booth.y + 90, obj_solidblockDark);
49
with (booth_collider)
50
    image_xscale = 3;
51
var booth_sign = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(booth.x + 14, booth.y - 4, spr_dw_ads_small_ad);
52
booth_sign.depth = booth.depth - 10;
53
booth_sign.image_speed = 0.1;
54
var addison_buy_npc = instance_create(710, 99, obj_npc_room);
55
addison_buy_npc.sprite_index = addison_buy_sprite;
56
with (addison_buy_npc)
57
{
58
    
scr_flip
scr_flip

function
scr_flip(arg0)
{ if (arg0 == "h" || arg0 == "x") { x += ((sprite_get_width(sprite_index) - (sprite_get_xoffset(sprite_index) * 2)) * image_xscale); image_xscale = -image_xscale; } else { y += ((sprite_get_height(sprite_index) - (sprite_get_yoffset(sprite_index) * 2)) * image_yscale); image_yscale = -image_yscale; } }
("x");
59
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
60
}
61
lineup++;
62
if (lineup > 3)
63
    lineup = 0;
64
scr_flag_set
scr_flag_set

function
scr_flag_set(arg0, arg1)
{ global.flag[arg0] = arg1; if (
scr_debug())
show_debug_message("*** flag [" + string(arg0) + "] updated: " + string(arg1) + " | " + scr_flag_name_get(arg0)); } function scr_setflag(arg0, arg1) {
scr_flag_set(arg0, arg1);
}
(792, lineup);
65
balloon_move = true;
66
balloon_siner = 0;
67
balloon_flip_timer = 0;
68
balloon[0] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(booth.x - 40, booth.y - 20, spr_dw_city_balloon);
69
with (balloon[0])
70
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
71
balloon[1] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(booth.x + 150, booth.y - 40, spr_dw_city_balloon);
72
balloon[1].depth = addison_buy_npc.depth + 10;
73
with (balloon[1])
74
    
scr_flip
scr_flip

function
scr_flip(arg0)
{ if (arg0 == "h" || arg0 == "x") { x += ((sprite_get_width(sprite_index) - (sprite_get_xoffset(sprite_index) * 2)) * image_xscale); image_xscale = -image_xscale; } else { y += ((sprite_get_height(sprite_index) - (sprite_get_yoffset(sprite_index) * 2)) * image_yscale); image_yscale = -image_yscale; } }
("x");