|
@@ -71,41 +71,47 @@ class MapProc {
|
|
|
if (!StlUtil::dictHasProperty($newMap->unlockMapTypeList, $mapid)) {
|
|
|
$newMap->unlockMapTypeList->$mapid = array();
|
|
|
}
|
|
|
- $tag = 1;
|
|
|
+ $tag = 1;
|
|
|
$tylist = $newMap->unlockMapTypeList->$mapid;
|
|
|
foreach ($tylist as $str) {
|
|
|
$slist = explode('_', $str);
|
|
|
if($slist[0] == $mapid && $slist[1] == $type && $slist[2]==$typeid){
|
|
|
- $tag = 0;
|
|
|
+ $tag = 0;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ $num = 0;
|
|
|
if($tag){
|
|
|
$newMap->unlockMapTypeList->$mapid[] = $unlockStr;
|
|
|
|
|
|
my_Assert(StlUtil::dictHasProperty($newMap->unlockedFootholds,$mapid), ErrCode::map_Unlocked);
|
|
|
|
|
|
- $explorerNum = self::countFootHoldExplorerNum($mapid, $newMap);
|
|
|
+ $arr = self::countFootHoldExplorerNum($mapid,$type,$typeid, $newMap);
|
|
|
+ $explorerNum = $arr[0];
|
|
|
+ $num = $arr[1];
|
|
|
$newMap->unlockedFootholds->$mapid->curExploreProgress = $explorerNum;
|
|
|
-
|
|
|
- //$type = explode('_', $unlockStr)[1];
|
|
|
- if ($type == 6 && $newMap->unlockedFootholds->$mapid->transmissionIsOk == false) {//临时代码,6代表传送带
|
|
|
- $newMap->unlockedFootholds->$mapid->transmissionIsOk = true;
|
|
|
+
|
|
|
+ if ($type == 2 && $newMap->unlockedFootholds->$mapid->transmissionIsOk == false) {
|
|
|
+ $subtype = GameConfig::npc_getItem($typeid)->subtype;
|
|
|
+ if($subtype == 4){//传送带
|
|
|
+ $newMap->unlockedFootholds->$mapid->transmissionIsOk = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ctx()->newMap = $newMap;
|
|
|
UserProc::updateUserInfo();
|
|
|
- return Resp::ok(array("newMap"=>$newMap,"tag"=>$tag,));
|
|
|
+ return Resp::ok(array("newMap"=>$newMap,"tag"=>$tag,'num'=>$num,));
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 计算探索度值
|
|
|
*/
|
|
|
|
|
|
- public static function countFootHoldExplorerNum($mapid, $newMap) {
|
|
|
- $explorer = 0;
|
|
|
+ public static function countFootHoldExplorerNum($mapid,$type,$id, $newMap) {
|
|
|
+ $explorer = 0;
|
|
|
+ $num = 0;
|
|
|
+ $retArr = array();
|
|
|
if (StlUtil::dictHasProperty($newMap->unlockMapTypeList, $mapid)) {
|
|
|
$list = $newMap->unlockMapTypeList->$mapid;
|
|
|
$mapList = GameConfig::map_explorer_getItemArray($mapid);
|
|
@@ -117,7 +123,11 @@ class MapProc {
|
|
|
continue;
|
|
|
}
|
|
|
$cmd = $item->cmd;
|
|
|
- $parasList = explode(',', $item->paras);
|
|
|
+ $parasList = explode(',', $item->paras);
|
|
|
+ if($type == $cmd && $id == $parasList[0]){
|
|
|
+ $num = $parasList[1];
|
|
|
+ }
|
|
|
+
|
|
|
foreach ($list as $para) {
|
|
|
$strList = explode('_', $para);
|
|
|
$tempStr = $strList[1].'-'.$strList[2];
|
|
@@ -133,8 +143,10 @@ class MapProc {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ $retArr[] = $explorer;
|
|
|
+ $retArr[] = $num;
|
|
|
|
|
|
- return $explorer;
|
|
|
+ return $retArr;
|
|
|
}
|
|
|
|
|
|
/**
|