1
This commit is contained in:
parent
dd6e225bea
commit
b49d90706b
@ -150,16 +150,36 @@ class OutAppNftController extends BaseController {
|
|||||||
echo json_encode($info);
|
echo json_encode($info);
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
$heroAttrs = emptyReplace(json_decode($heroDb['wealth_attr'], true), array());
|
||||||
|
$heroResult = \mt\EconomyAttribute::getAttrValue($heroAttrs);
|
||||||
|
$wealth = $heroResult['wealth'];
|
||||||
|
$wealth_rate = $heroResult['wealth_rate'];
|
||||||
|
$lucky = $heroResult['lucky'];
|
||||||
|
$lucky_rate = $heroResult['lucky_rate'];
|
||||||
|
$heroAbility = Hero::abilityInfo($heroDb);
|
||||||
$heroMeta = \mt\Hero::get($heroDb['hero_id']);
|
$heroMeta = \mt\Hero::get($heroDb['hero_id']);
|
||||||
$NftMeta = \mt\NftDesc::getByItemId($heroDb['hero_id']);
|
$NftMeta = \mt\NftDesc::getByItemId($heroDb['hero_id']);
|
||||||
|
$itemMeta = \mt\Item::get($heroDb['hero_id']);
|
||||||
|
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($itemMeta['relationship'],$heroDb['quality']);
|
||||||
$info['token_id'] = $tokenId;
|
$info['token_id'] = $tokenId;
|
||||||
$info['name'] = $heroMeta['name'];
|
$info['name'] = $heroMeta['name'];
|
||||||
$info['description'] = $NftMeta['desc'];
|
$info['description'] = $NftMeta['desc'];
|
||||||
$info['image'] = "https://res2.counterfire.games/nft/meta/".$heroDb['hero_id'].'_'.$heroDb['quality'].".gif";
|
$info['image'] = "https://res2.counterfire.games/nft/meta/".$heroDb['hero_id'].'_'.$heroDb['quality'].".gif";
|
||||||
array_push($info['attributes'],array(
|
array_push($info['attributes'],array(
|
||||||
"trait_type" => "level",
|
"trait_type" => "quality",
|
||||||
"value" => intval($heroDb['hero_lv']),
|
"value" => intval($heroDb['quality']),
|
||||||
"max_value" => 15,
|
));
|
||||||
|
array_push($info['attributes'],array(
|
||||||
|
"trait_type" => "max_mining_days",
|
||||||
|
"value" => $heroAtteMeta['validTime'],
|
||||||
|
));
|
||||||
|
array_push($info['attributes'],array(
|
||||||
|
"trait_type" => "wealth",
|
||||||
|
"value" => floor($wealth * (1+$wealth_rate)),
|
||||||
|
));
|
||||||
|
array_push($info['attributes'],array(
|
||||||
|
"trait_type" => "lucky",
|
||||||
|
"value" => floor($lucky * (1+$lucky_rate)),
|
||||||
));
|
));
|
||||||
if ($this->isCloseBox()) {
|
if ($this->isCloseBox()) {
|
||||||
$this->fillBoxMeta($info);
|
$this->fillBoxMeta($info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user