Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_determine_attacking_damage_stat_critical

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

function scr_determine_attacking_damage_stat_critical() //gml_Script_scr_determine_attacking_damage_stat_critical { var player_weapon = global.player_weapon var player_weapon_modifier = global.player_weapon_modifier var enemy_count = global.enemy_count switch player_weapon { case "Toy Gun": switch player_weapon_modifier { case "Pebble Ammo": case "Cff Bean Ammo": case "Glass Ammo": case "Super Ammo": case "Silver Ammo": var hit_count = 1 break case "Ice Pellets": hit_count = 2 break case "Flint": case "Friendliness Pellets": case "Nails": hit_count = 3 break default: hit_count = 1 } global.attacking_damage_stat_critical = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat + 2) * 2.5) if (enemy_count >= 2) global.attacking_damage_stat_critical_2 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_2 + 2) * 2.5) if (enemy_count >= 3) global.attacking_damage_stat_critical_3 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_3 + 2) * 2.5) break case "Wild Revolver": switch player_weapon_modifier { case "Pebble Ammo": case "Cff Bean Ammo": case "Glass Ammo": case "Super Ammo": case "Silver Ammo": hit_count = 1 break case "Ice Pellets": hit_count = 2 break case "Flint": case "Friendliness Pellets": case "Nails": hit_count = 3 break default: hit_count = 1 } global.attacking_damage_stat_critical = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat + 2) * 3.5) if (enemy_count >= 2) global.attacking_damage_stat_critical_2 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_2 + 2) * 3.5) if (enemy_count >= 3) global.attacking_damage_stat_critical_3 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_3 + 2) * 3.5) break default: global.attacking_damage_stat_critical = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat + 2) * 2.5) if (enemy_count >= 2) global.attacking_damage_stat_critical_2 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_2 + 2) * 2.5) if (enemy_count >= 3) global.attacking_damage_stat_critical_3 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_3 + 2) * 2.5) } }
() //gml_Script_scr_determine_attacking_damage_stat_critical
2
{
3
    var player_weapon = global.player_weapon
4
    var player_weapon_modifier = global.player_weapon_modifier
5
    var enemy_count = global.enemy_count
6
    switch player_weapon
7
    {
8
        case "Toy Gun":
9
            switch player_weapon_modifier
10
            {
11
                case "Pebble Ammo":
12
                case "Cff Bean Ammo":
13
                case "Glass Ammo":
14
                case "Super Ammo":
15
                case "Silver Ammo":
16
                    var hit_count = 1
17
                    break
18
                case "Ice Pellets":
19
                    hit_count = 2
20
                    break
21
                case "Flint":
22
                case "Friendliness Pellets":
23
                case "Nails":
24
                    hit_count = 3
25
                    break
26
                default:
27
                    hit_count = 1
28
            }
29
30
            global.attacking_damage_stat_critical = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat + 2) * 2.5)
31
            if (enemy_count >= 2)
32
                global.attacking_damage_stat_critical_2 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_2 + 2) * 2.5)
33
            if (enemy_count >= 3)
34
                global.attacking_damage_stat_critical_3 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_3 + 2) * 2.5)
35
            break
36
        case "Wild Revolver":
37
            switch player_weapon_modifier
38
            {
39
                case "Pebble Ammo":
40
                case "Cff Bean Ammo":
41
                case "Glass Ammo":
42
                case "Super Ammo":
43
                case "Silver Ammo":
44
                    hit_count = 1
45
                    break
46
                case "Ice Pellets":
47
                    hit_count = 2
48
                    break
49
                case "Flint":
50
                case "Friendliness Pellets":
51
                case "Nails":
52
                    hit_count = 3
53
                    break
54
                default:
55
                    hit_count = 1
56
            }
57
58
            global.attacking_damage_stat_critical = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat + 2) * 3.5)
59
            if (enemy_count >= 2)
60
                global.attacking_damage_stat_critical_2 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_2 + 2) * 3.5)
61
            if (enemy_count >= 3)
62
                global.attacking_damage_stat_critical_3 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_3 + 2) * 3.5)
63
            break
64
        default:
65
            global.attacking_damage_stat_critical = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat + 2) * 2.5)
66
            if (enemy_count >= 2)
67
                global.attacking_damage_stat_critical_2 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_2 + 2) * 2.5)
68
            if (enemy_count >= 3)
69
                global.attacking_damage_stat_critical_3 = round((global.player_weapon_attack + global.player_weapon_modifier_attack + global.player_attack - global.enemy_defense_stat_3 + 2) * 2.5)
70
    }
71
72
}