Exemple #1
0
        internal item SellItem(unit shop, HabProperties hpsItem)
        {
            if (hpsItem == null || Current.unit == null)
            {
                return(null);
            }

            // the map script checks if buying unit
            // is located near the shop, so here we set
            // the hero's location to the selected shop's location
            // & remove other units from shop checking
            foreach (unit unit in Current.player.units.Values)
            {
                if (unit == Current.unit)
                {
                    unit.set_location(shop.get_location());
                }
                else
                {
                    unit.set_location(new location(0, 0));
                }
            }

            switch (combineMode)
            {
            case CombineMode.Fast:
                return(SellItemFast(shop, hpsItem));

            default:
                return(SellItemNormal(shop, hpsItem));
            }
        }