Esempio n. 1
0
        public void give()
        {
            TactileLibrary.Item_Data item_data = actor.items[Item_Window.index];
            if (!actor.can_give(item_data))
            {
                Global.game_system.play_se(System_Sounds.Buzzer);
                return;
            }

            Global.game_battalions.add_item_to_convoy(actor.items[Item_Window.index]);
            bool giving_equipped = Item_Window.index == actor.equipped - 1;

            actor.discard_item(Item_Window.index);

            // If can't give anymore
            if (!can_give)
            {
                Global.game_system.play_se(System_Sounds.Cancel);
                cancel_trading();
            }
            else
            {
                Global.game_system.play_se(System_Sounds.Confirm);
            }
            Traded = true;
            if (Item_Window.index < Item_Window.equipped || Item_Window.equipped == 0)
            {
                actor.setup_items(false);
                Item_Window.refresh_equipped_tag();
            }
            refresh();
            item_window_index_changed();
            // Add jumping to the correct page and probably jumping to the correct line for the item here //Debug?
            Supply_Window.jump_to(item_data);
        }
Esempio n. 2
0
        public void give()
        {
            TactileLibrary.Item_Data item_data = actor.items[Item_Window.index];
            if (!can_give || !actor.can_give(item_data))
            {
                Global.game_system.play_se(System_Sounds.Buzzer);
                return;
            }

            Global.game_battalions.add_item_to_convoy(actor.items[Item_Window.index]);
            actor.discard_item(Item_Window.index);
            if (can_give)
            {
                Global.game_system.play_se(System_Sounds.Confirm);
            }
            else
            {
                Global.game_system.play_se(System_Sounds.Cancel);
            }
            Traded = true;
            refresh();
            item_window_index_changed();
            // Add jumping to the correct page and probably jumping to the correct line for the item here //Debug?
            Supply_Window.jump_to(item_data);
            if (can_give)
            {
                Item_Window.active = true;
            }
            else
            {
                switch_giving();
            }
        }