|
@@ -50,57 +50,57 @@ class StoreProc {
|
|
|
Err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 洗练
|
|
|
* @return Resp
|
|
|
*/
|
|
|
public static function gemXiLian() {
|
|
|
list($uid) = req()->paras;
|
|
|
-
|
|
|
+
|
|
|
//把 qual pos u一样的宝石开锁关锁
|
|
|
$gemStore = ctx()->store->gemStore;
|
|
|
my_Assert(StlUtil::dictHasProperty($gemStore, $uid), ErrCode::user_store_NotExistGem);
|
|
|
-
|
|
|
+
|
|
|
$gem = new Ins_Gem($gemStore->$uid);
|
|
|
my_Assert($gem->mo()->qual >= 5, ErrCode::user_store_GemNotXilian);
|
|
|
-
|
|
|
- $arr = explode(';', glc()->XILianGemlNeedXILianStone);
|
|
|
+
|
|
|
+ $arr = explode(';', glc()->XILianGemlNeedXILianStone);
|
|
|
$needStone = 0;
|
|
|
foreach ($arr as $val) {
|
|
|
$str = explode(':', $val);
|
|
|
- if($str[0] == $gem->mo()->qual){
|
|
|
+ if ($str[0] == $gem->mo()->qual) {
|
|
|
$needStone = $str[1];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
my_Assert(ctx()->baseInfo->xilianStone >= $needStone, ErrCode::user_store_XilianStoneNoEnough);
|
|
|
-
|
|
|
+
|
|
|
$dic = GameConfig::predicate();
|
|
|
$pList = array();
|
|
|
foreach ($dic as $id => $pMo) {
|
|
|
- if($pMo->positions != null && $pMo->qual != null){
|
|
|
- $list = explode(',',$pMo->positions);
|
|
|
- if($pMo->id != $gem->predicateId && $pMo->qual == $gem->mo()->qual && in_array($gem->mo()->position, $list)){
|
|
|
+ if ($pMo->positions != null && $pMo->qual != null) {
|
|
|
+ $list = explode(',', $pMo->positions);
|
|
|
+ if ($pMo->id != $gem->predicateId && $pMo->qual == $gem->mo()->qual && in_array($gem->mo()->position, $list)) {
|
|
|
$pList[] = $pMo->id;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
my_Assert(count($pList) > 0, ErrCode::user_store_NoFindPredicate);
|
|
|
- $rand = random_int(0, count($pList)-1);
|
|
|
- $pId = $pList[$rand];
|
|
|
- ctx()->store->gemStore->$uid->predicateId = $pId;
|
|
|
-
|
|
|
+ $rand = random_int(0, count($pList) - 1);
|
|
|
+ $pId = $pList[$rand];
|
|
|
+ ctx()->store->gemStore->$uid->predicateId = $pId;
|
|
|
+
|
|
|
ctx()->baseInfo->xilianStone -= $needStone;
|
|
|
-
|
|
|
+
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array(
|
|
|
'xilianStone' => ctx()->baseInfo->xilianStone,
|
|
|
'predicateId' => $pId,
|
|
|
));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 宝石开锁解锁
|
|
|
* @return Resp
|
|
@@ -154,7 +154,7 @@ class StoreProc {
|
|
|
/**
|
|
|
* 所有装备的一键升级
|
|
|
* 规则:等级不同从等级小到大,等级一样按照部位顺序
|
|
|
- *
|
|
|
+ *
|
|
|
* @return Resp
|
|
|
*/
|
|
|
public static function allEquipUpgrade() {
|
|
@@ -199,8 +199,8 @@ class StoreProc {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //升级,扣除金币和图纸
|
|
|
+
|
|
|
+ //升级,扣除金币和图纸
|
|
|
while (true) {
|
|
|
$tag = 9999;
|
|
|
foreach ($arr as $index => &$equip) {
|
|
@@ -211,10 +211,10 @@ class StoreProc {
|
|
|
$neeItemId = $ins_equip->mo()->costTuzhiId;
|
|
|
if ($user->baseInfo->gold >= $needGold && StlUtil::dictHasProperty($user->store->items, $neeItemId) && $user->store->items->$neeItemId >= $needItemNum) {
|
|
|
$id = $ins_equip->typeId;
|
|
|
- if(!in_array($id, $upLevelArr)){
|
|
|
+ if (!in_array($id, $upLevelArr)) {
|
|
|
$upLevelArr[] = $id;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$ins_equip->level += 1;
|
|
|
$equipDic->$id->level += 1;
|
|
|
$user->baseInfo->Consume_Gold($needGold);
|
|
@@ -247,11 +247,11 @@ class StoreProc {
|
|
|
ctx($user);
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array(
|
|
|
- 'upLevelArr'=>$upLevelArr,
|
|
|
+ 'upLevelArr' => $upLevelArr,
|
|
|
'gold' => $user->baseInfo->gold,
|
|
|
'store' => $user->store,
|
|
|
- 'task'=>$user->task,
|
|
|
- ));
|
|
|
+ 'task' => $user->task,
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -382,7 +382,7 @@ class StoreProc {
|
|
|
|
|
|
$index += 1;
|
|
|
self::RemoveGemInStore($uid);
|
|
|
- //$composeArr 有的话删除
|
|
|
+ //$composeArr 有的话删除
|
|
|
for ($i = 0; $i < count($composeArr); $i++) {
|
|
|
if ($composeArr[$i]->uid == $uid) {
|
|
|
StlUtil::arrayRemoveAt($composeArr, $i);
|
|
@@ -394,7 +394,7 @@ class StoreProc {
|
|
|
$res += 1;
|
|
|
$composeGem = self::initGem($gemConf->typeId);
|
|
|
self::PutGemInStore2($composeGem);
|
|
|
- $composeArr[] = $composeGem; //临时放这
|
|
|
+ $composeArr[] = $composeGem; //临时放这
|
|
|
}
|
|
|
|
|
|
if ($res >= $maxGemNum) {
|
|
@@ -414,8 +414,8 @@ class StoreProc {
|
|
|
return Resp::ok(array(
|
|
|
'composeGemIds' => $resultArr,
|
|
|
'store' => $user->store,
|
|
|
- 'task'=>$user->task,
|
|
|
- ));
|
|
|
+ 'task' => $user->task,
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -476,7 +476,7 @@ class StoreProc {
|
|
|
* @return type
|
|
|
*/
|
|
|
public static function gemSet() {
|
|
|
- list($uid, $type, $replaceUId) = req()->paras; //宝石uid 手动的时候记得校验u
|
|
|
+ list($uid, $type, $replaceUId) = req()->paras; //宝石uid 手动的时候记得校验u
|
|
|
$user = ctx();
|
|
|
|
|
|
my_Assert(StlUtil::dictHasProperty($user->store->gemStore, $uid), ErrCode::user_store_NoItem);
|
|
@@ -498,7 +498,7 @@ class StoreProc {
|
|
|
}
|
|
|
|
|
|
switch ($type) {
|
|
|
- case 1://镶嵌
|
|
|
+ case 1://镶嵌
|
|
|
my_Assert($tag_gem == null, ErrCode::user_store_GemCanotSet);
|
|
|
for ($i = 1; $i <= 5; $i++) {
|
|
|
if (!StlUtil::dictHasProperty($dic, $i)) {
|
|
@@ -527,27 +527,27 @@ class StoreProc {
|
|
|
my_Assert(StlUtil::dictHasProperty($user->store->gemStore, $replaceUId), ErrCode::user_store_NoExistGemReplace);
|
|
|
$replace_ins_Gem = new Ins_Gem($user->store->gemStore->$replaceUId);
|
|
|
//$id = $replace_ins_Gem->uid;
|
|
|
- if ($tag_gem != null) {//如果有u那
|
|
|
+ if ($tag_gem != null) {//如果有u那
|
|
|
my_Assert($replace_ins_Gem->uid == $tag_gem->uid, ErrCode::user_store_SameGemCanotEquip); //点的不是u一样的,则提示同一件装备无法镶嵌多个技能相同的宝石 【错误】
|
|
|
- //有U一样的,则点击正好是这个直接替换
|
|
|
- //$user->store->gemStore->$id = $replace_ins_Gem;
|
|
|
+ //有U一样的,则点击正好是这个直接替换
|
|
|
+ //$user->store->gemStore->$id = $replace_ins_Gem;
|
|
|
$dic->$tag_index = $ins_gem;
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
$go_index = 0;
|
|
|
- foreach ($dic as $index => $g) {
|
|
|
+ foreach ($dic as $index => $g) {
|
|
|
if ($g->uid == $replaceUId) {
|
|
|
$go_index = $index;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- my_Assert($go_index > 0, ErrCode::user_store_NoExistGemReplace);
|
|
|
+
|
|
|
+ my_Assert($go_index > 0, ErrCode::user_store_NoExistGemReplace);
|
|
|
$dic->$go_index = $ins_gem;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
break;
|
|
|
case 4://不能
|
|
|
- //1.小品阶替大品阶 或是 相等的,在不满的时候不允许 2. //满的 相等不允许替
|
|
|
+ //1.小品阶替大品阶 或是 相等的,在不满的时候不允许 2. //满的 相等不允许替
|
|
|
my_Assert($uid == 0, ErrCode::user_store_SameGemCanotEquip); //点的不是u一样的,则提示同一件装备无法镶嵌多个技能相同的宝石 【错误】
|
|
|
break;
|
|
|
default:
|
|
@@ -555,15 +555,15 @@ class StoreProc {
|
|
|
}
|
|
|
|
|
|
$user->store->gemEquip->$pag->$posId = $dic;
|
|
|
-
|
|
|
+
|
|
|
TaskProc::OnSetSpecialQualGem();
|
|
|
ctx($user);
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array(
|
|
|
'gold' => 0,
|
|
|
'store' => $user->store,
|
|
|
- 'task'=>$user->task,
|
|
|
- ));
|
|
|
+ 'task' => $user->task,
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -625,7 +625,7 @@ class StoreProc {
|
|
|
ctx()->baseInfo->Consume_Gold($mo->needGold);
|
|
|
|
|
|
$user->store->equip->$posId->level += 1;
|
|
|
-
|
|
|
+
|
|
|
TaskProc::OnAnyEquipUpLevel_X();
|
|
|
TaskProc::OnAllEquipUpLevel_X();
|
|
|
TaskProc::OnEquipLevelUpNum();
|
|
@@ -634,8 +634,8 @@ class StoreProc {
|
|
|
return Resp::ok(array(
|
|
|
'gold' => $user->baseInfo->gold,
|
|
|
'store' => $user->store,
|
|
|
- 'task'=>$user->task,
|
|
|
- ));
|
|
|
+ 'task' => $user->task,
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -689,7 +689,7 @@ class StoreProc {
|
|
|
return Resp::ok(array(
|
|
|
'gold' => $user->baseInfo->gold,
|
|
|
'store' => $user->store,
|
|
|
- 'task'=>$user->task,
|
|
|
+ 'task' => $user->task,
|
|
|
));
|
|
|
}
|
|
|
|
|
@@ -854,7 +854,7 @@ class StoreProc {
|
|
|
*/
|
|
|
public static function RandomGemPredicateId($id) {
|
|
|
$mo = GameConfig::gem_getItem($id);
|
|
|
-
|
|
|
+ my_Assert(null != $mo, "找不到宝石{$id}的配置数据");
|
|
|
if ($mo->isfixed_predicateId == 1) {
|
|
|
return $mo->predicateId;
|
|
|
}
|
|
@@ -866,17 +866,17 @@ class StoreProc {
|
|
|
foreach ($predicateMo as $key => $value) {
|
|
|
if ($value->positions != null) {
|
|
|
$list = explode(',', $value->positions);
|
|
|
- if ($value->qual == $qual && in_array($posId,$list) && $value->attachTarget == "gem") {
|
|
|
+ if ($value->qual == $qual && in_array($posId, $list) && $value->attachTarget == "gem") {
|
|
|
$arr[] = $value->id;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if(count($arr) <= 0){
|
|
|
+
|
|
|
+ if (count($arr) <= 0) {
|
|
|
return 40;
|
|
|
}
|
|
|
my_Assert(count($arr) > 0, "宝石没有对应词条信息");
|
|
|
- $n = mt_rand(0, count($arr)-1);
|
|
|
+ $n = mt_rand(0, count($arr) - 1);
|
|
|
return $arr[$n];
|
|
|
|
|
|
//return 40;
|
|
@@ -903,21 +903,21 @@ class StoreProc {
|
|
|
// if(count((array)ctx()->store->gemStore) > 0){
|
|
|
// return;
|
|
|
// }
|
|
|
-//
|
|
|
+//
|
|
|
// $index = 0;
|
|
|
// $gem = GameConfig::gem();
|
|
|
-//
|
|
|
+//
|
|
|
// for ($i = 1; $i <=21; $i++) {
|
|
|
-// foreach ($gem as $key => $value) {
|
|
|
+// foreach ($gem as $key => $value) {
|
|
|
// if($value->id == $i){
|
|
|
-// self::PutGemInStore($value->typeId);
|
|
|
+// self::PutGemInStore($value->typeId);
|
|
|
// }
|
|
|
-//
|
|
|
+//
|
|
|
// }
|
|
|
// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
// }
|
|
|
}
|