From d5d0a704304ff2bfa692025b02ab61a012657a7e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 11:25:39 +0800 Subject: [PATCH 1/5] 1 --- webapp/controller/BattleController.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 5690cae0..183ab189 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -966,6 +966,17 @@ class BattleController extends BaseAuthedController { $info['match_mode'] = 1; } } + { + $info['items'] = array(); + array_push($info['items'], array( + 'item_id' => 900007, + 'item_num' => 10, + )); + array_push($info['items'], array( + 'item_id' => 902101, + 'item_num' => 10, + )); + } } array_push($teamInfo['members'], $info); } From 87934df605e5ba3602149cee0b60c414136f6253 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 14:15:06 +0800 Subject: [PATCH 2/5] 1 --- webapp/mt/Item.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp/mt/Item.php b/webapp/mt/Item.php index 77d1234c..4548cf6a 100644 --- a/webapp/mt/Item.php +++ b/webapp/mt/Item.php @@ -65,6 +65,10 @@ class Item { 3.战队改名卡 4.体力药剂 5.耐久药剂 + 6.赏金门票 + 7.英雄升阶道具 + 8.幸运符 + 9.战斗内药剂 type类型为10时,配置一下子类id 1.角色材料 @@ -132,6 +136,8 @@ class Item { const APPOINT_CHIP_SUBTYPE = 2; const APPOINT_SKIN_SUBTYPE = 3; + const LUCKY_SYMBOL_SUBTYPE = 8; + const BATTLE_POTION_SUBTYPE = 9; public static function get($id) { From 7ba0216b5784b7ef464d7b41d56e7c189ba37416 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 14:25:45 +0800 Subject: [PATCH 3/5] 1 --- webapp/controller/UserController.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 9603a20d..3c0cde25 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -479,6 +479,22 @@ class UserController extends BaseAuthedController { )); } + public function getBattleItem() + { + $itemId = getReqVal("item_id", ""); + $itemMeta = mt\Item::get($itemId); + if (empty($itemMeta)) { + myself()->_rspErr(1, 'item_id not found'); + return; + } + $itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId); + myself()->_rspData(array( + 'item_id' => $itemId, + 'item_type' => $itemMeta['type'], + 'item_sub_type' => $itemMeta['sub_type'] + )); + } + public function query() { $name = getReqVal('name', ''); From a81311100b5bbcfeca92d0578eddefcf532b9870 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 14:30:19 +0800 Subject: [PATCH 4/5] 1 --- webapp/controller/UserController.class.php | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 3c0cde25..c2c7782f 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -487,12 +487,23 @@ class UserController extends BaseAuthedController { myself()->_rspErr(1, 'item_id not found'); return; } - $itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId); - myself()->_rspData(array( - 'item_id' => $itemId, - 'item_type' => $itemMeta['type'], - 'item_sub_type' => $itemMeta['sub_type'] - )); + if ($itemMeta['type'] == mt\Item::FUNC_TYPE && + in_array($itemMeta['sub_type'], + array( + mt\Item::LUCKY_SYMBOL_SUBTYPE, + mt\Item::BATTLE_POTION_SUBTYPE + ) + )) { + $itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId); + myself()->_rspData(array( + 'item_id' => $itemId, + 'item_type' => $itemMeta['type'], + 'item_sub_type' => $itemMeta['sub_type'] + )); + } else { + myself()->_rspErr(1, 'item_id not found'); + return; + } } public function query() From e9e80208089cf3dbfd9957f5d5f306794dce4314 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Sat, 12 Oct 2024 14:44:32 +0800 Subject: [PATCH 5/5] 1 --- webapp/controller/HeroController.class.php | 28 ++++++++++++++++++++-- webapp/services/RookieTaskService.php | 8 +++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index b71e5d1b..26fa9b6e 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -164,10 +164,33 @@ class HeroController extends BaseAuthedController { $this->_rspErr(1, "Error operation"); return; } - if ($itemId != $heroMeta['heroPiece'] || $itemNum < $manufactureMeta['needItem']){ + if ($heroDb['quality'] > 1 && ($itemId != $heroMeta['heroPiece'] || $itemNum != $manufactureMeta['needItem'])){ $this->_rspErr(100, 'Insufficient material'); return; } + if ($heroDb['quality'] == 1){ + $alternative = explode(":",$manufactureMeta['alternative']); + switch ($itemId){ + case $heroMeta['heroPiece'] :{ + if ($itemNum != $manufactureMeta['needItem']){ + $this->_rspErr(100, 'Insufficient material'); + return; + } + } + break; + case $alternative[0] :{ + if ($itemNum != $alternative[1]){ + $this->_rspErr(100, 'Insufficient material'); + return; + } + } + break; + default:{ + $this->_rspErr(100, 'item error'); + return; + } + } + } $extraItem = explode("|",$manufactureMeta['extraItem']); $chanceKey = 0; if ($extraItemId == $extraItem[0]){ @@ -186,7 +209,7 @@ class HeroController extends BaseAuthedController { ), array( 'item_id' => $itemId, - 'item_num' => $manufactureMeta['needItem'] + 'item_num' => $itemNum ), ); $lackItem = null; @@ -200,6 +223,7 @@ class HeroController extends BaseAuthedController { $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); return; } + //消耗材料 $this->_decItems($costItems); // $this->_incPeriodV(TN_HASH_RATE_UP_HERO_TIMES, 0, 1); diff --git a/webapp/services/RookieTaskService.php b/webapp/services/RookieTaskService.php index 44eff194..e6c50988 100644 --- a/webapp/services/RookieTaskService.php +++ b/webapp/services/RookieTaskService.php @@ -22,6 +22,10 @@ class RookieTaskService extends BaseService 'target' => getXVal($taskMeta, 'target', 1), 'state' => self::NOT_FINISHED_STATE, ); + if ($taskDto['current'] >= $taskDto['target']) { + $taskDto['current'] = $taskDto['target']; + $taskDto['state'] = self::FINISHED_STATE; + } $starTime = RookieTask::getMyStarTime(); if ($taskMeta['task_day'] > 0){ $time = ($taskMeta['task_day']-1) * 86400; @@ -29,10 +33,6 @@ class RookieTaskService extends BaseService $taskDto['state'] = self::UNARRIVED_TIME_STATE; } } - if ($taskDto['current'] >= $taskDto['target']) { - $taskDto['current'] = $taskDto['target']; - $taskDto['state'] = self::FINISHED_STATE; - } $taskDb = RookieTask::find($taskMeta['id']); if ($taskDb){ $taskDto['state'] = self::RECEIVED_STATE;