Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_pink_enemy_Other_12

related scripts: Alarm_4Alarm_6CleanUp_0Create_0Draw_0Other_10Other_11Other_12 Other_22Step_0

(view raw script w/o annotations or w/e)
1
if (global.inv > 0)
2
    exit;
3
hero_state = "fail";
4
for (ti = 0; ti < 3; ti += 1)
5
{
6
    damage = teamdamage;
7
    target = ti;
8
    if (global.hp[global.char[ti]] > 0 && global.char[ti] != 0)
9
    {
10
        global.inv = -1;
11
        if (teamdamageproportional == true)
12
            global.ignoredefense = true;
13
        
scr_damage
scr_damage

function
scr_damage(arg0 = true)
{ if (global.inv < 0) { var __element = 0; if (variable_instance_exists(id, "element")) { if (is_real(element)) __element = element; } if (target < 3) { if (global.hp[global.char[target]] <= 0) {
scr_randomtarget_old();
target = mytarget; with (global.charinstance[target]) { image_blend = c_white; darkify = 0; } } } var __remtarget = -1; if (target == 4) { __remtarget = 4;
scr_randomtarget_old();
target = mytarget; if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (
scr_party_hpaverage() / 2))
{
scr_randomtarget_old();
target = mytarget; } if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (
scr_party_hpaverage() / 2))
{
scr_randomtarget_old();
target = mytarget; } if (target == 0 && (global.hp[global.char[target]] / global.maxhp[global.char[target]]) < 0.35) {
scr_randomtarget_old();
target = mytarget; } with (global.charinstance[target]) { image_blend = c_white; darkify = 0; } } chartarget = 3; if (global.chapter == 5 && i_ex(obj_flowery_enemy)) { var dam_reduction = 0; if (global.tempflag[74] == 7) dam_reduction = -0.05; if (global.tempflag[74] == 8) dam_reduction = -0.1; if (global.tempflag[74] == 9) dam_reduction = -0.12; if (global.tempflag[74] == 10) dam_reduction = -0.15; if (global.tempflag[74] == 11) dam_reduction = -0.18; if (global.tempflag[74] == 12) dam_reduction = -0.21; if (global.tempflag[74] >= 13) dam_reduction = -0.25; if (obj_flowery_enemy.partydefenselowered == true) { damage = ceil(damage * (1.1 + dam_reduction)); dam_reduction = 0; } if (obj_flowery_enemy.remove_ralsei_con > 0) { damage = ceil(damage * (0.8 + dam_reduction)); dam_reduction = 0; } if (dam_reduction != 0) damage = ceil(damage * (1 + dam_reduction)); if (obj_flowery_enemy.ralsei_removed == true && target == 2) { target = choose(0, 1); if (global.hp[1] < 1) target = 1; if (global.hp[2] < 1) target = 0; } if (i_ex(obj_dbulletcontroller) && obj_dbulletcontroller.type == 637) obj_flowery_enemy.damage_taken_during_tutorial++; } tdamage = damage; var oldcalculation = 0; if (target < 3) { chartarget = global.char[target]; if (global.ignoredefense == true) { tdamage = ceil(tdamage); } else ...
();
14
        global.ignoredefense = false;
15
        with (obj_dmgwriter)
16
            depth = other.depth - 100;
17
        if (i_ex(obj_date_controller))
18
        {
19
            if (ti == 0)
20
                dmgwriter.x = camerax() + 70;
21
            if (ti == 0)
22
                dmgwriter.y = cameray() + 430;
23
            if (ti == 0)
24
                dmgwriter.ystart = cameray() + 430;
25
            if (ti == 1)
26
                dmgwriter.x = camerax() + 270;
27
            if (ti == 1)
28
                dmgwriter.y = cameray() + 430;
29
            if (ti == 1)
30
                dmgwriter.ystart = cameray() + 430;
31
            if (ti == 2)
32
                dmgwriter.x = camerax() + 480;
33
            if (ti == 2)
34
                dmgwriter.y = cameray() + 430;
35
            if (ti == 2)
36
                dmgwriter.ystart = cameray() + 430;
37
        }
38
    }
39
}
40
snd_stop(snd_hurt1);
41
snd_play(snd_hurt1);
42
damage = nonteamdamage;