From abef3067b08491c4fb316c0e4cc352fa6e2728fe Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 23 Apr 2022 22:57:41 +0800 Subject: [PATCH] 1 --- doc/_common.py | 6 ++++++ webapp/models/Nft.php | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/_common.py b/doc/_common.py index d717992e..8a78b6e9 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -491,6 +491,12 @@ class NftGunDetail(object): ['level', 0, '等级'], ['quality', 0, '星级'], ['lukcy', 0, '幸运'], + ['clip_volume', 0, '弹夹数'], + ['reload_time', 0, '装弹时间'], + ['fire_rate', 0, '射击速度'], + ['atk', 0, '攻击'], + ['bullet_speed', 0, '子弹速度'], + ['range', 0, '射程'], ['!attr', [AttrDesc()], '属性'], ] diff --git a/webapp/models/Nft.php b/webapp/models/Nft.php index 48f4a675..62383a45 100644 --- a/webapp/models/Nft.php +++ b/webapp/models/Nft.php @@ -151,7 +151,11 @@ class Nft extends BaseModel { break; case Nft::EQUIP_TYPE: { - $equipMeta = mt\Equip::get($nftDb['item_id']); + $equipMeta = mt\Equip::get($itemMeta['relationship']); + error_log(json_encode(array( + 'equpMeta' => $equipMeta, + 'nftDb' => $nftDb + ))); $nft['info']['level'] = 1; $nft['info']['quality'] = 1; $nft['info']['lucky'] = $equipMeta ? $equipMeta['gun_lucky'] : 0; @@ -182,6 +186,14 @@ class Nft extends BaseModel { } } } + { + $nft['info']['clip_volume'] = getXVal($equipMeta, 'clip_volume', 0); + $nft['info']['reload_time'] = getXVal($equipMeta, 'reload_time', 0); + $nft['info']['fire_rate'] = getXVal($equipMeta, 'fire_rate', 0); + $nft['info']['atk'] = getXVal($equipMeta, 'atk', 0); + $nft['info']['bullet_speed'] = getXVal($equipMeta, 'bullet_speed', 0); + $nft['info']['range'] = getXVal($equipMeta, 'range', 0); + } $nft['info']['attr'] = $randAttr; } break;