Spells

Relevant Scripts:

  • gml_GlobalScript_scr_spell
  • gml_GlobalScript_scr_spelltext
  • gml_GlobalScript_scr_spellinfo
  • gml_GlobalScript_scr_spellinfo_all
  • gml_GlobalScript_scr_iteminfo
  • gml_Object_obj_battlecontroller_Step_0
Table of All Spells
Spell ID Spell Name Battle Alias Description Battle Description Cost Spell Target?
0 [EMPTY] None -1 ( actual TP amount -0.4%)
0 - No decision given
1 Rude Sword RudeSword Deals moderate Rude-elemental damage to#one foe. Depends on Attack & Magic. Rude#damage 125 ( actual TP amount 50.0%)
2 - Selects an opponent
2 Heal Prayer Heal Prayer Heavenly light restores a little HP to#one party member. Depends on Magic. Heal#ally 80 ( actual TP amount 32.0%)
1 - Selects an ally
3 Pacify Pacify SPARE a tired enemy by putting them to sleep. Spare#TIRED foe 40 ( actual TP amount 16.0%)
If Ralsei has the item with the ID 32 Pacify will cost 0 TP
2 - Selects an opponent
4 Rude Buster Rude Buster Deals moderate Rude-elemental damage to#one foe. Depends on Attack & Magic. Rude#damage 125 ( actual TP amount 50.0%)
If Susie has the item with the ID 7 Rude Buster will cost 40 TP
2 - Selects an opponent
5 Red Buster Red Buster Red#damage 0 ( actual TP amount 0.0%)
2 - Selects an opponent
6 Dual Heal Dual Heal Heal All#30 HP 0 ( actual TP amount 0.0%)
0 - No decision given
7 ACT ACT It's not magic, is it?#No, not something like this. Use#action 0 ( actual TP amount 0.0%)
0 - No decision given
8 SleepMist Sleep Mist A cold mist sweeps through,#sparing all TIRED enemies. Spare#TIRED foes 80 ( actual TP amount 32.0%)
0 - No decision given
9 IceShock IceShock Deals magical ICE damage to#one enemy. Damage#w/ ICE 40 ( actual TP amount 16.0%)
If Noelle has the item with the ID 13 IceShock will cost 50% less TP
2 - Selects an opponent
10 SnowGrave SnowGrave Deals the fatal damage to#all of the enemies. Fatal 250 ( actual TP amount 100.0%)
If Noelle has the item with the ID 13 SnowGrave will cost 50% less TP
0 - No decision given
11 BetterHeal BetterHeal A healing spell that has grown#with practice and confidence. Heal#ally It depends.
1 - Selects an ally
12 ReviveSong ReviveSong Revives a DOWNed ally and heals them.#Otherwise, heals a lot of HP. Revive#ally 212 ( actual TP amount 84.80000000000001%)
1 - Selects an ally

Spells are casted either during battle or in the Power menu (This goes nearly completly unusued however because TP gets turned into extra dark dollars after pretty much every battle.)

note

While the word "spells" may imply that this code is only used for spells you can cast this also applies to items in scr_spell. Pretty much everywhere else though this doesn't apply.

Spell Structure

In DELTARUNE spells contain:

View gml_GlobalScript_scr_spellinfo to compare

  • An ID
    • This is used in the switch case statement inside of scr_spell to decide what code to run and is checked in scr_spelltext to decide which code to display upon use.
  • Spell Name
    • Known as spellname, this is the name that will show up in the Power Menu
  • Battle Alias
    • Known as spellnameb, this is the name that will show up during battle
  • Spell Description
    • Known as spelldesc, this is the description that will show up in the Power Menu
  • Battle Description
    • Known as spelldescb, this is the description that will show up during battle
  • Spell Target
    • Known as spelltarget, this is the target of the spell
      • 0 doesn't give a decision
      • 1 selects an ally
      • 2 selects an opponent
  • TP Cost
    • Known as cost, this is the amount of TP it costs to use that spell. Please note that the TP cost will be 2/5 of what you put here. 80 cost = 32% TP
  • Overworld Usability
    • Known as spellusable, this determines wether or not the spell is usable in the overworld.
  • Spell Usability
    • Known as usable, this variable's use is currently unknown, it is most likely a remnant of scr_iteminfo.

global.spell

global.spell is a 2D array that stores the spell each party member currently has. The first value is the party member, the second is the ID for the spell in question.

global.spell[1][32]

global.spelldelay

global.spelldelay is the time it takes between spells to be casted during battle.

global.spelldelay = 32

Scripts

This section is an overview of individual scripts related to spells

scr_spell

Handles how spells are cast during battle.

  • arg0/spell is the ID of the spell to be cast
  • arg1/caster is the caster of the spell
  • star is the star of the attack/the one who is targetted by the attack

Example Usage

    case 32:
        healnum = global.battlemag[arg1] * 999;
        scr_heal(star, healnum);
        global.charinstance[star].healnum = healnum;
        global.spelldelay = 15;
        break;

scr_spell_overworld

Handles what happens when a spell is run in the overworld. Only used by Heal Prayer (ID:2)

Example Usage

    case 32:
        scr_healitem(global.charselect, 999);
        break;

scr_spellinfo_all

Inerts the spells from scr_spellinfo into the global versions of their respective functions

global.spellname[j][i] = spellname;

scr_spellget

only works in chapter 2+

The recommended way to give a spell to a party member.

  • arg0 is the party member
  • arg1 is the ID of the spell to be given

Example Usage

scr_spellget(4, 32)