芯片功能修改
This commit is contained in:
parent
966baf2fc7
commit
744a00f000
34
doc/Chip.py
34
doc/Chip.py
@ -38,10 +38,42 @@ class Chip(object):
|
|||||||
'url': 'webapp/index.php?c=Chip&a=upgradeQuality',
|
'url': 'webapp/index.php?c=Chip&a=upgradeQuality',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['chip_uniid', '', '芯片唯一id'],
|
['chip_uniid', '', '升阶芯片唯一id'],
|
||||||
|
['consume_uniids', '', '材料芯片唯一id,用“|”隔开'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
['status', 0, '0=失败 1=成功'],
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'synChip',
|
||||||
|
'desc': '芯片合成',
|
||||||
|
'group': 'Chip',
|
||||||
|
'url': 'webapp/index.php?c=Chip&a=synChip',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['item_id', '', '材料item_id'],
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['award', _common.AwardItem(), '合成芯片奖励'],
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'resolveChip',
|
||||||
|
'desc': '分解芯片',
|
||||||
|
'group': 'Chip',
|
||||||
|
'url': 'webapp/index.php?c=Chip&a=resolveChip',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['chip_uniids', '', '芯片uniid 多个用“|”隔开'],
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['award', _common.AwardItem(), '分解所得材料'],
|
||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -35,22 +35,6 @@ class Fragment(object):
|
|||||||
['status', 0, '1:成功 0:失败'],
|
['status', 0, '1:成功 0:失败'],
|
||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
|
||||||
'name': 'synChip',
|
|
||||||
'desc': '芯片合成',
|
|
||||||
'group': 'Fragment',
|
|
||||||
'url': 'webapp/index.php?c=Fragment&a=synChip',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
['item_id', '', 'item_id'],
|
|
||||||
['item_num', '', 'item_num'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['item_id', 0, '芯片item_id'],
|
|
||||||
['status', 0, '1:成功 0:失败'],
|
|
||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
require_once('models/Chip.php');
|
require_once('models/Chip.php');
|
||||||
|
|
||||||
require_once('mt/QualityUpMapRule.php');
|
|
||||||
require_once('mt/ChipAttribute.php');
|
require_once('mt/ChipAttribute.php');
|
||||||
|
require_once('mt/BattleRandAttribute.php');
|
||||||
require_once('mt/EconomyAttribute.php');
|
require_once('mt/EconomyAttribute.php');
|
||||||
require_once('mt/Manufacture.php');
|
require_once('mt/Manufacture.php');
|
||||||
|
require_once('mt/Parameter.php');
|
||||||
|
|
||||||
require_once('services/PropertyChgService.php');
|
require_once('services/PropertyChgService.php');
|
||||||
|
require_once('services/AwardService.php');
|
||||||
|
require_once('services/LootService.php');
|
||||||
|
require_once('services/LogService.php');
|
||||||
|
|
||||||
|
|
||||||
use models\Chip;
|
use models\Chip;
|
||||||
@ -63,42 +68,101 @@ class ChipController extends BaseAuthedController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function upgradeQuality(){
|
public function upgradeQuality(){
|
||||||
return ;
|
|
||||||
$chipUniId = getReqVal('chip_uniid', 0);
|
$chipUniId = getReqVal('chip_uniid', 0);
|
||||||
$itemId = getReqVal('item_id',0);
|
$consumeUniIds = getReqVal('consume_uniids',0);
|
||||||
$itemNum = getReqVal('item_num',0);
|
|
||||||
if ($itemNum < 1){
|
|
||||||
$this->_rspErr(1, "item_num not enough");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$chipDb = Chip::find($chipUniId);
|
$chipDb = Chip::find($chipUniId);
|
||||||
if (!$chipDb) {
|
if (!$chipDb) {
|
||||||
$this->_rspErr(100, 'param hero_uniid error ');
|
$this->_rspErr(100, 'param chip_uniid error ');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($chipDb['quality'] == \mt\QualityUpMapRule::MAX_QUALITY){
|
if ($chipDb['quality'] == Chip::CHIP_QUALITY_MAX){
|
||||||
$this->_rspErr(5, "It's already the highest level");
|
$this->_rspErr(5, "It's already the highest level");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$heroQualityMeta = \mt\QualityUpMapRule::getByQuality($chipDb['item_id'],$chipDb['quality']+1);
|
$chipAttrMeta = \mt\ChipAttribute::get($chipDb['item_id']);
|
||||||
if (!$heroQualityMeta || $heroQualityMeta['needItem'] != $itemId){
|
if (!$chipAttrMeta){
|
||||||
$this->_rspErr(100, 'param item_id error ');
|
$this->_rspErr(100, 'mt error ');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$manufactureMeta = \mt\Manufacture::findChipAction(\mt\Manufacture::UP_ACTION,$chipDb['quality']+1);
|
$consumeUniIdArr = explode("|",$consumeUniIds);
|
||||||
|
foreach ($consumeUniIdArr as $uniid){
|
||||||
|
$consumeChipDb = Chip::find($uniid);
|
||||||
|
if (!$consumeChipDb || $consumeChipDb['quality'] != $chipDb['quality'] || $chipDb['inlay_state'] == 1) {
|
||||||
|
$this->_rspErr(100, 'param consume error ');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$manufactureMeta = \mt\Manufacture::getByInvoke($chipAttrMeta['manufacture'],$chipDb['quality']+1);
|
||||||
if (!$manufactureMeta){
|
if (!$manufactureMeta){
|
||||||
$this->_rspErr(1, "Error operation");
|
$this->_rspErr(1, "mt error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (count($consumeUniIdArr) != $manufactureMeta['needItem']){
|
||||||
|
$this->_rspErr(100, ' consume number error ');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//消耗材料
|
||||||
|
$costItems = array();
|
||||||
|
foreach ($consumeUniIdArr as $uniid){
|
||||||
|
$consumeChipDb = Chip::find($uniid);
|
||||||
|
array_push($costItems, $consumeChipDb);
|
||||||
|
Chip::update2($uniid,array(
|
||||||
|
'account_id' => myself()->_getAccountId() . '!!!',
|
||||||
|
'modifytime' => myself()->_getNowTime(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
|
$hashChance = \mt\Manufacture::hashChance($manufactureMeta['chance']);
|
||||||
|
$weight = $hashChance[0];
|
||||||
|
$rnd = rand(1,100);
|
||||||
|
$status = 0;
|
||||||
|
if ($rnd <= $weight*100){
|
||||||
|
$status = 1;
|
||||||
|
$attr = emptyReplace(json_decode($chipDb['rand_attr'], true), array());
|
||||||
|
$attribute = \mt\EconomyAttribute::getAttribute($chipAttrMeta['economyAttribute'],$chipDb['quality'] + 1);
|
||||||
|
$randMeta = mt\BattleRandAttribute::getByWeight($chipAttrMeta['battleAttribute'],$chipDb['quality'] + 1);
|
||||||
|
$randAttr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
||||||
|
$newAttr = mt\BattleRandAttribute::mergeAttr($attr,$randAttr);
|
||||||
|
Chip::update2($chipUniId, array(
|
||||||
|
'quality' => $chipDb['quality'] + 1,
|
||||||
|
'rand_attr' => json_encode($newAttr),
|
||||||
|
'wealth_attr' => json_encode($attribute),
|
||||||
|
'modifytime' => myself()->_getNowTime()
|
||||||
|
));
|
||||||
|
$chipDb['quality'] += 1;
|
||||||
|
$chipDb['rand_attr'] = $newAttr;
|
||||||
|
$chipDb['wealth_attr'] = $attribute;
|
||||||
|
}
|
||||||
|
$event = array(
|
||||||
|
'ID' => 'chip',
|
||||||
|
'SUB_ID' => 'advanced',
|
||||||
|
'SUB_KEY' => 'chip_advanced',
|
||||||
|
'cost_chip' => $costItems,
|
||||||
|
'chance' => $weight,
|
||||||
|
'result' => $status,
|
||||||
|
'outcome_chip' =>$chipDb,
|
||||||
|
);
|
||||||
|
\services\LogService::burialPointEvent($event);
|
||||||
|
$this->_rspData(array(
|
||||||
|
'status' => $status,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function synChip(){
|
||||||
|
$itemId = getReqVal('item_id',0);
|
||||||
|
$needItem = \mt\Parameter::getVal('chip_craft_need_item',0);
|
||||||
|
$needItemNum = \mt\Parameter::getVal('chip_craft_need_item_number',50);
|
||||||
|
if ($itemId != $needItem){
|
||||||
|
$this->_rspErr(1, "item_id error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$itemNum = min($itemNum,$manufactureMeta['numTop']);
|
|
||||||
$costItems = array(
|
$costItems = array(
|
||||||
array(
|
|
||||||
'item_id' => V_ITEM_GOLD,
|
|
||||||
'item_num' => $manufactureMeta['gold']
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'item_id' => $itemId,
|
'item_id' => $itemId,
|
||||||
'item_num' => $itemNum
|
'item_num' => $needItemNum
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$lackItem = null;
|
$lackItem = null;
|
||||||
@ -106,28 +170,78 @@ class ChipController extends BaseAuthedController
|
|||||||
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//消耗材料
|
// 消耗材料
|
||||||
$this->_decItems($costItems);
|
$this->_decItems($costItems);
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$awardService = new services\AwardService();
|
||||||
$propertyChgService->addBagChg();
|
$propertyChgService->addBagChg();
|
||||||
$hashChance = \mt\Manufacture::hashChance($manufactureMeta['chance']);
|
|
||||||
$weight = isset($hashChance[$itemNum]) ? $hashChance[$itemNum] : 0;
|
$synLoot = \mt\Parameter::getVal('chip_craft_product_loot','');
|
||||||
$rnd = rand(1,100);
|
$items = \services\LootService::dropOutItem($synLoot);
|
||||||
$status = 0;
|
$this->_addItems($items,$awardService,$propertyChgService);
|
||||||
if ($rnd <= $weight*100){
|
$propertyChgService->addChip();
|
||||||
$status = 1;
|
$event = array(
|
||||||
$chipAttrMeta = \mt\ChipAttribute::get($chipDb['item_id']);
|
'ID' => 'chip',
|
||||||
$attribute = \mt\EconomyAttribute::getAttribute($chipAttrMeta['economyAttribute'],$chipDb['quality'] + 1);
|
'SUB_ID' => 'synthesis',
|
||||||
Chip::update2($chipUniId, array(
|
'SUB_KEY' => 'chip_synthesis',
|
||||||
'quality' => $chipDb['quality'] + 1,
|
'cost_item' => array(
|
||||||
'wealth_attr' => json_encode($attribute),
|
'item_id' => $itemId,
|
||||||
));
|
'item_num' => $needItemNum
|
||||||
$propertyChgService->addHeroChg();
|
),
|
||||||
}
|
'outcome_chip' => $items[0],
|
||||||
|
);
|
||||||
|
\services\LogService::burialPointEvent($event);
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'status' => $status,
|
'award' => $awardService->toDto(),
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resolveChip(){
|
||||||
|
$chip_uniids = getReqVal('chip_uniids',0);
|
||||||
|
$uniidArr = explode('|',$chip_uniids);
|
||||||
|
foreach ($uniidArr as $uniid){
|
||||||
|
$chipDb = Chip::find($uniid);
|
||||||
|
if (!$chipDb || $chipDb['inlay_state'] == 1){
|
||||||
|
$this->_rspErr(1, "the chip don't operation");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$decLoot = \mt\Parameter::getVal('chip_craft_decompose_loot',0);
|
||||||
|
$lootArr = explode("|",$decLoot);
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$awardService = new services\AwardService();
|
||||||
|
$cost_item = array();
|
||||||
|
$outcome_item = array();
|
||||||
|
foreach ($uniidArr as $uniid){
|
||||||
|
$chipDb = Chip::find($uniid);
|
||||||
|
array_push($cost_item,$chipDb['item_id']);
|
||||||
|
$lootId = $lootArr[$chipDb['quality'] - 1 ];
|
||||||
|
$items = \services\LootService::dropOutItem($lootId);
|
||||||
|
array_push($outcome_item,$items[0]);
|
||||||
|
Chip::update2($uniid,array(
|
||||||
|
'account_id' => myself()->_getAccountId() . '!!!',
|
||||||
|
'modifytime' => myself()->_getNowTime(),
|
||||||
|
));
|
||||||
|
$this->_addItems($items,$awardService,$propertyChgService);
|
||||||
|
}
|
||||||
|
$propertyChgService->addChip();
|
||||||
|
$propertyChgService->addBagChg();
|
||||||
|
$event = array(
|
||||||
|
'ID' => 'chip',
|
||||||
|
'SUB_ID' => 'resolve',
|
||||||
|
'SUB_KEY' => 'chip_resolve',
|
||||||
|
'cost_item' => $cost_item,
|
||||||
|
'outcome_item' => $outcome_item,
|
||||||
|
);
|
||||||
|
\services\LogService::burialPointEvent($event);
|
||||||
|
$this->_rspData(array(
|
||||||
|
'award' => $awardService->toDto(),
|
||||||
'property_chg' => $propertyChgService->toDto(),
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,7 @@ class FragmentController extends BaseAuthedController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function synChip(){
|
public function synChip(){
|
||||||
|
return
|
||||||
$itemId = getReqVal('item_id',0);
|
$itemId = getReqVal('item_id',0);
|
||||||
$itemNum = getReqVal('item_num',0);
|
$itemNum = getReqVal('item_num',0);
|
||||||
$itemMeta = \mt\Item::get($itemId);
|
$itemMeta = \mt\Item::get($itemId);
|
||||||
|
@ -24,6 +24,7 @@ class Chip extends BaseModel
|
|||||||
const FREE_STATE = 1;
|
const FREE_STATE = 1;
|
||||||
|
|
||||||
const CHIP_LV_MAX = 3;
|
const CHIP_LV_MAX = 3;
|
||||||
|
const CHIP_QUALITY_MAX = 5;
|
||||||
|
|
||||||
public static function find($chipUniId)
|
public static function find($chipUniId)
|
||||||
{
|
{
|
||||||
@ -37,9 +38,9 @@ class Chip extends BaseModel
|
|||||||
if ($row) {
|
if ($row) {
|
||||||
$row['chip_uniid'] = $row['idx'];
|
$row['chip_uniid'] = $row['idx'];
|
||||||
if ($row['account_id'] != myself()->_getAccountId()) {
|
if ($row['account_id'] != myself()->_getAccountId()) {
|
||||||
if (NftService::isChipOwner(myself()->_getAddress(), $row['token_id']) <= 0) {
|
// if (NftService::isChipOwner(myself()->_getAddress(), $row['token_id']) <= 0) {
|
||||||
$row = null;
|
$row = null;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $row;
|
return $row;
|
||||||
@ -258,7 +259,7 @@ class Chip extends BaseModel
|
|||||||
$attribute = \mt\EconomyAttribute::getAttribute($chipAttrMeta['economyAttribute'],$quality);
|
$attribute = \mt\EconomyAttribute::getAttribute($chipAttrMeta['economyAttribute'],$quality);
|
||||||
{
|
{
|
||||||
$randAttr = array();
|
$randAttr = array();
|
||||||
$randMeta = mt\BattleRandAttribute::getByWeight($chipAttrMeta['battleAttribute']);
|
$randMeta = mt\BattleRandAttribute::getByWeight($chipAttrMeta['battleAttribute'],$quality);
|
||||||
if ($randMeta){
|
if ($randMeta){
|
||||||
$randAttr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
$randAttr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ class Hero extends BaseModel {
|
|||||||
{
|
{
|
||||||
$attr = emptyReplace(json_decode($row['rand_attr'], true), array());
|
$attr = emptyReplace(json_decode($row['rand_attr'], true), array());
|
||||||
if (!$attr){
|
if (!$attr){
|
||||||
$attr = self::getRandAttr($row['hero_id']);
|
$attr = self::getRandAttr($row['hero_id'],$row['quality']);
|
||||||
self::update($row['idx'],array(
|
self::update($row['idx'],array(
|
||||||
'rand_attr'=>json_encode($attr)
|
'rand_attr'=>json_encode($attr)
|
||||||
));
|
));
|
||||||
@ -610,7 +610,7 @@ class Hero extends BaseModel {
|
|||||||
public static function internalAddHero($conn, $heroMeta, $accountId, $tokenId,$quality = 1)
|
public static function internalAddHero($conn, $heroMeta, $accountId, $tokenId,$quality = 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
$randAttr = self::getRandAttr($heroMeta['id']) ;
|
$randAttr = self::getRandAttr($heroMeta['id'],$quality) ;
|
||||||
$attribute = \mt\EconomyAttribute::getAttribute($heroMeta['relationship'], $quality);
|
$attribute = \mt\EconomyAttribute::getAttribute($heroMeta['relationship'], $quality);
|
||||||
$seal_type = 0;
|
$seal_type = 0;
|
||||||
$unseal_time = 0;
|
$unseal_time = 0;
|
||||||
@ -662,11 +662,11 @@ class Hero extends BaseModel {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static function getRandAttr($heroId){
|
private static function getRandAttr($heroId,$quality){
|
||||||
$attr = array();
|
$attr = array();
|
||||||
$basicMeta = mt\BattleBasicAttribute::get($heroId);
|
$basicMeta = mt\BattleBasicAttribute::get($heroId);
|
||||||
if ($basicMeta) {
|
if ($basicMeta) {
|
||||||
$randMeta = mt\BattleRandAttribute::getByWeight($basicMeta['randomAttribute_Default']);
|
$randMeta = mt\BattleRandAttribute::getByWeight($basicMeta['randomAttribute_Default'],$quality);
|
||||||
if ($randMeta) {
|
if ($randMeta) {
|
||||||
$attr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
$attr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ class HeroSkin extends BaseModel {
|
|||||||
$wealth_attr = array();
|
$wealth_attr = array();
|
||||||
$dressMeta = mt\DressAttribute::get($itemMeta['id']);
|
$dressMeta = mt\DressAttribute::get($itemMeta['id']);
|
||||||
if ($dressMeta) {
|
if ($dressMeta) {
|
||||||
$randMeta = mt\BattleRandAttribute::getByWeight($dressMeta['battleAttribute']);
|
$randMeta = mt\BattleRandAttribute::getByWeight($dressMeta['battleAttribute'],1);
|
||||||
$rand_attr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
$rand_attr = mt\BattleRandAttribute::getRandAttr($randMeta);
|
||||||
$wealth_attr = \mt\EconomyAttribute::getAttribute($dressMeta['economyAttribute'], 1);
|
$wealth_attr = \mt\EconomyAttribute::getAttribute($dressMeta['economyAttribute'], 1);
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ class BattleRandAttribute {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function getByWeight($invoke){
|
public static function getByWeight($invoke,$quality){
|
||||||
$metaList = self::getByInvoke($invoke);
|
$metaList = self::getByInvoke($invoke,$quality);
|
||||||
$totalWeight = 0;
|
$totalWeight = 0;
|
||||||
$randMeta = array();
|
$randMeta = array();
|
||||||
if ($metaList){
|
if ($metaList){
|
||||||
@ -49,10 +49,24 @@ class BattleRandAttribute {
|
|||||||
return $attrArray;
|
return $attrArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getByInvoke($invoke){
|
public static function mergeAttr($attr1 , $attr2){
|
||||||
|
$mergedAttr = array_merge($attr1, $attr2);
|
||||||
|
$newAttr = array();
|
||||||
|
foreach ($mergedAttr as $attr){
|
||||||
|
if (isset($newAttr[$attr['attr_id']])){
|
||||||
|
$newAttr[$attr['attr_id']]['val'] += $attr['val'];
|
||||||
|
}else{
|
||||||
|
$newAttr[$attr['attr_id']] = $attr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array_values($newAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function getByInvoke($invoke,$quality){
|
||||||
$metaList = array();
|
$metaList = array();
|
||||||
foreach (self::getMetaList() as $meta){
|
foreach (self::getMetaList() as $meta){
|
||||||
if ($meta['invoke'] == $invoke){
|
$rateNeed = explode('|', $meta['rareNeed']);
|
||||||
|
if ($meta['invoke'] == $invoke && in_array($quality,$rateNeed)){
|
||||||
array_push($metaList,$meta);
|
array_push($metaList,$meta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,16 +22,6 @@ class Manufacture {
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function findChipAction($action,$quality){
|
|
||||||
foreach (self::getChipList() as $meta){
|
|
||||||
if ($meta['action'] == $action && $meta['rank'] == $quality){
|
|
||||||
|
|
||||||
return $meta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function hashChance($chance){
|
public static function hashChance($chance){
|
||||||
if (!$chance){
|
if (!$chance){
|
||||||
return array();
|
return array();
|
||||||
@ -57,18 +47,17 @@ class Manufacture {
|
|||||||
return self::$heroList;
|
return self::$heroList;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getChipList(){
|
|
||||||
if (!self::$chipList) {
|
public static function getByInvoke($invoke,$quality){
|
||||||
self::$chipList = array();
|
foreach (self::getMetaList() as $meta){
|
||||||
foreach (self::getMetaList() as $meta){
|
if ($meta['invoke'] == $invoke && $meta['rank'] == $quality){
|
||||||
if ($meta['type'] == 2){
|
return $meta;
|
||||||
array_push(self::$chipList , $meta);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return self::$chipList;
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected static function getMetaList()
|
protected static function getMetaList()
|
||||||
{
|
{
|
||||||
if (!self::$metaList) {
|
if (!self::$metaList) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user