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