コード例 #1
0
 public void manageEquipment(string selected_slot_table, bool mount = false)
 {
     this.selected_slot_table = selected_slot_table;
     if (mount)
     {
         if (we_mode == "Edit" || we_mode == "Create")
         {
             selectEquipment();
         }
     }
     else
     {
         if (we_mode == "Interactive")
         {
             if (EquipedModel.throwSuccesfulyEqpToInv(PlayerEquiped, EquipedModel.getEqp(PlayerEquiped, selected_slot_table)))
             {
                 deselectEquipment();
             }
         }
         if (we_mode == "Edit" || we_mode == "Create")
         {
             deselectEquipment();
         }
         setEquipmentInfo();
     }
 }
コード例 #2
0
        private void mountEquipment(object item, int slot_idx)
        {
            string equipment_type            = (item as EquipmentModel).ItemType;
            object already_mounted_equipment = EquipedModel.getEqp(PlayerEquiped, equipment_type);

            if (!(already_mounted_equipment as ItemModel).Name.Equals("") && !(already_mounted_equipment as ItemModel).Name.Equals("Unarmed"))
            {
                PlayerEquiped.InventoryItem[slot_idx] = already_mounted_equipment;
            }
            else
            {
                unmountItem(slot_idx.ToString());
            }
            EquipedModel.mountEqp(PlayerEquiped, item);
        }