Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_elnina_enemy_Step_0

(view raw script w/o annotations or w/e)
1
if (global.monster[myself] == 1 && !i_ex(obj_rouxls_ch3_enemy))
2
{
3
    if (
scr_isphase
scr_isphase

function
scr_isphase(arg0)
{ __isphase = 0; if (arg0 == "menu" && global.myfight == 0) __isphase = 1; if (arg0 == "acting" && global.myfight == 3) __isphase = 1; if (arg0 == "victory" && global.myfight == 7) __isphase = 1; if (arg0 == "attack" || arg0 == "fight") { if (global.myfight == 1) __isphase = 1; } if (arg0 == "spell" || arg0 == "item") { if (global.myfight == 4) __isphase = 1; } if (arg0 == "enemytalk" || arg0 == "balloon") { if (global.mnfight == 1) __isphase = 1; } if (arg0 == "enemyattack" || arg0 == "bullets") { if (global.mnfight == 2) __isphase = 1; } return __isphase; }
("enemytalk") && talked == 0 && obj_elnina_lanino_controller.talked == 1)
4
    {
5
        
scr_randomtarget
scr_randomtarget

function
scr_randomtarget()
{ abletotarget = 1; if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0) abletotarget = 0; mytarget = choose(0, 1, 2); if (abletotarget == 1) { while (global.charcantarget[mytarget] == 0) mytarget = choose(0, 1, 2); } else { mytarget = 3; } global.targeted[mytarget] = 1; if (global.chapter >= 2 && mytarget != 3) { if (global.charcantarget[0]) global.targeted[0] = 1; if (global.charcantarget[1]) global.targeted[1] = 1; if (global.charcantarget[2]) global.targeted[2] = 1; mytarget = 4; } }
();
6
        talked = 1;
7
        talktimer = 0;
8
        rtimer = 0;
9
    }
10
    if (talked == 1 && 
scr_isphase
scr_isphase

function
scr_isphase(arg0)
{ __isphase = 0; if (arg0 == "menu" && global.myfight == 0) __isphase = 1; if (arg0 == "acting" && global.myfight == 3) __isphase = 1; if (arg0 == "victory" && global.myfight == 7) __isphase = 1; if (arg0 == "attack" || arg0 == "fight") { if (global.myfight == 1) __isphase = 1; } if (arg0 == "spell" || arg0 == "item") { if (global.myfight == 4) __isphase = 1; } if (arg0 == "enemytalk" || arg0 == "balloon") { if (global.mnfight == 1) __isphase = 1; } if (arg0 == "enemyattack" || arg0 == "bullets") { if (global.mnfight == 2) __isphase = 1; } return __isphase; }
("enemytalk"))
11
        
scr_blconskip
scr_blconskip

function
scr_blconskip(arg0)
{ if (arg0 >= 0) { if (button1_p() && talktimer > arg0) talktimer = talkmax; talktimer += 1; if (talktimer >= talkmax) { with (obj_writer) instance_destroy(); global.mnfight = 1.5; } } else if (arg0 == -1) { if (instance_exists(obj_writer) == false) global.mnfight = 1.5; } else if (arg0 == -2) { talktimer += 1; if (talktimer > 15) talktimer = talkmax; if (talktimer >= talkmax) { with (obj_writer) instance_destroy(); global.mnfight = 1.5; } } }
(15);
12
}
13
if (global.myfight == 3)
14
{
15
    xx = __view_get(e__VW.XView, 0);
16
    yy = __view_get(e__VW.YView, 0);
17
    if (acting == 1 && actcon == 0)
18
    {
19
        actcon = 1;
20
        msgsetloc(0, 
* ELNINA - She's just over the moon for Lanino.Wait for inputClose Message
"* ELNINA - She's just over the moon for Lanino./%", "obj_elnina_enemy_slash_Step_0_gml_39_0_b"
);
21
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
22
    }
23
    if (acting == 2 && actcon == 0)
24
    {
25
        msgsetloc(0, 
* Kris says I Love TV to Elnina!Wait for inputClose Message
"* Kris says I Love TV to Elnina!/%", "obj_elnina_enemy_slash_Step_0_gml_46_0"
);
26
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
27
        if (obj_elnina_lanino_controller.sunboost > -3)
28
            obj_elnina_lanino_controller.sunboost--;
29
        obj_elnina_lanino_controller.ilovetv_increase = 1;
30
        acting = 200;
31
    }
32
    if (acting == 200 && actcon == 0)
33
    {
34
        with (obj_writer)
35
        {
36
            if (reachedend)
37
            {
38
                if (obj_elnina_lanino_controller.ilovetv_increased == false)
39
                    obj_elnina_lanino_controller.ilovetv_increase = 3;
40
            }
41
        }
42
        if (!i_ex(obj_writer))
43
        {
44
            if (obj_elnina_lanino_controller.ilovetv_increased == false)
45
                obj_elnina_lanino_controller.ilovetv_increase = 3;
46
            if (obj_elnina_lanino_controller.ilovetv_increase == 0)
47
                actcon = 1;
48
        }
49
    }
50
    if (acting == 3 && actcon == 0)
51
    {
52
        msgsetloc(0, 
* Everyone said I Love TV to Elnina!Wait for inputClose Message
"* Everyone said I Love TV to Elnina!/%", "obj_elnina_enemy_slash_Step_0_gml_79_0"
);
53
        
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
54
        if (obj_elnina_lanino_controller.sunboost > -3)
55
            obj_elnina_lanino_controller.sunboost--;
56
        acting = 200;
57
    }
58
    if (actingsus == 1 && actconsus == 1)
59
    {
60
        msgsetloc(0, 
* Susie said "I Love TV!"Wait for inputClose Message
"* Susie said \"I Love TV!\"/%", "obj_elnina_enemy_slash_Step_0_gml_110_0_b"
);
61
        
scr_simultext
scr_simultext

function
scr_simultext(arg0)
{ __simulorder = 0; if (arg0 == "kris") __simulorder = simulorderkri; if (arg0 == "susie") __simulorder = simulordersus; if (arg0 == "ralsei") __simulorder = simulorderral; if (arg0 == "noelle") __simulorder = simulordernoe; __yoffset = __simulorder * 30; global.typer = 4; battlewriter = instance_create(xx + 30, yy + 376 + __yoffset, obj_writer); }
("susie");
62
        if (simulordersus == 0)
63
            actconsus = 20;
64
        else
65
            actconsus = 0;
66
        obj_elnina_lanino_controller.ilovetv_increase++;
67
    }
68
    if (actingral == 1 && actconral == 1)
69
    {
70
        msgsetloc(0, 
* Ralsei said "I Love TV!"Wait for inputClose Message
"* Ralsei said \"I Love TV!\"/%", "obj_elnina_enemy_slash_Step_0_gml_120_0_b"
);
71
        
scr_simultext
scr_simultext

function
scr_simultext(arg0)
{ __simulorder = 0; if (arg0 == "kris") __simulorder = simulorderkri; if (arg0 == "susie") __simulorder = simulordersus; if (arg0 == "ralsei") __simulorder = simulorderral; if (arg0 == "noelle") __simulorder = simulordernoe; __yoffset = __simulorder * 30; global.typer = 4; battlewriter = instance_create(xx + 30, yy + 376 + __yoffset, obj_writer); }
("ralsei");
72
        if (simulorderral == 0)
73
            actconral = 20;
74
        else
75
            actconral = 0;
76
        obj_elnina_lanino_controller.ilovetv_increase++;
77
    }
78
    if (actcon == 20 || actconsus == 20 || actconral == 20)
79
    {
80
        if (
scr_terminate_writer
scr_terminate_writer

function
scr_terminate_writer()
{ __writerkilled = 0; __writerkillable = 0; __writerended = 0; if (instance_exists(obj_writer)) { obj_writer.__endcheckid = id; with (obj_writer) { if (reachedend == 1) { with (__endcheckid) __writerended++; } } if (__writerended == instance_number(obj_writer)) __writerkillable = 1; } else { __writerkilled = 1; } if (button1_p() && __writerkillable == 1) { with (obj_writer) instance_destroy(); __writerkilled = 1; } return __writerkilled; }
())
81
        {
82
            actconsus = -1;
83
            actconral = -1;
84
            actcon = 1;
85
        }
86
    }
87
    if (actcon == 1 && !instance_exists(obj_writer))
88
        
scr_nextact
scr_nextact

function
scr_nextact()
{ global.acting[0] = 0; global.acting[1] = 0; global.acting[2] = 0; global.actingsingle[global.currentactingchar] = 0; __minstance = global.monsterinstance[global.actingtarget[global.currentactingchar]]; with (__minstance) { acting = 0; actcon = 0; actconsus = 0; actconral = 0; actconnoe = 0; } var singleactcomplete = 0; while (global.currentactingchar < 3) { global.currentactingchar++; if (global.currentactingchar < 3) { if (global.actingsingle[global.currentactingchar] == 1) { __minstance = global.monsterinstance[global.actingtarget[global.currentactingchar]]; if (global.char[global.currentactingchar] == 2) { with (__minstance) actconsus = 1; if (global.actingsimul[global.currentactingchar] == 0) singleactcomplete = 1; break; } if (global.char[global.currentactingchar] == 3) { with (__minstance) actconral = 1; if (global.actingsimul[global.currentactingchar] == 0) singleactcomplete = 1; break; } if (global.char[global.currentactingchar] == 4) { with (__minstance) actconnoe = 1; if (global.actingsimul[global.currentactingchar] == 0) singleactcomplete = 1; break; } } } } if (global.currentactingchar >= 3) { with (obj_monsterparent) { acting = 0; actingsus = 0; actingral = 0; actingnoe = 0; } global.currentactingchar = 0;
scr_attackphase();
} else if (!singleactcomplete) {
scr_act_simul();
} }
();
89
}
90
if (state == 3)
91
    
scr_enemy_hurt
scr_enemy_hurt

function
scr_enemy_hurt()
{ hurttimer -= 1; if (hurttimer < 0) { state = 0; } else { if (global.monster[myself] == 0)
scr_defeatrun();
hurtshake += 1; if (hurtshake > 1) { if (shakex > 0) shakex -= 1; if (shakex < 0) shakex += 1; shakex = -shakex; hurtshake = 0; } } }
();
92
93
enum e__VW
94
{
95
    XView,
96
    YView,
97
    WView,
98
    HView,
99
    Angle,
100
    HBorder,
101
    VBorder,
102
    HSpeed,
103
    VSpeed,
104
    Object,
105
    Visible,
106
    XPort,
107
    YPort,
108
    WPort,
109
    HPort,
110
    Camera,
111
    SurfaceID
112
}