Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_heart_player_response_sell_shop_Step_0

(view raw script w/o annotations or w/e)
1
var player_gold = global.player_gold
2
var sell_shop_screen_number = global.sell_shop_screen_number
3
script_execute(gml_Script_scr_controls_shop_sell)
4
if key_select
5
{
6
    if (response_shop_screen_number == 1)
7
    {
8
        if (global.item_slot[sell_shop_screen_number] != "Nothing")
9
        {
10
            global.sell_shop_screen_number = 1
11
            global.player_gold += scr_determine_sell_price_shop
scr_determine_sell_price_shop

function scr_determine_sell_price_shop(argument0) //gml_Script_scr_determine_sell_price_shop { switch argument0 { case "Lemonade": case "Candy Corn": case "Corn Dog": case "Sponge Cake": case "Hndw Coffee": case "Hndw Pancake": case "G.B. Bear": case "Hot Pop": case "Lukewarm Pop": case "Cold Pop": case "Packing Peanuts": case "Moss Salad": case "Grassy Fries": case "Flower Stew": case "Gravity Granola": case "Dihydrogen Monoxide": case "Popato Chisps": case "Beef Jerky": case "Cake": case "Monster Candy": case "Monster Candy+": case "C-B Strudel": case "Floral Cupcake": case "Hot Dog": case "Corn Chowder": return 15; case "G. Coffee": case "G. Pear": case "G. Cactus": return 50; case "Adult Soda": return 25; case "Patch": case "Feather": case "Pebble Ammo": case "Silver Ammo": case "Rubber Ammo": case "Cff Bean Ammo": case "Honeydew Pin": case "Band Merch Pin": case "Safety Goggles": case "Nails": case "Friendliness Pellets": return 15; case "Golden Scarf": case "Super Ammo": case "Delta Rune Patch": return 100; case "Necklace": return 100; case "Icewater": case "Feisty Slider": return 15; case "Root Beer": return 25; case "H. Acid": return 0; default: return 15; } }
(global.item_slot[sell_shop_screen_number])
12
            global.player_response = 1
13
            scr_item_remove
scr_item_remove

function scr_item_remove(argument0) //gml_Script_scr_item_remove { i = 1 while (i <= 8) { if (global.item_slot[i] == argument0) { while (i < 8) { global.item_slot[i] = global.item_slot[(i + 1)] i += 1 } global.item_slot[8] = "Nothing" return true; } else { if (i == 8) return false; i += 1 continue } } }
(global.item_slot[sell_shop_screen_number])
14
            audio_play_sound(snd_shop_purchase, 20, 0)
15
            instance_create(0, 0, obj_dialogue_sell_real_shop)
16
            instance_destroy(obj_text_sell_confirmation_shop)
17
            instance_destroy()
18
        }
19
    }
20
    else if (response_shop_screen_number == 2)
21
    {
22
        global.player_response = 2
23
        event_user(0)
24
        return;
25
    }
26
}
27
if (key_revert && key_select == 0)
28
{
29
    global.player_response = 2
30
    event_user(0)
31
    return;
32
}
33
if (key_select == 0 && key_revert == 0)
34
{
35
    if (key_left || key_right)
36
    {
37
        audio_play_sound(snd_mainmenu_select, 1, 0)
38
        if (response_shop_screen_number == 1)
39
            response_shop_screen_number = 2
40
        else
41
            response_shop_screen_number = 1
42
    }
43
}
44
if (response_shop_screen_number == 1)
45
{
46
    x = obj_talk_screen_shop.x + 49
47
    y = obj_talk_screen_shop.y + 103
48
}
49
else if (response_shop_screen_number == 2)
50
{
51
    x = obj_talk_screen_shop.bbox_right - 91
52
    y = obj_talk_screen_shop.y + 103
53
}