| 1 |
if (instance_exists(obj_dialogue_battle_flee)) |
| 2 |
{ |
| 3 |
switch (global.enemy_count) |
| 4 |
{ |
| 5 |
case 1: |
| 6 |
if (global.enemy_dead == false) |
| 7 |
{ |
| 8 |
global.enemy_exp = 0; |
| 9 |
global.enemy_gold = 0; |
| 10 |
} |
| 11 |
global.player_exp += global.enemy_exp; |
| 12 |
global.player_gold += global.enemy_gold; |
| 13 |
break; |
| 14 |
case 2: |
| 15 |
if (global.enemy_dead == false) |
| 16 |
{ |
| 17 |
global.enemy_gold = 0; |
| 18 |
global.enemy_exp = 0; |
| 19 |
} |
| 20 |
if (global.enemy_dead_2 == false) |
| 21 |
{ |
| 22 |
global.enemy_gold_2 = 0; |
| 23 |
global.enemy_exp_2 = 0; |
| 24 |
} |
| 25 |
global.player_exp += (global.enemy_exp + global.enemy_exp_2); |
| 26 |
global.player_gold += (global.enemy_gold + global.enemy_gold_2); |
| 27 |
break; |
| 28 |
case 3: |
| 29 |
if (global.enemy_dead == false) |
| 30 |
{ |
| 31 |
global.enemy_gold = 0; |
| 32 |
global.enemy_exp = 0; |
| 33 |
} |
| 34 |
if (global.enemy_dead_2 == false) |
| 35 |
{ |
| 36 |
global.enemy_gold_2 = 0; |
| 37 |
global.enemy_exp_2 = 0; |
| 38 |
} |
| 39 |
if (global.enemy_dead_3 == false) |
| 40 |
{ |
| 41 |
global.enemy_gold_3 = 0; |
| 42 |
global.enemy_exp_3 = 0; |
| 43 |
} |
| 44 |
global.player_exp += (global.enemy_exp + global.enemy_exp_2 + global.enemy_exp_3); |
| 45 |
global.player_gold += (global.enemy_gold + global.enemy_gold_2 + global.enemy_gold_3); |
| 46 |
break; |
| 47 |
} |
| 48 |
if (global.player_exp >= global.player_exp_next[global.player_level]) |
| 49 |
{ |
| 50 |
for (var i = global.player_level; i <= 20; i += 1) |
| 51 |
{ |
| 52 |
if (global.player_exp >= global.player_exp_next[i]) |
| 53 |
{ |
| 54 |
global.player_level = i + 1; |
| 55 |
global.max_hp_self = global.player_hp_next[i]; |
| 56 |
global.player_attack = global.player_attack_next[i]; |
| 57 |
global.player_defense = global.player_defense_next[i]; |
| 58 |
} |
| 59 |
else |
| 60 |
{ |
| 61 |
break; |
| 62 |
} |
| 63 |
} |
| 64 |
} |
| 65 |
} |
| 66 |
var game_mode = global.game_mode; |
| 67 |
if (game_mode == "customs") |
| 68 |
{ |
| 69 |
var battle_enemy_name = global.battle_enemy_name; |
| 70 |
if (battle_enemy_name == "craniex") |
| 71 |
{ |
| 72 |
if (global.enemy_spared == true) |
| 73 |
global.enemy_craniex_status = "spared"; |
| 74 |
else if (global.enemy_dead == true) |
| 75 |
global.enemy_craniex_status = "dead"; |
| 76 |
} |
| 77 |
if (battle_enemy_name == "ms mettaton") |
| 78 |
{ |
| 79 |
if (global.enemy_spared == true) |
| 80 |
global.enemy_ms_mettaton_status = "spared"; |
| 81 |
else if (global.enemy_dead == true) |
| 82 |
global.enemy_ms_mettaton_status = "dead"; |
| 83 |
} |
| 84 |
room_goto(rm_black_screen_cutscene); |
| 85 |
} |
| 86 |
else if (game_mode == "yellow") |
| 87 |
{ |
| 88 |
obj_pl.image_alpha = 1; |
| 89 |
if (global.party_member != -4 && instance_exists(global.party_member)) |
| 90 |
global.party_member.image_alpha = 1; |
| 91 |
scr_cutscene_end(); |
| 92 |
room_goto(asset_get_index(global.current_room_overworld)); |
| 93 |
instance_create(0, 0, obj_overworld_fade_in_screen); |
| 94 |
global.sound_carry_overworld = false; |
| 95 |
} |