This commit is contained in:
hujiabin 2023-07-03 16:40:12 +08:00
parent 1a615a971d
commit 03540d5517
2 changed files with 26 additions and 6 deletions

View File

@ -146,9 +146,7 @@ class Hero(object):
'response': [
_common.RspHead(),
['ceg', 0, 'ceg'],
['gold', 0, 'gold'],
['piece', 0, '碎片'],
['serum', 0, '材料'],
['!cost', [_common.AwardItem()], '返还资源']
]
},{
'name': 'heroResetLevel',

View File

@ -359,6 +359,10 @@ class HeroController extends BaseAuthedController {
$this->_rspErr(1, "param hero_unnid error");
return;
}
if ($heroDb['hero_lv'] == 1){
$this->_rspErr(1, "Level 1 hero cannot operate");
return;
}
$paramMeta = \mt\Parameter::getListValue('hero_reset_cost');
if (!$paramMeta){
$this->_rspErr(1, "parameter hero_reset_cost is null ");
@ -380,11 +384,29 @@ class HeroController extends BaseAuthedController {
$serum += $heroLevelMeta['serum'];
$gold += $heroLevelMeta['gold'];
}
$costItems = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => $gold,
),
array(
'item_id' => V_ITEM_HERO_META,
'item_num' => $serum,
),
);
$metaList = mt\Item::getMetaListByType(mt\Item::FRAGMENT_TYPE);
foreach ($metaList as $meta){
if ($meta['relationship'] == $heroDb['hero_id']) {
array_push($costItems,array(
'item_id' => $meta['id'],
'item_num' => $piece,
));
}
}
$this->_rspData(array(
'ceg' => $actual_price,
'gold' => $gold,
'piece' => $piece,
'serum' => $serum,
"cost" => $costItems
));
}
/*