|
@@ -174,7 +174,7 @@ class StoreProc {
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function Equip_Compose() {
|
|
public static function Equip_Compose() {
|
|
- list($uid, $equipUids_cost) = req()->paras;
|
|
|
|
|
|
+ list($uid, $equipUids_cost, $composeMaterial_typeIds) = req()->paras;
|
|
|
|
|
|
$equipDic = ctx()->store->equip;
|
|
$equipDic = ctx()->store->equip;
|
|
my_Assert(StlUtil::dictHasProperty($equipDic, $uid), ErrCode::user_store_NotExistEquip);
|
|
my_Assert(StlUtil::dictHasProperty($equipDic, $uid), ErrCode::user_store_NotExistEquip);
|
|
@@ -187,29 +187,55 @@ class StoreProc {
|
|
$type = $arr[0];
|
|
$type = $arr[0];
|
|
$costQual = $arr[1];
|
|
$costQual = $arr[1];
|
|
$num = $arr[2];
|
|
$num = $arr[2];
|
|
- $costEquipsArr = explode(',', $equipUids_cost);
|
|
|
|
- my_Assert(count($costEquipsArr) == $num, ErrCode::user_store_equipMaterialNumErr);
|
|
|
|
- foreach ($costEquipsArr as $eqUid) {
|
|
|
|
- my_Assert(StlUtil::dictHasProperty($equipDic, $eqUid), ErrCode::user_store_NotExistEquip);
|
|
|
|
-
|
|
|
|
- $costIns_Equip = new Ins_Equip($equipDic->$eqUid);
|
|
|
|
- my_Assert($costIns_Equip->qual == $costQual, ErrCode::user_store_equipMaterialQualErr);
|
|
|
|
- if ($type == 1) {//本体
|
|
|
|
- my_Assert($costIns_Equip->typeId == $ins_equip->typeId, ErrCode::user_store_equipMaterialTypeErr);
|
|
|
|
- } else {
|
|
|
|
- my_Assert($costIns_Equip->mo()->position == $ins_equip->mo()->position, ErrCode::user_store_equipMaterialTypeErr);
|
|
|
|
|
|
+
|
|
|
|
+ $all_num = 0;
|
|
|
|
+
|
|
|
|
+ $materialItemType = 0;
|
|
|
|
+ $materialItemNum = 0;
|
|
|
|
+ if ($type == 2 && $composeMaterial_typeIds != null) {//部位去校验
|
|
|
|
+ $str = explode(',', $composeMaterial_typeIds);
|
|
|
|
+ $materialItemType = $str[0];
|
|
|
|
+ $materialItemNum = count($str);
|
|
|
|
+ foreach ($str as $s) {
|
|
|
|
+ $composeMaterial_itemTypeId = self::ComposeMaterial($ins_equip->mo()->position, $costQual);
|
|
|
|
+ my_Assert($composeMaterial_itemTypeId == $s, ErrCode::user_store_equip_composeMaterialErr);
|
|
|
|
+ $all_num += 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- ctx()->store(true)->equip->$uid = self::ComposeNewEquip($ins_equip);
|
|
|
|
|
|
+ if ($equipUids_cost != null) {
|
|
|
|
+ $costEquipsArr = explode(',', $equipUids_cost);
|
|
|
|
+ $all_num += count($costEquipsArr);
|
|
|
|
+
|
|
|
|
+ foreach ($costEquipsArr as $eqUid) {
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty($equipDic, $eqUid), ErrCode::user_store_NotExistEquip);
|
|
|
|
|
|
- //消耗的装备 回收
|
|
|
|
- foreach ($costEquipsArr as $eqUid) {
|
|
|
|
- $costIns_Equip = new Ins_Equip($equipDic->$eqUid);
|
|
|
|
- self::equipLevelUp_Material_Recovery($costIns_Equip->mo()->rarity, $costIns_Equip->qual, $costIns_Equip->mo()->position, $costIns_Equip->level);
|
|
|
|
- StlUtil::dictRemove(ctx()->store(true)->equip, $eqUid);
|
|
|
|
|
|
+ $costIns_Equip = new Ins_Equip($equipDic->$eqUid);
|
|
|
|
+ my_Assert($costIns_Equip->qual == $costQual, ErrCode::user_store_equipMaterialQualErr);
|
|
|
|
+ if ($type == 1) {//本体
|
|
|
|
+ my_Assert($costIns_Equip->typeId == $ins_equip->typeId, ErrCode::user_store_equipMaterialTypeErr);
|
|
|
|
+ } else {
|
|
|
|
+ my_Assert($costIns_Equip->mo()->position == $ins_equip->mo()->position, ErrCode::user_store_equipMaterialTypeErr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ my_Assert($all_num == $num, ErrCode::user_store_equipMaterialNumErr);
|
|
|
|
+ ctx()->store(true)->equip->$uid = self::ComposeNewEquip($ins_equip);
|
|
|
|
|
|
|
|
+ //消耗的装备 回收
|
|
|
|
+ if ($equipUids_cost != null) {
|
|
|
|
+ $costEquipsArr = explode(',', $equipUids_cost);
|
|
|
|
+ foreach ($costEquipsArr as $eqUid) {
|
|
|
|
+ $costIns_Equip = new Ins_Equip($equipDic->$eqUid);
|
|
|
|
+ self::equipLevelUp_Material_Recovery($costIns_Equip->mo()->rarity, $costIns_Equip->qual, $costIns_Equip->mo()->position, $costIns_Equip->level);
|
|
|
|
+ StlUtil::dictRemove(ctx()->store(true)->equip, $eqUid);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($materialItemType != 0){
|
|
|
|
+ ctx()->store(true)->removeItem($materialItemType, $materialItemNum);
|
|
|
|
+ }
|
|
|
|
+
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array(
|
|
return Resp::ok(array(
|
|
'gold' => ctx()->baseInfo->gold,
|
|
'gold' => ctx()->baseInfo->gold,
|
|
@@ -1079,7 +1105,7 @@ class StoreProc {
|
|
ctx()->store(true)->equip->$uid = $equip;
|
|
ctx()->store(true)->equip->$uid = $equip;
|
|
self::$reward_equip[] = $uid;
|
|
self::$reward_equip[] = $uid;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
case 701://道具宝箱
|
|
case 701://道具宝箱
|
|
for ($i = 0; $i < $num; $i++) {
|
|
for ($i = 0; $i < $num; $i++) {
|