|
@@ -63,19 +63,26 @@ class FightProc {
|
|
|
* @return type
|
|
|
*/
|
|
|
public static function EvolveUnlock() {
|
|
|
- list($type, $id) = req()->paras;
|
|
|
+ list($type, $id) = req()->paras;//$id废弃 因为玩家可能不安顺序点
|
|
|
|
|
|
if ($type == 1) {
|
|
|
- $mo = GameConfig::evolve_getItem($id);
|
|
|
- my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
+ $nextId = ctx()->gates->evolveMaxId_left+1;
|
|
|
+ my_Assert($id == $nextId, ErrCode::err_const_no);
|
|
|
+
|
|
|
+ $mo = GameConfig::evolve_getItem($nextId);
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
my_Assert(ctx()->baseInfo->level >= $mo->level, ErrCode::evolve_canotUnlock_levelLimit);
|
|
|
my_Assert(ctx()->baseInfo->gold >= $mo->needGold_unlock, ErrCode::notenough_gold_msg);
|
|
|
+
|
|
|
ctx()->baseInfo->Consume_Gold($mo->needGold_unlock);
|
|
|
- ctx()->gates->evolveMaxId_left = $id;
|
|
|
+ ctx()->gates->evolveMaxId_left = $nextId;
|
|
|
} else {
|
|
|
+ $nextId = ctx()->gates->evolveMaxId_right + 1;
|
|
|
+ my_Assert($id == $nextId, ErrCode::err_const_no);
|
|
|
+
|
|
|
$dic = GameConfig::evolve();
|
|
|
foreach ($dic as $key => $value) {
|
|
|
- if ($value->specificEvolveId == $id) {
|
|
|
+ if ($value->specificEvolveId == $nextId) {
|
|
|
$mo = $value;
|
|
|
}
|
|
|
}
|