From eaae18694c2b0194873acb2293198d656bfbf03f Mon Sep 17 00:00:00 2001 From: hujiabin Date: Tue, 8 Nov 2022 10:36:52 +0800 Subject: [PATCH] =?UTF-8?q?nft=20=E5=8D=87=E9=98=B6ceg=E6=B6=88=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/services/ConsumeService.php | 71 ++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 webapp/services/ConsumeService.php diff --git a/webapp/services/ConsumeService.php b/webapp/services/ConsumeService.php new file mode 100644 index 00000000..050f90bd --- /dev/null +++ b/webapp/services/ConsumeService.php @@ -0,0 +1,71 @@ + V_ITEM_GOLD, + 'item_num' => \services\FormulaService::Hero_Advanced_CEG_Expend($heroDb['quality']+1) + ), + array( + 'item_id' => V_ITEM_DIAMOND, + 'item_num' => \services\FormulaService::Hero_Advanced_CEC_Expend($heroDb['quality']+1) + ) + ); + return $costItems; + } + + //枪械升阶消耗 + public function GunUpConsume($tokenId){ + $gunDb = Gun::findByTokenId($tokenId); + if (!$gunDb){ + return array(); + } + $costItems = array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => \services\FormulaService::Weapon_Advanced_CEG_Expend($gunDb['quality']+1) + ), + array( + 'item_id' => V_ITEM_DIAMOND, + 'item_num' => \services\FormulaService::Weapon_Advanced_CEC_Expend($gunDb['quality']+1) + ) + ); + return $costItems; + } + + //芯片拆卸消耗 + public function ChipDemountConsume($tokenId){ + $chipDb = Chip::getChipByTokenId($tokenId); + if (!$chipDb){ + return array(); + } + $tili = $chipDb['strength_max'] - $chipDb['strength']; + if (!$tili){ + return array(); + } + $costItems = array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => \services\FormulaService::Chip_Demount_Mint($tili) + ) + ); + return $costItems; + } + +} \ No newline at end of file