Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_prophecy_Step_0

(view raw script w/o annotations or w/e)
1
if (!init)
2
{
3
    init = true;
4
    if (i_ex(obj_dw_churchb_prophecymaze))
5
        church = 2;
6
    if (i_ex(obj_dw_churchb_darkclimb))
7
        church = 3;
8
    if (i_ex(obj_dw_church_pianopiece_left_b))
9
        musickind = 1;
10
    if (i_ex(obj_dw_church_pianopiece_rightprophecy))
11
        musickind = 2;
12
    if (room == room_dw_church_bellhall_curtain)
13
        musickind = 3;
14
    sprite_index = spr_dw_church_prophecy_initial1;
15
    var tempname = asset_get_index("spr_dw_church_prophecy_" + extflag);
16
    if (sprite_exists(tempname))
17
        sprite_index = tempname;
18
    if (extflag == "knight2")
19
        sprite_index = spr_dw_church_prophecy_knight1;
20
    
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
21
    var _text = 
scr_prophecytext
scr_prophecytext

function
scr_prophecytext(arg0 = "help")
{ var thegirl = stringsetloc(
THE GIRL
"THE GIRL", "scr_prophecytext_slash_scr_prophecytext_gml_13_0"
);
var textstring = []; var textalign = "center"; switch (arg0) { case "initial1": textstring[0] = stringsetloc(
THE PROPHECY, WHICH WHISPERS#AMONG THE SHADOWS.
"THE PROPHECY, WHICH WHISPERS#AMONG THE SHADOWS.", "scr_prophecytext_slash_scr_prophecytext_gml_20_0"
);
break; case "initial2": textstring[0] = stringsetloc(
THE LEGEND OF THIS WORLD.#
"THE LEGEND OF THIS WORLD.#<DELTARUNE.>", "scr_prophecytext_slash_scr_prophecytext_gml_23_0"
);
break; case "main1": textstring[0] = stringsetloc(
A WORLD BASKED IN PUREST LIGHT.#BENEATH IT, GREW ETERNAL NIGHT.
"A WORLD BASKED IN PUREST LIGHT.#BENEATH IT, GREW ETERNAL NIGHT.", "scr_prophecytext_slash_scr_prophecytext_gml_26_0"
);
break; case "main2": textstring[0] = stringsetloc(
IF FOUNTAINS FREED, THE ROARING CRIES.#AND TITANS SHAPE FROM DARKENED EYES.
"IF FOUNTAINS FREED, THE ROARING CRIES.#AND TITANS SHAPE FROM DARKENED EYES.", "scr_prophecytext_slash_scr_prophecytext_gml_29_0"
);
break; case "main3": textstring[0] = stringsetloc(
THE LIGHT AND DARK, BOTH BURNING DIRE.#A COUNTDOWN TO THE EARTH'S EXPIRE.
"THE LIGHT AND DARK, BOTH BURNING DIRE.#A COUNTDOWN TO THE EARTH'S EXPIRE.", "scr_prophecytext_slash_scr_prophecytext_gml_32_0"
);
break; case "heroes1": textstring[0] = stringsetloc(
BUT LO, ON HOPES AND DREAMS THEY SEND.#THREE HEROES AT THE WORLD'S END.
"BUT LO, ON HOPES AND DREAMS THEY SEND.#THREE HEROES AT THE WORLD'S END.", "scr_prophecytext_slash_scr_prophecytext_gml_35_0"
);
break; case "heroes2": textstring[0] = stringsetloc(
THE GIRL, WITH HOPE CROSSED ON HER HEART.
"THE GIRL, WITH HOPE CROSSED ON HER HEART.", "scr_prophecytext_slash_scr_prophecytext_gml_38_0"
);
if (i_ex(obj_dw_churchb_rotatingtower)) textstring[0] = stringsetloc(
THE SECOND HERO.#THE GIRL, WITH HOPE CROSSED ON HER HEART.
"THE SECOND HERO.#THE GIRL, WITH HOPE CROSSED ON HER HEART.", "scr_prophecytext_slash_scr_prophecytext_gml_41_0"
);
if (i_ex(obj_dw_churchb_darkclimb)) textstring[0] = ""; break; case "heroes3": textstring[0] = stringsetloc(
THE PRINCE, ALONE IN DEEPEST DARK...
"THE PRINCE, ALONE IN DEEPEST DARK...", "scr_prophecytext_slash_scr_prophecytext_gml_49_0"
);
if (i_ex(obj_dw_churchb_library)) textstring[0] = stringsetloc(
THE THIRD HERO.#THE PRINCE, ALONE IN DEEPEST DARK
"THE THIRD HERO.#THE PRINCE, ALONE IN DEEPEST DARK", "scr_prophecytext_slash_scr_prophecytext_gml_52_0"
);
break; case "heroes4": textstring[0] = stringsetloc(
THE CAGE, WITH HUMAN SOUL AND PARTS!
"THE CAGE, WITH HUMAN SOUL AND PARTS!", "scr_prophecytext_slash_scr_prophecytext_gml_56_0"
);
if (i_ex(obj_dw_churchb_libraryconnector)) textstring[0] = stringsetloc(
THE FIRST HERO.#THE CAGE, WITH HUMAN SOUL AND PARTS!
"THE FIRST HERO.#THE CAGE, WITH HUMAN SOUL AND PARTS!", "scr_prophecytext_slash_scr_prophecytext_gml_59_0"
);
break; case "heavenandhell1": textstring[0] = stringsetloc(
THEY'LL HEAR THE RING OF HEAVEN'S CALL.
"THEY'LL HEAR THE RING OF HEAVEN'S CALL.", "scr_prophecytext_slash_scr_prophecytext_gml_63_0"
);
break; case "heavenandhell2": textstring[0] = stringsetloc(
THEY'LL SEE THE TAIL OF HELL TAKE CRAWL.
"THEY'LL SEE THE TAIL OF HELL TAKE CRAWL.", "scr_prophecytext_slash_scr_prophecytext_gml_66_0"
);
break; case "knight1": textstring[0] = stringsetloc(
THE KNIGHT WHICH MAKES#WITH BLACKENED KNIFE.
"THE KNIGHT WHICH MAKES#WITH BLACKENED KNIFE.", "scr_prophecytext_slash_scr_prophecytext_gml_69_0"
);
break; case "knight2": textstring[0] = stringsetloc(
SHALL DUEL WITH HEROES#STRIFE BY STRIFE.
"SHALL DUEL WITH HEROES#STRIFE BY STRIFE.", "scr_prophecytext_slash_scr_prophecytext_gml_72_0"
);
break; case "boss1": textstring[0] = stringsetloc(
THE QUEEN'S CHARIOT#CANNOT BE STOPPED.
"THE QUEEN'S CHARIOT#CANNOT BE STOPPED.", "scr_prophecytext_slash_scr_prophecytext_gml_75_0"
);
break; case "boss2": textstring[0] = stringsetloc(
THE LORD OF SCREENS#CLEAVED RED BY BLADE.
"THE LORD OF SCREENS#CLEAVED RED BY BLADE.", "scr_prophecytext_slash_scr_prophecytext_gml_78_0"
);
break; case "boss3": textstring[0] = stringsetloc(
THE FLOWER MAN, #TRAPPED IN ASYLUM.
"THE FLOWER MAN, #TRAPPED IN ASYLUM.", "scr_prophecytext_slash_scr_prophecytext_gml_81_0"
);
break; case "joke1": textstring[0] = stringsetloc(
JOCKINGTON GROWS THE BEARD.
"JOCKINGTON GROWS THE BEARD.", "scr_prophecytext_slash_scr_prophecytext_gml_84_0"
);
break; case "joke2": textstring[0] = stringsetloc(
THE POINTY-HEADED WILL SAY#"TOOTHPASTE," AND THEN "BOY."
"THE POINTY-HEADED WILL SAY#\"TOOTHPASTE,\" AND THEN \"BOY.\"", "scr_prophecytext_slash_scr_prophecytext_gml_87_0"
);
break; case "musicalprophecy1": case "leftpiece": textstring[0] = stringsetloc(
A CONUNDRUM'S FIRST FOUR TONES.
"A CONUNDRUM'S FIRST FOUR TONES.", "scr_prophecytext_slash_scr_prophecytext_gml_91_0"
);
break; case "musicalprophecy2": case "rightpiece": textstring[0] = stringsetloc(
A CONUNDRUM'S LAST FOUR TONES.
"A CONUNDRUM'S LAST FOUR TONES.", "scr_prophecytext_slash_scr_prophecytext_gml_95_0"
);
break; case "musicalprophecybig": textstring[0] = stringsetloc(
A CONUNDRUM'S MULTITUDE TONES.
"A CONUNDRUM'S MULTITUDE TONES.", "scr_prophecytext_slash_scr_prophecytext_gml_98_0"
);
break; case "angel": textstring[0] = stringsetloc(
THE ANGEL, BANISHED, WILL#FINALLY MEET WITH ITS DESIRE.
"THE ANGEL, BANISHED, WILL#FINALLY MEET WITH ITS DESIRE.", "scr_prophecytext_slash_scr_prophecytext_gml_101_0"
);
break; case "end1": textstring[0] = stringsetloc(
AND THEN. WHEN ALL HOPE#IS LOST FOR THE TALE
"AND THEN. WHEN ALL HOPE#IS LOST FOR THE TALE", "scr_prophecytext_slash_scr_prophecytext_gml_104_0"
);
break; case "end2": textstring[0] = stringsetloc(
THE FINAL TRAGEDY UNVEILS.
"THE FINAL TRAGEDY UNVEILS.", "scr_prophecytext_slash_scr_prophecytext_gml_107_0"
);
break; case "end3": textstring[0] = stringsetloc(
FOR TO SAVE THE WORLDS,#WE LAST OF ALL SAY,
"FOR TO SAVE THE WORLDS,#WE LAST OF ALL SAY,", "scr_prophecytext_slash_scr_prophecytext_gml_110_0"
);
break; case "end5": textstring[0] = stringsetloc(
ONLY THEN,#WILL THE WORLDS BE SAVED.
"ONLY THEN,#WILL THE WORLDS BE SAVED.", "scr_prophecytext_slash_scr_prophecytext_gml_113_0"
);
break; case "hammer": textstring[0] = stringsetloc(
AXE CARVED BY THE#TORTOISE'S GRAND HAMMER.
"AXE CARVED BY THE#TORTOISE'S GRAND HAMMER.", "scr_prophecytext_slash_scr_prophecytext_gml_116_0"
);
break; case "rudebuster": textstring[0] = stringsetloc(
AND LAST, WAS THE GIRL.#AT LAST, WAS THE GIRL.
"AND LAST, WAS THE GIRL.#AT LAST, WAS THE GIRL.", "scr_prophecytext_slash_scr_prophecytext_gml_119_0"
);
break; ...
(extflag);
22
    with (prophecy_text)
23
        initialize_text(_text, 0, 0);
24
    var _icon = asset_get_index("spr_dw_church_prophecy_" + extflag + "_icon");
25
    if (sprite_exists(_icon))
26
    {
27
        if (extflag == "knight2")
28
            _icon = 2478;
29
        prophecy_icon.initialize_sprite(_icon);
30
    }
31
}
32
siner++;
33
if (falltest && active && destroy == 0 && y < (cameray() + 240))
34
    destroy = 1;
35
if (destroy == 1)
36
{
37
    destroy = 2;
38
    var delaytime = 30;
39
    if (destroykind == 2)
40
        delaytime = 10;
41
    if (destroykind == 3)
42
        delaytime = 5;
43
    if (breakdelay != -1)
44
        delaytime = breakdelay;
45
    scr_delay_var("destroy", 3, delaytime);
46
    var type = destroykind;
47
    if (!nodestroysound)
48
    {
49
        var snd = snd_play_complex(0, 0, undefined);
50
        if (!nodestroysecondsound)
51
        {
52
            snd_add_complex(snd, 0, 236, 0.6, 0.4, (delaytime - 1) + 2, -1, 0);
53
            snd_add_complex(snd, 1, 390, 0.8, 0.5, (delaytime - 1) + 0, -1, 0);
54
            snd_add_complex(snd, 2, 390, 0.71, 0.5, (delaytime - 1) + 0, -1, 0);
55
            snd_add_complex(snd, 3, 269, 0.7, 0.95, (delaytime - 1) + 0, -1, 0);
56
        }
57
        if (destroykind != 3)
58
            snd_add_complex(snd, 4, 321, 1, 0.95, 0, -1, 0);
59
    }
60
    var _shattersprite = (type != 2) ? 5059 : 907;
61
    var count = sprite_get_number(_shattersprite);
62
    for (var i = 0; i < count; i++)
63
    {
64
        with (
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{ var thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth_alt();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; } function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false) { if (is_undefined(arg0)) { debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist"); return -4; } var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var imagespeed = layer_sprite_get_speed(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var thismarker = instance_create_depth(xloc, yloc, arg1, obj_marker); with (thismarker) { sprite_index = sprite; image_index = index; image_speed = imagespeed; image_xscale = xscale; image_yscale = yscale; image_angle = angle; image_blend = blend; image_alpha = alpha; if (arg2)
scr_depth_alt(id, arg2);
} return thismarker; } function scr_assetgetinfo(arg0) { var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var imagespeed = layer_sprite_get_speed(arg0); return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed]; }
(x - 199, y - 120, _shattersprite, 2, 2, 0, i, c_white, depth))
65
        {
66
            if (type == 0)
67
            {
68
                depth = other.depth;
69
                if (depth < 5000)
70
                    depth = 5000;
71
                image_alpha = 0.8;
72
                speed = 2;
73
                friction = 0.5;
74
                direction = random(360);
75
                scr_delay_var("gravity", 0.5 + random(0.1), delaytime);
76
                scr_delay_var("friction", 0, delaytime);
77
                scr_delay_var("speed", 2, delaytime);
78
                
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(id, 120);
79
            }
80
            if (type == 1)
81
            {
82
                depth = other.depth;
83
                if (depth < 5000)
84
                    depth = 5000;
85
                image_alpha = 0.8;
86
                speed = 2;
87
                friction = 0.5;
88
                direction = random(360);
89
                
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(id, 120);
90
                scr_delay_var("speed", 4, delaytime);
91
                scr_delay_var("friction", 0.4, delaytime);
92
                
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_lerpvar, delaytime, "image_alpha", image_alpha, 0, 20);
93
            }
94
            if (type == 2)
95
            {
96
                depth = other.depth;
97
                image_alpha = 0.8;
98
                speed = 7;
99
                friction = 0.75;
100
                direction = 270 + random_range(-3, 3);
101
                if (i == (count - 2) || i == (count - 4))
102
                    hspeed = 0.5;
103
                if (i == (count - 1) || i == (count - 3))
104
                    hspeed = -0.5;
105
                gravity_direction = 90;
106
                scr_delay_var("gravity", 0.25 + random(0.1), delaytime);
107
                scr_delay_var("friction", 0, delaytime);
108
                scr_delay_var("speed", 2 + (((count - i) / count) * 15), delaytime);
109
                if (i > (count - 5) || (i % 2) == 0)
110
                    scr_delay_var("depth", depth + 30, delaytime);
111
            }
112
            if (type == 3)
113
            {
114
                depth = other.depth;
115
                if (depth < 5000)
116
                    depth = 5000;
117
                image_alpha = 0.3;
118
                speed = 0;
119
                friction = 0.5;
120
                direction = 270;
121
                var delay = (delaytime * random(5)) + 1;
122
                scr_delay_var("gravity", 0.5 + random(0.1), delay);
123
                scr_delay_var("friction", 0, delay);
124
                scr_delay_var("speed", 2, delay);
125
                
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(id, 120);
126
            }
127
        }
128
    }
129
}
130
if (destroy == 3)
131
{
132
    if (nodestroysparkles == false)
133
    {
134
        var sparklecount = 30;
135
        for (var i = 0; i < sparklecount; i++)
136
        {
137
            with (instance_create((x - 199) + ((i * 398) / sparklecount) + random_range(-30, 30), y + random(120), obj_dw_church_prophecy_groundshards))
138
            {
139
                ytarg = other.y + 120 + 120;
140
                if (other.destroykind == 3)
141
                {
142
                    ytarg += 10000;
143
                    
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(self, 280);
144
                }
145
            }
146
        }
147
    }
148
    if (destroykind < 2)
149
        instance_destroy();
150
    else
151
        destroy = 4;
152
}
153
if (destroy)
154
    image_alpha = -99;