Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_spellphase_Step_0

(view raw script w/o annotations or w/e)
1
if (active == 1)
2
{
3
    spelltimer += 1;
4
    if (spelltimer >= global.spelldelay && instance_exists(spellwriter) == false)
5
    {
6
        if (char >= 3 || spelltotal == 1)
7
        {
8
            
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();
} } }
();
9
            with (spellwriter)
10
                instance_destroy();
11
            instance_destroy();
12
        }
13
        else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 0)
14
        {
15
            if (gotitem[char] == 1)
16
            {
17
                re_castyet = 1;
18
                with (global.charinstance[char])
19
                    state = 4;
20
                with (spellwriter)
21
                    instance_destroy();
22
                
scr_spelltext
scr_spelltext

function
scr_spelltext(arg0, arg1)
{ spell = arg0; caster = arg1; star = global.chartarget[arg1]; spelltext = " "; switch (spell) { case 0: break; case 1: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast RUDE BUSTER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_14_0")
, global.charname[global.char[caster]]);
break; case 2: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast HEAL PRAYER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_18_0")
, global.charname[global.char[caster]]);
break; case 3: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast PACIFY!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_23_0")
, global.charname[global.char[caster]]);
scr_retarget_spell();
if (global.monster[star] == 1) { if (global.monsterstatus[star] == 1) { } else { global.msg[0] =
scr_84_get_subst_string(
* ~1 cast PACIFY!Delay 11
* But the enemy wasn't TIRED...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_33_0")
, global.charname[global.char[caster]]);
if (global.mercymod[star] >= 100) global.msg[0] =
scr_84_get_subst_string(
* ~1 cast PACIFY!Delay 11
* But the foe wasn't TIRED... try SPARING!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_36_0")
, global.charname[global.char[caster]]);
} } break; case 4: global.msg[0] =
scr_84_get_subst_string(
* ~1 used RUDE BUSTER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_43_0")
, global.charname[global.char[caster]]);
break; case 5: global.msg[0] =
scr_84_get_subst_string(
* ~1 used RED BUSTER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_47_0")
, global.charname[global.char[caster]]);
break; case 6: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast DUAL HEAL!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_51_0")
, global.charname[global.char[caster]]);
break; case 100: cancelattack = 0; global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_58_0")
, global.charname[global.char[caster]], global.monstername[star]);
scr_retarget_spell();
if (global.mercymod[star] >= 100) { global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_62_0")
, global.charname[global.char[caster]], global.monstername[star]);
} else { global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Delay 22
* But its name wasn't YELLOW...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_66_0")
, global.charname[global.char[caster]], global.monstername[star]);
if (global.monsterstatus[star] == 1) { global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Delay 22
* But its name wasn't YELLOW...Wait for input
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_69_0")
, global.charname[global.char[caster]], global.monstername[star]);
global.msg[1] =
* (Try using Ralsei's PACIFY!)Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_70_0")
;
} } if (cancelattack == 1) global.msg[0] =
scr_84_get_subst_string(
* ~1 spared!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_73_0")
, global.charname[global.char[caster]]);
break; case 201: global.msg[0] =
scr_84_get_subst_string(
* ~1 used the DARK CANDY!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_78_0")
, global.charname[global.char[caster]]);
break; case 202: global.msg[0] =
scr_84_get_subst_string(
* ~1 used the REVIVE MINT!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_82_0")
, global.charname[global.char[caster]]);
break; case 203: global.msg[0] =
scr_84_get_subst_string(
* ~1 used the GLOWSHARD!Wait for input
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_86_0")
, global.charname[global.char[caster]]);
global.msg[1] =
* But nothing happened...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_87_0")
;
spec_shard = 0; for (_en = 0; _en < 3; _en += 1) { shardtest[_en] = 0; if (global.monster[_en] == 1) { if (global.monstertype[_en] == 5Rudinn) { spec_shard = 1; shardtest[_en] = 1; global.mercymod[_en] = 200; } } } if (spec_shard > 0) {
scr_itemshift(global.bmenucoord[4][arg1], 0);
global.msg[1] = ""; global.msg[2] =
* The GLOWSHARD disappeared!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_109_0")
;
for (_j = 0; _j < 3; _j += 1) { if (shardtest[_j] == 1) global.msg[1] +=
scr_84_get_subst_string(
* ~1 became enraptured!
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_112_0")
, global.monstername[_j]);
} global.msg[1] += "/"; } break; case 204: global.msg[0] =
scr_84_get_subst_string(
* ~1 read the MANUAL!Wait for input
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_122_0")
, global.charname[global.char[caster]]);
global.msg[1] =
* But nothing happened...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_123_0")
;
spec_shard = 0; ...
(global.charspecial[char], char);
23
                spellwriter = 
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
24
            }
25
            if (gotspell[char] == 1)
26
            {
27
                re_castyet = 1;
28
                with (global.charinstance[char])
29
                    state = 2;
30
                with (spellwriter)
31
                    instance_destroy();
32
                
scr_spelltext
scr_spelltext

function
scr_spelltext(arg0, arg1)
{ spell = arg0; caster = arg1; star = global.chartarget[arg1]; spelltext = " "; switch (spell) { case 0: break; case 1: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast RUDE BUSTER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_14_0")
, global.charname[global.char[caster]]);
break; case 2: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast HEAL PRAYER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_18_0")
, global.charname[global.char[caster]]);
break; case 3: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast PACIFY!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_23_0")
, global.charname[global.char[caster]]);
scr_retarget_spell();
if (global.monster[star] == 1) { if (global.monsterstatus[star] == 1) { } else { global.msg[0] =
scr_84_get_subst_string(
* ~1 cast PACIFY!Delay 11
* But the enemy wasn't TIRED...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_33_0")
, global.charname[global.char[caster]]);
if (global.mercymod[star] >= 100) global.msg[0] =
scr_84_get_subst_string(
* ~1 cast PACIFY!Delay 11
* But the foe wasn't TIRED... try SPARING!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_36_0")
, global.charname[global.char[caster]]);
} } break; case 4: global.msg[0] =
scr_84_get_subst_string(
* ~1 used RUDE BUSTER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_43_0")
, global.charname[global.char[caster]]);
break; case 5: global.msg[0] =
scr_84_get_subst_string(
* ~1 used RED BUSTER!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_47_0")
, global.charname[global.char[caster]]);
break; case 6: global.msg[0] =
scr_84_get_subst_string(
* ~1 cast DUAL HEAL!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_51_0")
, global.charname[global.char[caster]]);
break; case 100: cancelattack = 0; global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_58_0")
, global.charname[global.char[caster]], global.monstername[star]);
scr_retarget_spell();
if (global.mercymod[star] >= 100) { global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_62_0")
, global.charname[global.char[caster]], global.monstername[star]);
} else { global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Delay 22
* But its name wasn't YELLOW...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_66_0")
, global.charname[global.char[caster]], global.monstername[star]);
if (global.monsterstatus[star] == 1) { global.msg[0] =
scr_84_get_subst_string(
* ~1 spared ~2!Delay 22
* But its name wasn't YELLOW...Wait for input
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_69_0")
, global.charname[global.char[caster]], global.monstername[star]);
global.msg[1] =
* (Try using Ralsei's PACIFY!)Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_70_0")
;
} } if (cancelattack == 1) global.msg[0] =
scr_84_get_subst_string(
* ~1 spared!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_73_0")
, global.charname[global.char[caster]]);
break; case 201: global.msg[0] =
scr_84_get_subst_string(
* ~1 used the DARK CANDY!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_78_0")
, global.charname[global.char[caster]]);
break; case 202: global.msg[0] =
scr_84_get_subst_string(
* ~1 used the REVIVE MINT!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_82_0")
, global.charname[global.char[caster]]);
break; case 203: global.msg[0] =
scr_84_get_subst_string(
* ~1 used the GLOWSHARD!Wait for input
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_86_0")
, global.charname[global.char[caster]]);
global.msg[1] =
* But nothing happened...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_87_0")
;
spec_shard = 0; for (_en = 0; _en < 3; _en += 1) { shardtest[_en] = 0; if (global.monster[_en] == 1) { if (global.monstertype[_en] == 5Rudinn) { spec_shard = 1; shardtest[_en] = 1; global.mercymod[_en] = 200; } } } if (spec_shard > 0) {
scr_itemshift(global.bmenucoord[4][arg1], 0);
global.msg[1] = ""; global.msg[2] =
* The GLOWSHARD disappeared!Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_109_0")
;
for (_j = 0; _j < 3; _j += 1) { if (shardtest[_j] == 1) global.msg[1] +=
scr_84_get_subst_string(
* ~1 became enraptured!
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_112_0")
, global.monstername[_j]);
} global.msg[1] += "/"; } break; case 204: global.msg[0] =
scr_84_get_subst_string(
* ~1 read the MANUAL!Wait for input
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_122_0")
, global.charname[global.char[caster]]);
global.msg[1] =
* But nothing happened...Wait for inputClose Message
scr_84_get_lang_string("scr_spelltext_slash_scr_spelltext_gml_123_0")
;
spec_shard = 0; ...
(global.charspecial[char], char);
33
                spellwriter = 
scr_battletext_default
scr_battletext_default

function
scr_battletext_default()
{ global.fc = 0; global.typer = 4;
scr_battletext();
return battlewriter; }
();
34
            }
35
            global.spelldelay = 90;
36
            if (re_castyet == 0)
37
                global.spelldelay = 1;
38
            char += 1;
39
            repeat (2)
40
            {
41
                if (char < 3)
42
                {
43
                    if (using[char] == 0)
44
                        char += 1;
45
                }
46
            }
47
            spelltimer = 0;
48
            re_castyet = 0;
49
        }
50
        else
51
        {
52
            
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();
} } }
();
53
            with (spellwriter)
54
                instance_destroy();
55
            instance_destroy();
56
        }
57
    }
58
}