Beispiel #1
0
void ShaderManager::init()
{
  // We normally want to check base materials
  std::list < std::string > materialsToCheck;
  materialsToCheck.push_back("/base/simple");
  materialsToCheck.push_back("/base/normalmap");
  materialsToCheck.push_back("/base/normalmap/specular");

  bool supported;

  // Iterate schemes from best to worst
  for (std::map<GraphicsLevel, std::string>::reverse_iterator I = mGraphicSchemes.rbegin(); I != mGraphicSchemes.rend(); ++I) {

    Ogre::MaterialManager::getSingleton().setActiveScheme(I->second);

    supported = true;
    for (std::list<std::string>::iterator J = materialsToCheck.begin(); J != materialsToCheck.end(); ++J) {
      supported &= checkMaterial(*J, I->second);
      // Break when found first unsupported material, no need to check others
      if (!supported) {
        break;
      }
    }

    // Found some supported sheme, ok
    if (supported) {
      mBestGraphicsLevel = I->first;
      S_LOG_INFO("Best graphics level is " << I->second);
      break;
    }
  }

  // No scheme is supported, something wrong with graphics
  if (!supported) {
    S_LOG_FAILURE("No schemes is supported");
    throw Exception("No schemes is supported, something wrong with graphics");
  }

  // Don't start in experimental level
  mGraphicsLevel = (mBestGraphicsLevel < LEVEL_EXPERIMENTAL) ? mBestGraphicsLevel : LEVEL_HIGH;

  GraphicsLevel configLevel = getLevelByName(std::string(EmberServices::getSingleton().getConfigService().getValue("graphics", "level")));
  if (configLevel <= mBestGraphicsLevel) {
    mGraphicsLevel = configLevel;
  }

  setGraphicsLevel(mGraphicsLevel);
}
Beispiel #2
0
void CharData::getScrollTips(baseTreasure* bt, json_spirit::Object& robj)
{
    //cout<<"getScrollTips() "<<endl;
    equipment_scroll* sp = Singleton<equipment_scroll_mgr>::Instance().getScroll(bt->value);
    if (!sp)
    {
        //cout<<"not find, "<<bt->value<<endl;
        return;
    }
    json_spirit::Array mlist;
    json_spirit::Object o;
    o.push_back( Pair("name", sp->m_equipment_src->name) );
    o.push_back( Pair("need", 1) );

    EquipmentData* src_eq = m_bag.getDefaultEquip(sp->m_src_equipment, 999);
    if (src_eq)
    {
        o.push_back( Pair("num", 1) );
    }
    else
    {
        o.push_back( Pair("num", 0) );
    }
    mlist.push_back(o);

    //检查材料是否足够
    checkMaterial(sp, *this, m_bag, mlist);

    robj.push_back( Pair("mlist", mlist) );
    if (sp->m_equipment.get())
    {
        o.clear();
        json_spirit::Array canMake;//用数组是为了跟材料tips结构统一
        o.push_back( Pair("type", iItem_type_equipment) );
        o.push_back( Pair("quality", sp->m_equipment->quality) );
        o.push_back( Pair("level", sp->m_equipment->needLevel) );
        o.push_back( Pair("name", sp->m_equipment->name) );
        canMake.push_back(o);
        robj.push_back( Pair("canMake", canMake) );
    }
    return;
}
Beispiel #3
0
//打开物品
int CharData::openSlotItm(int slot, int nums, json_spirit::Object& robj)
{
    boost::shared_ptr<iItem> itm = m_bag.getItem(slot);
    if (!itm.get())
    {
        return HC_ERROR;
    }
    if (itm->getType() != iItem_type_gem)
    {
        return HC_ERROR;
    }
    int use_num = itm->getCount();
    if (nums > 0 && itm->getCount() > nums)
    {
        use_num = nums;
    }
    Gem* pg = dynamic_cast<Gem*>(itm.get());
    robj.push_back( Pair("use", pg->getUsage()) );

    switch (pg->getUsage())
    {
        //变身卡
        case ITEM_USAGE_CHANGE_CARD:
        {
            m_change_spic = itm->getSubtype() - 499;
            m_change_spic_time = time(NULL) + 7200;
            m_bag.removeItem(slot);
            itm->Clear();
            itm->Save();
            //robj.push_back( Pair("refresh", 1) );
            setExtraData(char_data_type_normal, char_data_change_spic, m_change_spic);
            setExtraData(char_data_type_normal, char_data_change_spic_time, m_change_spic_time);
            return HC_SUCCESS;
        }
        //兑换货币
        case ITEM_USAGE_SILVER_CARD:
        {
            int total = pg->getValue() * use_num;
            addSilver(total);
            //银币统计
            add_statistics_of_silver_get(m_id,m_ip_address,total,silver_get_by_treasure, m_union_id, m_server_id);
            json_spirit::Object obj;
            obj.push_back( Pair("type", item_type_silver) );
            obj.push_back( Pair("count", total) );
            obj.push_back( Pair("id", 0) );
            obj.push_back( Pair("fac", 0) );
            obj.push_back( Pair("name", strSilver) );
            robj.push_back( Pair("get", obj) );
            if (itm->getCount() > use_num)
            {
                itm->addCount(-use_num);
            }
            else
            {
                m_bag.removeItem(slot);
                itm->Clear();
            }
            itm->Save();
            NotifyCharData();
            return HC_SUCCESS;
        }
        case ITEM_USAGE_GOLD_CARD:
        {
            int total = pg->getValue() * use_num;
            addGold(total);
            //金币获得统计
            add_statistics_of_gold_get(m_id,m_ip_address,total,gold_get_treasure, m_union_id, m_server_id);
            json_spirit::Object obj;
            obj.push_back( Pair("type", item_type_gold) );
            obj.push_back( Pair("count", total) );
            obj.push_back( Pair("id", 0) );
            obj.push_back( Pair("fac", 0) );
            obj.push_back( Pair("name", strGold) );
            robj.push_back( Pair("get", obj) );
            if (itm->getCount() > use_num)
            {
                itm->addCount(-use_num);
            }
            else
            {
                m_bag.removeItem(slot);
                itm->Clear();
            }
            itm->Save();
            NotifyCharData();
            return HC_SUCCESS;
        }
        case ITEM_USAGE_YUSHI_CARD:
        {
            int total = pg->getValue() * use_num;
            addTreasure(treasure_type_yushi, total);
            json_spirit::Object obj;
            obj.push_back( Pair("type", item_type_treasure) );
            obj.push_back( Pair("count", total) );
            obj.push_back( Pair("id", treasure_type_yushi) );
            obj.push_back( Pair("fac", 0) );
            boost::shared_ptr<baseTreasure> tr = GeneralDataMgr::getInstance()->GetBaseTreasure(treasure_type_yushi);
            if (tr.get())
            {
                obj.push_back( Pair("quality", tr->quality) );
                obj.push_back( Pair("spic", tr->spic) );
                obj.push_back( Pair("name", tr->name) );
            }
            robj.push_back( Pair("get", obj) );
            if (itm->getCount() > use_num)
            {
                itm->addCount(-use_num);
            }
            else
            {
                m_bag.removeItem(slot);
                itm->Clear();
            }
            itm->Save();
            return HC_SUCCESS;
        }
        case ITEM_USAGE_PRESTIGE_CARD:
        {
            int total = pg->getValue() * use_num;
            addPrestige(total);
            json_spirit::Object obj;
            obj.push_back( Pair("type", item_type_prestige) );
            obj.push_back( Pair("count", total) );
            obj.push_back( Pair("id", 0) );
            obj.push_back( Pair("fac", 0) );
            obj.push_back( Pair("name", strPrestige) );
            robj.push_back( Pair("get", obj) );
            if (itm->getCount() > use_num)
            {
                itm->addCount(-use_num);
            }
            else
            {
                m_bag.removeItem(slot);
                itm->Clear();
            }
            itm->Save();
            return HC_SUCCESS;
        }
        case ITEM_USAGE_SUPPLY_CARD:
        {
            int total = pg->getValue() * use_num;
            addTreasure(treasure_type_supply, total);
            json_spirit::Object obj;
            obj.push_back( Pair("type", item_type_treasure) );
            obj.push_back( Pair("count", total) );
            obj.push_back( Pair("id", treasure_type_supply) );
            obj.push_back( Pair("fac", 0) );
            boost::shared_ptr<baseTreasure> tr = GeneralDataMgr::getInstance()->GetBaseTreasure(treasure_type_supply);
            if (tr.get())
            {
                obj.push_back( Pair("quality", tr->quality) );
                obj.push_back( Pair("spic", tr->spic) );
                obj.push_back( Pair("name", tr->name) );
            }
            robj.push_back( Pair("get", obj) );
            if (itm->getCount() > use_num)
            {
                itm->addCount(-use_num);
            }
            else
            {
                m_bag.removeItem(slot);
                itm->Clear();
            }
            itm->Save();
            NotifyCharData();
            return HC_SUCCESS;
        }
        case ITEM_USAGE_GONGXUN_CARD:
        {
            int total = pg->getValue() * use_num;
            addTreasure(treasure_type_gongxun, total);
            json_spirit::Object obj;
            obj.push_back( Pair("type", item_type_treasure) );
            obj.push_back( Pair("count", total) );
            obj.push_back( Pair("id", treasure_type_gongxun) );
            obj.push_back( Pair("fac", 0) );
            boost::shared_ptr<baseTreasure> tr = GeneralDataMgr::getInstance()->GetBaseTreasure(treasure_type_gongxun);
            if (tr.get())
            {
                obj.push_back( Pair("quality", tr->quality) );
                obj.push_back( Pair("spic", tr->spic) );
                obj.push_back( Pair("name", tr->name) );
            }
            robj.push_back( Pair("get", obj) );
            if (itm->getCount() > use_num)
            {
                itm->addCount(-use_num);
            }
            else
            {
                m_bag.removeItem(slot);
                itm->Clear();
            }
            itm->Save();
            return HC_SUCCESS;
        }
        //卷轴
        case ITEM_USAGE_EQUIPMENT_SCROLL:
        {
            equipment_scroll* sp = Singleton<equipment_scroll_mgr>::Instance().getScroll(pg->getValue());
            if (!sp)
            {
                return HC_ERROR;
            }
            
            json_spirit::Object eq = sp->m_eqobj;

            bool canMake = true;

            json_spirit::Array mlist;

            json_spirit::Object o;
            o.push_back( Pair("name", sp->m_equipment_src->name) );
            o.push_back( Pair("type", iItem_type_equipment) );
            o.push_back( Pair("id", sp->m_equipment_src->baseid) );
            o.push_back( Pair("spic", sp->m_equipment_src->baseid) );
            o.push_back( Pair("quality", sp->m_equipment_src->quality) );
            o.push_back( Pair("need", 1) );
            if (sp->m_equipment_src->m_place.get())
            {
                bool can_sweep = false;
                o.push_back( Pair("info", sp->m_equipment_src->m_place->info) );
                if (sp->m_equipment_src->m_place->type == 1)
                {
                    can_sweep = m_tempo.check_stronghold_can_sweep(sp->m_equipment_src->m_place->mapId,sp->m_equipment_src->m_place->stageId,sp->m_equipment_src->m_place->pos);
                    boost::shared_ptr<StrongholdData> bstronghold = GeneralDataMgr::getInstance()->GetStrongholdData(sp->m_equipment_src->m_place->mapId,sp->m_equipment_src->m_place->stageId,sp->m_equipment_src->m_place->pos);
                    if (bstronghold.get())
                    {
                        o.push_back( Pair("open_level", bstronghold->m_level) );
                    }
                    o.push_back( Pair("can_sweep", can_sweep) );
                }
                else if (sp->m_equipment_src->m_place->type == 2)
                {
                    can_sweep = eliteCombatMgr::getInstance()->check_stronghold_can_attack(m_id,sp->m_equipment_src->m_place->mapId,sp->m_equipment_src->m_place->pos);
                    o.push_back( Pair("can_sweep", can_sweep) );
                }
            }

            EquipmentData* src_eq = m_bag.getDefaultEquip(sp->m_src_equipment, 999);
            if (src_eq)
            {
                robj.push_back( Pair("eid", src_eq->id) );
                o.push_back( Pair("num", 1) );

                int nextqLevel = src_eq->qLevel;
                int nextAdd = src_eq->addValue;
                int nextAdd2 = src_eq->addValue2;
                upgradeValue(sp->m_equipment->up_quality, src_eq->type, nextqLevel, nextAdd, nextAdd2);

                eq.push_back( Pair("level", nextqLevel) );
                eq.push_back( Pair("addNums", sp->m_equipment->baseValue + nextAdd) );

                if (nextAdd2 > 0)
                {
                    eq.push_back( Pair("addNums2", sp->m_equipment->baseValue2 + nextAdd2) );
                }
            }
            else
            {
                eq.push_back( Pair("level", 0) );
                eq.push_back( Pair("addNums", sp->m_equipment->baseValue) );
                if (sp->m_equipment->baseValue2 > 0)
                {
                    eq.push_back( Pair("addNums2", sp->m_equipment->baseValue2) );
                }

                o.push_back( Pair("num", 0) );
                canMake = false;
            }
            mlist.push_back(o);

            robj.push_back( Pair("eq", eq) );

            //检查材料是否足够
            canMake &= checkMaterial(sp, *this, m_bag, mlist);

            robj.push_back( Pair("mlist", mlist) );
            
            robj.push_back( Pair("canMake", canMake) );
            return HC_SUCCESS;
        }
        //VIP经验卡
        case ITEM_USAGE_VIP_EXP_80:
        case ITEM_USAGE_VIP_EXP:
        {
            if (m_vip < 0 || m_vip >= 12)
            {
                return HC_ERROR;
            }
            if (pg->getValue() <= 0)
            {
                return HC_ERROR;
            }
            int add = 0;
            int count = use_num;
            if (count >= itm->getCount())
            {
                count = itm->getCount();
            }
            else if (count <= 0)
            {
                count = 1;
            }
            int old_recharge = m_total_recharge + m_vip_exp;
            //上限限制
            if (pg->getUsage() == ITEM_USAGE_VIP_EXP_80)
            {
                //只能升级到80%
                int max_vip = iVIP_recharge[m_vip] * 4 / 5;
                if (old_recharge >= max_vip)
                {
                    return HC_ERROR_USE_VIP_CARD;
                }
                int canAdd = max_vip - old_recharge;
                int maxUsed = canAdd / pg->getValue();
                if (canAdd % pg->getValue() != 0)
                {
                    ++maxUsed;
                }
                if (count > maxUsed)
                {
                    count = maxUsed;
                }
                add = pg->getValue() * count;
                if (add > canAdd)
                {
                    add = canAdd;
                }
            }
            else if (pg->getUsage() == ITEM_USAGE_VIP_EXP)
            {
                add = pg->getValue() * count;
            }
            if (itm->getCount() == count)
            {
                m_bag.removeItem(slot);
                itm->Clear();
                itm->Save();
            }
            else
            {
                itm->addCount(-count);
                itm->Save();
            }

            m_vip_exp += add;
            InsertSaveDb("update char_data set exp=" + LEX_CAST_STR(m_vip_exp) + " where cid=" + LEX_CAST_STR(m_id));
            if (pg->getUsage() == ITEM_USAGE_VIP_EXP)
            {
                updateVip();
            }

            //通知客户端,充值条变化
            robj.push_back( Pair("rechargeFrom", old_recharge) );
            robj.push_back( Pair("rechargeAdd", add) );

            return HC_SUCCESS;
        }
        //限时增益
        case ITEM_USAGE_BUFF_BINGLI:
        case ITEM_USAGE_BUFF_WUGONG:
        case ITEM_USAGE_BUFF_WUFANG:
        case ITEM_USAGE_BUFF_CEGONG:
        case ITEM_USAGE_BUFF_CEFANG:
        {
            if (pg->getValue() <= 0)
            {
                return HC_ERROR;
            }
            if (itm->getInvalidTime() <= time(NULL))
            {
                m_bag.removeItem(slot);
                itm->Clear();
                itm->Save();
                return HC_ERROR;
            }
            int count = 1;
            if (itm->getCount() == count)
            {
                m_bag.removeItem(slot);
                itm->Clear();
                itm->Save();
            }
            else
            {
                itm->addCount(-count);
                itm->Save();
            }
            m_Buffs.addBuff(pg->getUsage()-ITEM_USAGE_BUFF_BINGLI+1,pg->getValue(),7200);
            #ifdef QQ_PLAT
            treasure_cost_tencent(this,(int)itm->getSubtype(),1);
            #endif
            return HC_SUCCESS;
        }
        //开启宝箱
        case ITEM_USAGE_BOX:
        {
            if (pg->getValue() <= 0)
            {
                return HC_ERROR;
            }
            int count = use_num;
            if (count >= itm->getCount())
            {
                count = itm->getCount();
            }
            else if (count <= 0)
            {
                count = 1;
            }
            //开启宝箱需要银币
            int need_silver = count * pg->getValue();
            if (silver() < need_silver)
            {
                if (count > 1)
                {
                    count = silver() / pg->getValue();
                    need_silver = count * pg->getValue();
                    robj.push_back( Pair("msg", getErrMsg(HC_ERROR_NOT_ENOUGH_SILVER)) );
                }
                else
                {
                    std::string msg = strBoxSilverNotEnoughMsg;
                    str_replace(msg, "$S", LEX_CAST_STR(pg->getValue()));
                    robj.push_back( Pair("msg", msg) );
                    return HC_ERROR;
                }
            }
            //开启宝箱需要位置
            if (count > 0 && (m_bag.size()-m_bag.getUsed()) < count)
                return HC_ERROR_NOT_ENOUGH_BAG_SIZE;
            if (itm->getCount() == count)
            {
                m_bag.removeItem(slot);
                itm->Clear();
                itm->Save();
            }
            else
            {
                itm->addCount(-count);
                itm->Save();
            }
            if (count == 1)
            {
                addSilver(-need_silver);
                add_statistics_of_silver_cost(m_id,m_ip_address,need_silver,silver_cost_for_open_box, m_union_id, m_server_id);
                //给奖励!
                std::list<Item> getItems;
                int notify = lootMgr::getInstance()->getBoxLoots(itm->getSubtype(), getItems, 0);
                if (notify > 0)
                {
                    std::string msg = strBoxGetMsg;
                    str_replace(msg, "$W", MakeCharNameLink(m_name));
                    boost::shared_ptr<baseTreasure> tr = GeneralDataMgr::getInstance()->GetBaseTreasure(itm->getSubtype());
                    if (tr.get())
                    {
                        std::string name = tr->name;
                        addColor(name, tr->quality);
                        str_replace(msg, "$B", name);
                    }
                    Item& item = *(getItems.begin());
                    if (item.type == item_type_treasure)
                    {
                        tr = GeneralDataMgr::getInstance()->GetBaseTreasure(item.id);
                        if (tr.get())
                        {
                            std::string name = MakeTreasureLink(tr->name, item.id);
                            addColor(name, tr->quality);
                            str_replace(msg, "$R", name);
                        }
                    }
                    json_spirit::mObject mobj;
                    mobj["cmd"] = "broadCastMsg";
                    mobj["msg"] = msg;
                    boost::shared_ptr<splsTimer> tmsg;
                       tmsg.reset(new splsTimer(4, 1, mobj,1));
                       splsTimerMgr::getInstance()->addTimer(tmsg);
                }
                //随机列表
                std::list<Item> items_list;
                lootMgr::getInstance()->getBoxLootsInfo(itm->getSubtype(),items_list);
                json_spirit::Array alist;
                for (std::list<Item>::iterator it = items_list.begin(); it != items_list.end(); ++it)
                {
                    Item& item = *it;
                    json_spirit::Object obj;
                    if ((*(getItems.begin())).id == item.id && (*(getItems.begin())).type == item.type
                        && (*(getItems.begin())).nums == item.nums && (*(getItems.begin())).fac == item.fac)
                    {
                        obj.push_back( Pair("get", 1) );
                    }
                    item.toObj(obj);
                    alist.push_back(obj);
                }
                robj.push_back( Pair("list", alist) );
                giveLoots(this, getItems, m_area, m_level, 0, NULL, &robj, true, give_box_loot);
            }
            else
            {
                addSilver(-need_silver);
                add_statistics_of_silver_cost(m_id,m_ip_address,need_silver,silver_cost_for_open_box, m_union_id, m_server_id);
                //给奖励!
                std::list<Item> getAllItems;
                for (int i = 0; i < count; ++i)
                {
                    std::list<Item> getItems;
                    int notify = lootMgr::getInstance()->getBoxLoots(itm->getSubtype(), getItems, 0);
                    Item& item = *(getItems.begin());
                    if (notify > 0)
                    {
                        std::string msg = strBoxGetMsg;
                        str_replace(msg, "$W", MakeCharNameLink(m_name));
                        boost::shared_ptr<baseTreasure> tr = GeneralDataMgr::getInstance()->GetBaseTreasure(itm->getSubtype());
                        if (tr.get())
                        {
                            std::string name = tr->name;
                            addColor(name, tr->quality);
                            str_replace(msg, "$B", name);
                        }
                        if (item.type == item_type_treasure)
                        {
                            tr = GeneralDataMgr::getInstance()->GetBaseTreasure(item.id);
                            if (tr.get())
                            {
                                std::string name = MakeTreasureLink(tr->name, item.id);
                                addColor(name, tr->quality);
                                str_replace(msg, "$R", name);
                            }
                        }
                        GeneralDataMgr::getInstance()->broadCastSysMsg(msg, -1);
                    }
                    getAllItems.push_back(item);
                }
                giveLoots(this, getAllItems, m_area, m_level, 0, NULL, &robj, true, give_box_loot);
            }
            #ifdef QQ_PLAT
            //treasure_cost_tencent(this,(int)itm->getSubtype(),1);
            #endif
            NotifyCharData();
            return HC_SUCCESS;
        }
    }
    return HC_ERROR;//未知类型
}
Beispiel #4
0
//获取装备升级信息
int CharData::getUpgradeEquipmentInfo(int eid, int type, json_spirit::Object& robj)
{
    equipment_scroll* sp = NULL;

    EquipmentData* src_eq = m_bag.getEquipById(eid);
    if (!src_eq)
    {
        src_eq = m_generals.getEquipById(eid);
    }
    if (src_eq)
    {
        sp = Singleton<equipment_scroll_mgr>::Instance().getScrollBySrcId(src_eq->baseid);
        if (!sp)
        {
            return HC_ERROR;
        }
    }
    else
    {
        return HC_ERROR;
    }
    if (sp->m_equipment->needLevel > m_level)
    {
        robj.push_back( Pair("needLevel", sp->m_equipment->needLevel) );
        return HC_SUCCESS;
    }
    //直接制造结果
    json_spirit::Object eq = sp->m_eqobj;
    int nextqLevel = equipmentUpgrade::getInstance()->convertUpgradeLevel(src_eq->quality, src_eq->type, src_eq->qLevel);
    int nextAdd = 0;
    int nextAdd2 = 0;
    upgradeValue(sp->m_equipment->up_quality, src_eq->type, nextqLevel, nextAdd, nextAdd2);
    eq.push_back( Pair("level", nextqLevel) );
    eq.push_back( Pair("addNums", sp->m_equipment->baseValue + nextAdd) );
    eq.push_back( Pair("needLevel", sp->m_equipment->needLevel) );
    if (nextAdd2 > 0)
    {
        eq.push_back( Pair("addNums2", sp->m_equipment->baseValue2 + nextAdd2) );
    }
    //保留等级制造结果
    int nextqLevel_gold = src_eq->qLevel;
    nextAdd = 0;
    nextAdd2 = 0;
    upgradeValue(sp->m_equipment->up_quality, src_eq->type, nextqLevel_gold, nextAdd, nextAdd2);
    eq.push_back( Pair("level_gold", nextqLevel_gold) );
    eq.push_back( Pair("addNums_gold", sp->m_equipment->baseValue + nextAdd) );
    if (nextAdd2 > 0)
    {
        eq.push_back( Pair("addNums2_gold", sp->m_equipment->baseValue2 + nextAdd2) );
    }
    robj.push_back( Pair("eq", eq) );
    
    robj.push_back( Pair("eid", src_eq->id) );

    bool canMake = true;

    json_spirit::Array mlist;

    //type=1显示装备type=2显示卷轴
    if (type == 1)
    {
        json_spirit::Object o;
        o.push_back( Pair("name", sp->m_equipment_src->name) );
        o.push_back( Pair("type", iItem_type_equipment) );
        o.push_back( Pair("id", sp->m_equipment_src->baseid) );
        o.push_back( Pair("spic", sp->m_equipment_src->baseid) );
        o.push_back( Pair("quality", sp->m_equipment_src->quality) );
        o.push_back( Pair("need", 1) );
        o.push_back( Pair("num", 1) );
        if (sp->m_equipment_src->m_place.get())
        {
            o.push_back( Pair("info", sp->m_equipment_src->m_place->info) );
        }
        mlist.push_back(o);
    }

    //检查材料是否足够
    canMake &= checkMaterial(sp, *this, m_bag, mlist, type);

    robj.push_back( Pair("mlist", mlist) );
    
    robj.push_back( Pair("canMake", canMake) );
    return HC_SUCCESS;
}