Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_monster1_Step_0

(view raw script w/o annotations or w/e)
1
if (global.monster[myself] == 1)
2
{
3
    if (global.mnfight == 1 && talked == 0)
4
    {
5
        abletotarget = 1;
6
        if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0)
7
            abletotarget = 0;
8
        mytarget = choose(0, 1, 2);
9
        if (abletotarget == 1)
10
        {
11
            while (global.charcantarget[mytarget] == 0)
12
                mytarget = choose(0, 1, 2);
13
        }
14
        else
15
        {
16
            target = 3;
17
        }
18
        global.targeted[mytarget] = 1;
19
        instance_create(0, 0, obj_darkener);
20
        global.typer = 7;
21
        global.msg[0] = 
Line1
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_monster1_slash_Step_0_gml_25_0")
;
22
        if (global.mercymod[myself] >= global.mercymax[myself])
23
            global.msg[0] = 
Line2
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_monster1_slash_Step_0_gml_26_0")
;
24
        mywriter = instance_create(x - 60, y - 30, obj_writer);
25
        talked = 1;
26
        talktimer = 0;
27
    }
28
    if (talked == 1 && global.mnfight == 1)
29
    {
30
        if (button1_p() && talktimer > 15)
31
            talktimer = talkmax;
32
        talktimer += 1;
33
        if (talktimer >= talkmax)
34
        {
35
            with (obj_writer)
36
                instance_destroy();
37
            global.mnfight = 2;
38
        }
39
    }
40
}
41
if (global.myfight == 3)
42
{
43
    xx = __view_get(e__VW.XView, 0);
44
    yy = __view_get(e__VW.YView, 0);
45
    if (acting == 1 && actcon == 0)
46
    {
47
        actcon = 1;
48
        global.msg[0] = 
* Line8Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_monster1_slash_Step_0_gml_75_0")
;
49
        global.typer = global.battletyper;
50
        battlewriter = instance_create(xx + 30, yy + 376, obj_writer);
51
        if (global.fc != 0)
52
            myface = instance_create(xx + 26, yy + 380, obj_face);
53
        if (acting == 1)
54
            global.mercymod[myself] += 120;
55
        if (global.mercymod[myself] >= global.mercymax[myself])
56
            global.msg[0] = 
Line9
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_monster1_slash_Step_0_gml_82_0")
;
57
    }
58
    if (acting == 2)
59
    {
60
        if (acttimer == 0)
61
        {
62
            global.msg[0] = 
* Susie and Kris cast
Dual-Buster!Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_monster1_slash_Step_0_gml_91_0")
;
63
            global.typer = global.battletyper;
64
            battlewriter = instance_create(xx + 130, yy + 376, obj_writer);
65
            if (global.fc != 0)
66
                myface = instance_create(xx + 26, yy + 380, obj_face);
67
        }
68
        if (acttimer == 20)
69
        {
70
            global.chartarget[0] = myself;
71
            global.chartarget[1] = myself;
72
            global.charspecial[0] = 1;
73
            global.charspecial[1] = 1;
74
            with (global.charinstance[0])
75
                state = 2;
76
            with (global.charinstance[1])
77
                state = 2;
78
        }
79
        if (acttimer == 40)
80
            actcon = 1;
81
        acttimer += 1;
82
    }
83
    if (actcon == 1 && !instance_exists(obj_writer))
84
    {
85
        actcon = 0;
86
        scr_attackphase
scr_attackphase

function scr_attackphase() { with (obj_battlecontroller) { techwon = 0; if (scr_monsterpop() == 0) techwon = 1; if (techwon == 0) { fightphase = 1; global.charturn = 3; if (global.charaction[0] == 4 || global.charaction[0] == 2) fightphase = 0; if (global.charaction[1] == 4 || global.charaction[1] == 2) fightphase = 0; if (global.charaction[2] == 4 || global.charaction[2] == 2) fightphase = 0; if (global.myfight == 4) fightphase = 1; if (fightphase == 1) { global.myfight = 1; instance_create(xx + 2, yy + 365, obj_attackpress); } else { global.myfight = 4; instance_create(0, 0, obj_spellphase); } } else { scr_wincombat(); } } }
();
87
    }
88
}
89
if (x > (__view_get(e__VW.XView, 0) + 800) && global.myfight != 3)
90
    instance_destroy();
91
92
enum e__VW
93
{
94
    XView,
95
    YView,
96
    WView,
97
    HView,
98
    Angle,
99
    HBorder,
100
    VBorder,
101
    HSpeed,
102
    VSpeed,
103
    Object,
104
    Visible,
105
    XPort,
106
    YPort,
107
    WPort,
108
    HPort,
109
    Camera,
110
    SurfaceID
111
}