Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb
This commit is contained in:
commit
e2bd74e0f2
@ -150,16 +150,37 @@ 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'].'_'.$this->getRealHeroQuality($heroDb).".gif";
|
||||||
array_push($info['attributes'],array(
|
array_push($info['attributes'],array(
|
||||||
"trait_type" => "level",
|
"trait_type" => "quality",
|
||||||
"value" => intval($heroDb['hero_lv']),
|
"value" => intval($this->getRealHeroQuality($heroDb)),
|
||||||
"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);
|
||||||
@ -280,10 +301,12 @@ class OutAppNftController extends BaseController {
|
|||||||
$info['item_id'] = $heroMeta['id'];
|
$info['item_id'] = $heroMeta['id'];
|
||||||
$info['type'] = $nftDb['token_type'];
|
$info['type'] = $nftDb['token_type'];
|
||||||
$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $heroDb['quality'] . '.gif';
|
$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $heroDb['quality'] . '.gif';
|
||||||
$info['detail']['quality'] = $heroDb['quality'];
|
$info['detail']['quality'] = $this->getRealHeroQuality($heroDb);
|
||||||
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
|
$info['detail']['max_mining_days'] = $heroAtteMeta['validTime'];
|
||||||
$info['detail']['wealth'] = floor($wealth * (1+$wealth_rate));
|
$info['detail']['wealth'] = floor($wealth * (1+$wealth_rate));
|
||||||
$info['detail']['lucky'] = floor($lucky * (1+$lucky_rate));
|
$info['detail']['lucky'] = floor($lucky * (1+$lucky_rate));
|
||||||
|
$info['detail']['wealth'] = '';
|
||||||
|
$info['detail']['lucky'] = '';
|
||||||
$info['detail']['hp'] = $heroAbility['hp'];
|
$info['detail']['hp'] = $heroAbility['hp'];
|
||||||
$info['detail']['atk'] = $heroAbility['attack'];
|
$info['detail']['atk'] = $heroAbility['attack'];
|
||||||
$info['detail']['def'] = $heroAbility['defence'];
|
$info['detail']['def'] = $heroAbility['defence'];
|
||||||
@ -390,4 +413,17 @@ class OutAppNftController extends BaseController {
|
|||||||
return $row ? 1 : 0;
|
return $row ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getRealHeroQuality($heroDb)
|
||||||
|
{
|
||||||
|
$quality = $heroDb['quality'];;
|
||||||
|
if ($heroDb['createtime'] <= 1719985966) {
|
||||||
|
} else {
|
||||||
|
$quality = $quality - 1;
|
||||||
|
if ($quality <= 0) {
|
||||||
|
$quality = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $quality;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ class Nft extends BaseModel
|
|||||||
't_nft',
|
't_nft',
|
||||||
array(
|
array(
|
||||||
'owner_address' => LOCK_CONTRACT_ADDRESS,
|
'owner_address' => LOCK_CONTRACT_ADDRESS,
|
||||||
'last_owner_address' => $account,
|
'last_lock_address' => $account,
|
||||||
'token_type' => $type,
|
'token_type' => $type,
|
||||||
'deleted' => 0,
|
'deleted' => 0,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user