|
4
|
scr_spellscr_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] != 3 && global.monstertype[myself] != 52 && global.monstertype[myself] != 43Berdly (coaster))
{
var yoffy;
if (global.monstertype[myself] == 33Werewire)
yoffy = -60;
else
yoffy = 0;
_pspell = instance_create(global.monsterx[myself], global.monstery[myself] + yoffy, obj_pacifyspell);
_pspell.con = 20;
_pspell.target = id;
global.flag[51 + myself] = 3;
event_user(10);
scr_monsterdefeat();
}
else
{
if (global.monstertype[myself] == 52Jigsaw Joe)
{
_pspell = instance_create(global.monsterx[myself], global.monstery[myself], obj_pacifyspell);
_pspell.con = 20;
_pspell.target = id;
}
if (global.monstertype[myself] == 43Berdly (coaster))
{
_pspell = instance_create(global.monsterx[myself], global.monstery[myself], obj_pacifyspell);
_pspell.con = 20;
_pspell.target = id;
global.flag[51 + myself] = 3;
with (obj_berdlyb_enemy)
endcon = 1;
exit;
}
pacifycon = 1;
global.spelldelay = 999;
}
}
}
else
{
if (global.monstertype[myself] == 52Jigsaw Joe)
pacifycon = -2;
... (global.charspecial[myself], myself);
|