Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_determine_attack_bonus

(view raw script w/o annotations or w/e)
1
function scr_determine_attack_bonus
scr_determine_attack_bonus

function scr_determine_attack_bonus() //gml_Script_scr_determine_attack_bonus { var player_weapon = global.player_weapon var player_weapon_modifier = global.player_weapon_modifier switch player_weapon { case "Toy Gun": case "Wild Revolver": switch player_weapon_modifier { case "Cff Bean Ammo": if (instance_exists(obj_text_damage_count) && shot_type == "strong") { instance_create((obj_text_fighting_parent.x - 1), (obj_text_fighting_parent.y - 27), obj_text_fighting_bonus_any) with (obj_text_fighting_bonus_any) { text = "SP+1" script_execute(gml_Script_scr_color_sp_bonus) c_color = c_sp_bonus } if (global.current_sp_self == 0) global.current_sp_self = 1 if (global.current_sp_self > global.max_sp_self) global.current_sp_self = global.max_sp_self } break case "Glass Ammo": if (instance_exists(obj_text_damage_count) && shot_type == "strong") { instance_create((obj_text_fighting_parent.x - 1), (obj_text_fighting_parent.y - 27), obj_text_fighting_bonus_any) with (obj_text_fighting_bonus_any) { text = "HP+2" script_execute(gml_Script_scr_color_hp_bonus) c_color = c_hp_bonus } if (global.current_hp_self > global.max_hp_self) return; global.current_hp_self += 2 if (global.current_hp_self > global.max_hp_self) global.current_hp_self = global.max_hp_self } break default: } break default: } }
() //gml_Script_scr_determine_attack_bonus
2
{
3
    var player_weapon = global.player_weapon
4
    var player_weapon_modifier = global.player_weapon_modifier
5
    switch player_weapon
6
    {
7
        case "Toy Gun":
8
        case "Wild Revolver":
9
            switch player_weapon_modifier
10
            {
11
                case "Cff Bean Ammo":
12
                    if (instance_exists(obj_text_damage_count) && shot_type == "strong")
13
                    {
14
                        instance_create((obj_text_fighting_parent.x - 1), (obj_text_fighting_parent.y - 27), obj_text_fighting_bonus_any)
15
                        with (obj_text_fighting_bonus_any)
16
                        {
17
                            text = "SP+1"
18
                            script_execute(gml_Script_scr_color_sp_bonus)
19
                            c_color = c_sp_bonus
20
                        }
21
                        if (global.current_sp_self == 0)
22
                            global.current_sp_self = 1
23
                        if (global.current_sp_self > global.max_sp_self)
24
                            global.current_sp_self = global.max_sp_self
25
                    }
26
                    break
27
                case "Glass Ammo":
28
                    if (instance_exists(obj_text_damage_count) && shot_type == "strong")
29
                    {
30
                        instance_create((obj_text_fighting_parent.x - 1), (obj_text_fighting_parent.y - 27), obj_text_fighting_bonus_any)
31
                        with (obj_text_fighting_bonus_any)
32
                        {
33
                            text = "HP+2"
34
                            script_execute(gml_Script_scr_color_hp_bonus)
35
                            c_color = c_hp_bonus
36
                        }
37
                        if (global.current_hp_self > global.max_hp_self)
38
                            return;
39
                        global.current_hp_self += 2
40
                        if (global.current_hp_self > global.max_hp_self)
41
                            global.current_hp_self = global.max_hp_self
42
                    }
43
                    break
44
                default:
45
46
            }
47
48
            break
49
        default:
50
51
    }
52
53
}