Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_heroparent_Alarm_4

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

function scr_monsterpop() { return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 0)
3
    scr_spell
scr_spell

function scr_spell(arg0, arg1) { spell = arg0; caster = arg1; star = global.chartarget[arg1]; global.spelldelay = 10; var item_use = false; switch (spell) { case 0: break; case 1: cancelattack = 0; if (global.monster[star] == 0) scr_retarget_spell(); if (cancelattack == 0) { damage = ceil((global.battleat[arg1] * 10) - (global.monsterdf[star] * 3)); if (global.automiss[star] == 1) damage = 0; scr_damage_enemy(star, damage); attack = instance_create(global.monsterx[star] + random(6), global.monstery[star] + random(6), obj_basicattack); attack.sprite_index = spr_attack_mash1; dm.delay = 8; } global.spelldelay = 30; break; case 2: healnum = global.battlemag[arg1] * 5; scr_heal(star, healnum); global.charinstance[star].healnum = healnum; with (global.charinstance[star]) { ha = instance_create(x, y, obj_healanim); ha.target = id; dmgwr = scr_dmgwriter_selfchar(); with (dmgwr) { delay = 8; type = 3; } if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]]) { with (dmgwr) specialmessage = 3; } dmgwr.damage = healnum; tu += 1; } global.spelldelay = 15; break; case 3: if (global.monster[star] == 0) scr_retarget_spell(); if (global.monster[star] == 1) { if (global.monsterstatus[star] == 1) { with (global.monsterinstance[star]) { if (global.monstertype[myself] != 19 && global.monstertype[myself] != 3Dummy) { global.flag[51 + myself] = 3; event_user(10); scr_monsterdefeat(); } else { pacifycon = 1; global.spelldelay = 999; } } } else { _pspell = instance_create(0, 0, obj_pacifyspell); _pspell.target = global.monsterinstance[star]; _pspell.fail = 1; } } global.spelldelay = 20; break; case 4: cancelattack = 0; global.spelldelay = 30; if (global.monster[star] == 0) scr_retarget_spell(); if (cancelattack == 0) { global.spelldelay = 70; damage = ceil(((global.battlemag[arg1] * 5) + (global.battleat[arg1] * 11)) - (global.monsterdf[star] * 3)); if (global.automiss[star] == 1) damage = 0; attack = instance_create(obj_herosusie.x, obj_herosusie.y, obj_rudebuster_anim); attack.damage = damage; attack.star = star; attack.caster = caster; attack.target = global.monsterinstance[star]; } break; case 5: ...
(global.charspecial[myself], myself);
4
state = 0;
5
attacktimer = 0;