|
@@ -29,7 +29,7 @@ class FightProc {
|
|
return FightProc::SelectGate();
|
|
return FightProc::SelectGate();
|
|
case CmdCode::cmd_fight_gateChallengePriceReviced: # 6804
|
|
case CmdCode::cmd_fight_gateChallengePriceReviced: # 6804
|
|
return FightProc::GateChallengePriceReviced();
|
|
return FightProc::GateChallengePriceReviced();
|
|
- case CmdCode::cmd_fight_evolveUnlock: # 6805
|
|
|
|
|
|
+ case CmdCode::cmd_fight_evolveUnlock: # 6805进化解锁
|
|
return FightProc::EvolveUnlock();
|
|
return FightProc::EvolveUnlock();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
@@ -41,16 +41,28 @@ class FightProc {
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function EvolveUnlock() {
|
|
public static function EvolveUnlock() {
|
|
- list($zhangjieId, $gateId) = req()->paras;
|
|
|
|
-
|
|
|
|
- $mo = GameConfig::gate_challenge_getItem($zhangjieId);
|
|
|
|
- my_Assert($mo!=null, ErrCode::err_const_no);
|
|
|
|
-
|
|
|
|
-// $list = explode(',', $mo->gates);
|
|
|
|
-// my_Assert(in_array($gateId,$list), ErrCode::err_const_no);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ list($type,$id) = req()->paras;
|
|
|
|
+
|
|
|
|
+ if($type == 1){
|
|
|
|
+ $mo = GameConfig::evolve_getItem($id);
|
|
|
|
+ my_Assert($mo!=null, ErrCode::err_const_no);
|
|
|
|
+
|
|
|
|
+ my_Assert(ctx()->baseInfo->gold>=$mo->needGold_unlock, ErrCode::notenough_gold_msg);
|
|
|
|
+ ctx()->baseInfo->Consume_Gold($mo->needGold_unlock);
|
|
|
|
+ } else {
|
|
|
|
+ $mo =GameConfig::evolveSpecific_getItem($id);
|
|
|
|
+ my_Assert($mo!=null, ErrCode::err_const_no);
|
|
|
|
+ if($mo->specificEvolveCost != null){
|
|
|
|
+ $cost = explode(',', $mo->specificEvolveCost);
|
|
|
|
+ $costId = $cost[0];
|
|
|
|
+ $costNum = $cost[1];
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $costId) && ctx()->store->items->$costId >= $costNum , ErrCode::notenough_item);
|
|
|
|
+ }
|
|
|
|
+// my_Assert(ctx()->baseInfo->gold>=$mo->needGold_unlock, ErrCode::notenough_gold_msg);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ ctx()->gates->evolveUnlockRecord[] = $id;
|
|
|
|
+
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
$ret = array(
|
|
$ret = array(
|
|
'store' => ctx()->store,
|
|
'store' => ctx()->store,
|