Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_heroparent_Alarm_1

(view raw script w/o annotations or w/e)
1
global.faceaction[myself] = 0;
2
scr_retarget
scr_retarget

function
scr_retarget(arg0)
{ thistarget = global.chartarget[arg0]; cancelattack = 0; if (thistarget == 0) { if (global.monster[0] == 0) thistarget = 1; } if (thistarget == 1) { if (global.monster[1] == 0) thistarget = 2; } if (thistarget == 2) { if (global.monster[2] == 0) thistarget = 3; if (thistarget == 3 && global.monster[0] == 1) thistarget = 0; if (thistarget == 3 && global.monster[1] == 1) thistarget = 1; if (thistarget == 3) cancelattack = 1; } global.chartarget[arg0] = thistarget; }
(myself);
3
if (cancelattack == 0)
4
{
5
    dm = instance_create(global.monsterx[global.chartarget[myself]], (global.monstery[global.chartarget[myself]] - (global.hittarget[global.chartarget[myself]] * 20)) + 20, obj_dmgwriter);
6
    dm.type = char - 1;
7
    dm.delay = 8;
8
    damage = round(((global.battleat[myself] * points) / 20) - (global.monsterdf[global.chartarget[myself]] * 3));
9
    if (global.monstertype[global.chartarget[myself]] == 19Susie (w/ Lancer))
10
        damage = ceil(damage * 0.3);
11
    if (damage < 0)
12
        damage = 0;
13
    if (damage == 0)
14
    {
15
        dm.delay = 2;
16
        with (global.monsterinstance[global.chartarget[myself]])
17
        {
18
            if (hurttimer <= 15 && candodge == 1)
19
            {
20
                dodgetimer = 0;
21
                state = 4;
22
            }
23
        }
24
    }
25
    dm.damage = damage;
26
    global.hittarget[global.chartarget[myself]] += 1;
27
    global.monsterhp[global.chartarget[myself]] -= damage;
28
    if (is_auto_susie == 1 && global.monsterhp[global.chartarget[myself]] <= 0)
29
    {
30
        with (global.monsterinstance[global.chartarget[myself]])
31
            global.flag[51 + myself] = 5;
32
        with (obj_event_manager)
33
            trigger_event(UnknownEnum.Value_0, UnknownEnum.Value_22);
34
    }
35
    if (damage > 0)
36
    {
37
        if (global.monstertype[0] != 20JEVIL)
38
            
scr_tensionheal
scr_tensionheal

function
scr_tensionheal(arg0)
{ global.tension += arg0; if (global.tension > global.maxtension) global.tension = global.maxtension; }
(round(points / 10));
39
        if (global.monstertype[0] == 20JEVIL)
40
            
scr_tensionheal
scr_tensionheal

function
scr_tensionheal(arg0)
{ global.tension += arg0; if (global.tension > global.maxtension) global.tension = global.maxtension; }
(round(points / 15));
41
        attack = instance_create(global.monsterx[global.chartarget[myself]] + random(6), global.monstery[global.chartarget[myself]] + random(6), obj_basicattack);
42
        if (object_index == obj_herosusie)
43
        {
44
            attack.sprite_index = spr_attack_mash2;
45
            attack.image_speed = 0.5;
46
            attack.maxindex = 4;
47
            snd_play(snd_impact);
48
            instance_create(0, 0, obj_shake);
49
        }
50
        if (object_index == obj_heroralsei)
51
        {
52
            attack.sprite_index = spr_attack_slap1;
53
            attack.maxindex = 4;
54
            attack.image_speed = 0.5;
55
        }
56
        if (points == 150)
57
        {
58
            attack.image_xscale = 2.5;
59
            attack.image_yscale = 2.5;
60
        }
61
        with (global.monsterinstance[global.chartarget[myself]])
62
        {
63
            shakex = 9;
64
            state = 3;
65
            hurttimer = 30;
66
        }
67
        if (instance_exists(global.monsterinstance[global.chartarget[myself]]))
68
            global.monsterinstance[global.chartarget[myself]].hurtamt = damage;
69
    }
70
    if (global.monsterhp[global.chartarget[myself]] <= 0)
71
    {
72
        with (global.monsterinstance[global.chartarget[myself]])
73
            
scr_monsterdefeat
scr_monsterdefeat

function
scr_monsterdefeat()
{ if (global.monster[myself] == 1) { global.monstergold[3] += global.monstergold[myself]; global.monsterexp[3] += global.monsterexp[myself]; global.monster[myself] = 0; if (global.flag[51 + myself] == 0) { global.flag[51 + myself] = 2; if (global.monsterhp[myself] <= 0) global.flag[51 + myself] = 1; } if (global.flag[51 + myself] == 1) global.flag[40 violences] += 1; if (global.flag[51 + myself] == 2) global.flag[41 spares] += 1; if (global.flag[51 + myself] == 3) global.flag[42 pacifies] += 1; if (global.flag[51 + myself] == 5) global.flag[43 autosusie_violences] += 1; if (
scr_monsterpop() == 0)
{ _amt_add = 0; _violenced = 0; _spared = 0; _pacified = 0; for (d_i = 0; d_i < 3; d_i += 1) { if (global.flag[51 + d_i] != 0) _amt_add += 1; if (global.flag[51 + d_i] == 1) _violenced += 1; if (global.flag[51 + d_i] == 2) _spared += 1; if (global.flag[51 + d_i] == 3) _pacified += 1; } if (_pacified > 0) global.flag[50 last_encounter_end] = 3; if (_spared > 0) global.flag[50 last_encounter_end] = 2; if (_violenced > 0) global.flag[50 last_encounter_end] = 1; } event_user(11); } }
();
74
    }
75
}
76
77
enum UnknownEnum
78
{
79
    Value_0,
80
    Value_22 = 22
81
}