Exemplo n.º 1
0
        public void UnitMenuDiscard(Game_Unit unit, int index)
        {
            TactileLibrary.Item_Data discarded_item =
                unit.actor.whole_inventory[index];
            if (Global.battalion.convoy_ready_for_sending)
            {
                Global.game_battalions.add_item_to_convoy(discarded_item);
                set_item_sent_popup(discarded_item, 240);
            }
            else
            {
                set_item_drop_popup(discarded_item, 240);
            }

            unit.actor.discard_item(index);
            unit.actor.organize_items();

            // If the inventory is still too full after discarding,
            // the discard menu just goes inactive until the map popup closes
            if (unit.actor.too_many_items)
            {
                UnitMenu = UnitMenuManager.ReopenDiscard(this);
            }
            else
            {
                UnitMenu = null;
                if (!Global.game_system.preparations)
                {
                    Global.game_temp.menuing = false;
                }
                Global.game_temp.discard_menuing      = false;
                Global.game_temp.force_send_to_convoy = false;
            }
        }
Exemplo n.º 2
0
 public Test_Battle_Character_Data()
 {
     WLvls = new int[Global.weapon_types.Count - 1];
     for (int i = 0; i < Items.Length; i++)
     {
         Items[i] = new TactileLibrary.Item_Data();
     }
 }
Exemplo n.º 3
0
 public bool can_target_item(Item_Data item_data)
 {
     if (can_repair && item_data.is_weapon)
     {
         Data_Weapon weapon = item_data.to_weapon;
         if (!weapon.is_staff() && weapon.Uses > 0 && item_data.Uses < weapon.Uses)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
        private void item_node(int unit_index, int index, List <CommandUINode> nodes)
        {
            Status_Item item = new Status_Item();

            TactileLibrary.Item_Data item_data = unit_index == 0 ?
                                                 actor1.whole_inventory[index] :
                                                 actor2.whole_inventory[index];
            item.set_image(unit_index == 0 ? actor1 : actor2, item_data);

            var node = new ItemUINode("", item, SPACING - 16); //Debug

            node.loc = new Vector2(8, 8) + new Vector2(SPACING * unit_index, index * 16);
            nodes.Add(node);
        }
Exemplo n.º 5
0
        public static Item_Data read(BinaryReader reader)
        {
            int       count = reader.ReadInt32();
            Item_Data result;

            if (count == 3)
            {
                result = new Item_Data(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32());
            }
            else //Debug
            {
                result = new Item_Data(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32());
            }

            return(result);
        }
Exemplo n.º 6
0
 public bool same_item(Item_Data item)
 {
     return(Type == item.Type && Id == item.Id);
 }
Exemplo n.º 7
0
 public Item_Data(Item_Data data) : this(data.Type, data.Id, data.Uses)
 {
 }
Exemplo n.º 8
0
 protected override bool buyable_text(int price, TactileLibrary.Item_Data item_data)
 {
     return(item_data.to_equipment.Can_Sell);
 }