|
@@ -217,7 +217,26 @@ class TaskProc {
|
|
|
*/
|
|
|
static function PlotFinish($req) {
|
|
|
list($gate_or_npc_id, $stage) = $req->paras;
|
|
|
- $bUpdate = self::OnPlotOver($gate_or_npc_id, $stage); // 触发一下任务检查
|
|
|
+ $bUpdate = self::OnPlotOver($gate_or_npc_id, $stage); # 触发一下任务检查,更新任务状态
|
|
|
+ $arr = GameConfig::plot_getItem($gate_or_npc_id, $stage); # 查找对应的剧情
|
|
|
+ foreach ($arr as $plot) {
|
|
|
+ isEditor() and $plot = new \sm_plot();
|
|
|
+ if (!empty($plot->presentItem)) {
|
|
|
+ if (strtolower($plot->presentItem) == strtolower("unlockBuild")) { # 特殊处理, 剧情中解锁建筑
|
|
|
+ req()->userInfo->game->privateState->unlockedBuild[] = $plot->presentEffect; # 添加解锁记录
|
|
|
+ NormalEventProc::OnUnlockBuild($plot->presentEffect); # 插入解锁事件
|
|
|
+ } else if (strtolower($plot->presentItem) == strtolower("rename")) {# 改名
|
|
|
+ // 跳过特殊字符串
|
|
|
+ } else { # 普通奖励
|
|
|
+ StoreProc::AddMultiItemInStore(req(), $plot->presentItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!empty($plot->recycleItem)) {
|
|
|
+ $val = explode(",", $plot->recycleItem);
|
|
|
+ my_Assert(count($val) > 1, "解析回收道具字符串出错");
|
|
|
+ StoreProc::removeItemFromStore(req()->userInfo->game->store, $val[0], $val[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
return Resp::ok(array('store' => $req->userInfo->game->store,
|
|
|
'taskCardUpdate' => $bUpdate));
|
|
|
}
|