Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_proofread_controller_new_Draw_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (!easyproof)
4
    {
5
        movespeed = 10;
6
        acttimermax = 110;
7
    }
8
    init = 1;
9
}
10
if (acttimer >= 10)
11
    timer++;
12
if (timer > movespeed && con == 0)
13
{
14
    snd_play(snd_menumove);
15
    timer = 0;
16
    currentchoice++;
17
    if (currentchoice == 4)
18
        currentchoice = 1;
19
}
20
var _x = camerax() + (camerawidth() / 2);
21
var _y = (cameray() + (cameraheight() / 2)) - 70;
22
draw_sprite_ext(spr_battleblcon_book_enemy, 0, _x, _y - 80, 1, 0.62, 0, c_white, 1);
23
draw_sprite_ext(spr_battleblcon_book_enemy, 0, _x, _y, 1, 0.62, 0, c_white, 1);
24
draw_sprite_ext(spr_battleblcon_book_enemy, 0, _x, _y + 80, 1, 0.62, 0, c_white, 1);
25
draw_set_halign(fa_center);
26
draw_set_color(c_black);
27
draw_set_font(fnt_mainbig);
28
var _textscale = 1;
29
if (rand == 9 && global.lang != "ja")
30
    _textscale = 0.7;
31
else
32
    _textscale = 1;
33
draw_text_ext_transformed(_x, _y - 80 - 16, str1, 9999, 9999, _textscale, 1, 0);
34
draw_text_ext_transformed(_x, _y - 16, str2, 9999, 9999, _textscale, 1, 0);
35
draw_text_ext_transformed(_x, (_y + 80) - 16, str3, 9999, 9999, _textscale, 1, 0);
36
draw_set_color(c_white);
37
draw_set_halign(fa_left);
38
highlightindex += 0.5;
39
if (currentchoice == 1)
40
{
41
    if (con == 0)
42
        draw_sprite_ext(spr_heart, 0, _x - 104, _y - 88, 1, 1, 0, c_white, 1);
43
    draw_sprite_ext(spr_battleblcon_book_enemy_highlight, highlightindex, _x, _y - 80, 1, 1, 0, dottedlinecolor1, 1);
44
}
45
else
46
{
47
    draw_sprite_ext(spr_battleblcon_book_enemy_highlight, highlightindex, _x, _y - 80, 1, 1, 0, dottedlinecolor2, 1);
48
}
49
if (currentchoice == 2)
50
{
51
    if (con == 0)
52
        draw_sprite_ext(spr_heart, 0, _x - 104, _y - 8, 1, 1, 0, c_white, 1);
53
    draw_sprite_ext(spr_battleblcon_book_enemy_highlight, highlightindex, _x, _y, 1, 1, 0, dottedlinecolor1, 1);
54
}
55
else
56
{
57
    draw_sprite_ext(spr_battleblcon_book_enemy_highlight, highlightindex, _x, _y, 1, 1, 0, dottedlinecolor2, 1);
58
}
59
if (currentchoice == 3)
60
{
61
    if (con == 0)
62
        draw_sprite_ext(spr_heart, 0, _x - 104, _y + 72, 1, 1, 0, c_white, 1);
63
    draw_sprite_ext(spr_battleblcon_book_enemy_highlight, highlightindex, _x, _y + 80, 1, 1, 0, dottedlinecolor1, 1);
64
}
65
else
66
{
67
    draw_sprite_ext(spr_battleblcon_book_enemy_highlight, highlightindex, _x, _y + 80, 1, 1, 0, dottedlinecolor2, 1);
68
}
69
if (con == 0)
70
    acttimer++;
71
if (acttimer > acttimermax)
72
{
73
    snd_play(snd_error);
74
    instance_destroy();
75
    with (obj_writer)
76
        instance_destroy();
77
    msgsetloc(0, 
* Out of time!
"* Out of time!", "obj_proofread_controller_new_slash_Draw_0_gml_77_0"
);
78
    global.fc = 0;
79
    global.typer = 4;
80
    with (instance_create(camerax() + 30, cameray() + 376, obj_writer))
81
    {
82
        dialoguer = 1;
83
        facer = 1;
84
        charline = 26;
85
        preventcskip = 1;
86
    }
87
    instance_destroy();
88
    exit;
89
}
90
if (con == 0 && acttimer > 12 && (button1_p() || button3_p()))
91
{
92
    if (currentchoice == correctchoice)
93
        con = 1;
94
    else
95
        con = 2;
96
    if (easyproof == 1)
97
        
scr_monster_make_tired
scr_monster_make_tired

function
scr_monster_make_tired(arg0)
{ if (global.monsterstatus[arg0] == 0) { __tiredwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] - (global.hittarget[arg0] * 20)) + 20, obj_dmgwriter); __tiredwriter.type = 13; global.hittarget[arg0] += 1; snd_play_x(snd_spellcast, 0.5, 0.9); } global.monstercomment[arg0] = stringsetloc(
(Tired)
"(Tired)", "scr_monster_make_tired_slash_scr_monster_make_tired_gml_1_0"
);
global.monsterstatus[arg0] = 1; }
(creatorid.myself);
98
}
99
if (con == 1)
100
{
101
    endtimer++;
102
    if (endtimer == 2)
103
    {
104
        snd_play(snd_coin);
105
        var mercy = 100;
106
        if (easyproof == 1)
107
            mercy = 100;
108
        
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; if (global.mercymod[arg0] >= 100) global.mercymod[arg0] = 100; var _playsound = 1; if (arg1 <= 0) _playsound = 0; with (obj_dmgwriter) { if (type == 5 && mercytimer < 8) _playsound = 0; } if (_playsound) { var _pitch = 0.8; if (arg1 < 99) _pitch = 1; if (arg1 <= 50) _pitch = 1.2; if (arg1 <= 25) _pitch = 1.4; snd_play_x(snd_mercyadd, 0.8, _pitch); } __mercydmgwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); __mercydmgwriter.damage = arg1; __mercydmgwriter.type = 5; global.hittarget[arg0]++; }
(creatorid.myself, mercy);
109
        with (obj_writer)
110
            instance_destroy();
111
        msgsetloc(0, 
* Success!
"* Success!", "obj_proofread_controller_new_slash_Draw_0_gml_104_0"
);
112
        global.fc = 0;
113
        global.typer = 4;
114
        with (instance_create(camerax() + 30, cameray() + 376, obj_writer))
115
        {
116
            dialoguer = 1;
117
            facer = 1;
118
            charline = 26;
119
            preventcskip = 1;
120
        }
121
    }
122
    colortimer++;
123
    if (colortimer == 3)
124
    {
125
        colortimer = 0;
126
        if (dottedlinecolor1 == 255 || dottedlinecolor1 == 65535)
127
        {
128
            dottedlinecolor1 = 16777215;
129
            dottedlinecolor2 = 16711680;
130
        }
131
        else if (dottedlinecolor1 == 16777215)
132
        {
133
            dottedlinecolor1 = 65535;
134
        }
135
    }
136
    if (((button3_p() || button1_p()) && endtimer > 17) || !i_ex(obj_writer))
137
    {
138
        with (obj_writer)
139
            instance_destroy();
140
    }
141
    if (endtimer >= 60 && !i_ex(obj_writer))
142
        instance_destroy();
143
}
144
if (con == 2)
145
{
146
    endtimer++;
147
    if (endtimer == 2)
148
    {
149
        snd_play(snd_error);
150
        with (obj_writer)
151
            instance_destroy();
152
        msgsetloc(0, 
* ...Delay 11 but,Delay 11 it was misspelled!
"* ..^1. but^1, it was misspelled!", "obj_proofread_controller_new_slash_Draw_0_gml_134_0"
);
153
        global.fc = 0;
154
        global.typer = 4;
155
        with (instance_create(camerax() + 30, cameray() + 376, obj_writer))
156
        {
157
            dialoguer = 1;
158
            facer = 1;
159
            charline = 26;
160
            preventcskip = 1;
161
        }
162
        with (global.monsterinstance[creatorid.myself])
163
        {
164
            shakex = 9;
165
            state = 3;
166
            hurttimer = 30;
167
        }
168
    }
169
    colortimer++;
170
    if (colortimer == 3)
171
    {
172
        colortimer = 0;
173
        if (dottedlinecolor1 == 255 || dottedlinecolor1 == 255)
174
        {
175
            dottedlinecolor1 = 16777215;
176
            dottedlinecolor2 = 16711680;
177
        }
178
        else if (dottedlinecolor1 == 16777215)
179
        {
180
            dottedlinecolor1 = 255;
181
        }
182
    }
183
    if (((button3_p() || button1_p()) && endtimer > 17 && endtimer > 17) || !i_ex(obj_writer))
184
    {
185
        with (obj_writer)
186
            instance_destroy();
187
    }
188
    if (endtimer >= 60 && !i_ex(obj_writer))
189
        instance_destroy();
190
}