game2006api/webapp/mt/StakingVip.php
hujiabin c84b774d26 VIP
2024-09-27 15:58:23 +08:00

66 lines
2.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace mt;
use phpcommon;
class StakingVip {
const GAIN_GOLD = 1; //类型 = 1Gold模式额外获数量具体指不是比例
const HERO_UP = 2; //类型 = 2英雄升阶金币消耗减少比例
const ACCOUNT_TIMES = 3; //类型 = 3账号总打金次数增加场次
const GOLD_CUT_DOWN = 4; //类型 = 4购买特殊道具所需金币数量减少比例此处特殊道具包括-Bounty门票、恢复道具、封装道具
const DIAMOND_CUT_DOWN = 5; //类型 = 5购买特殊道具所需钻石数量减少比例此处特殊道具包括-英雄升阶概率提升道具
const ACCOUNT_LUCKY_INC = 6; //类型 = 6账号总有效幸运值增加数值
public static function find($lv)
{
foreach (self::getMetaList() as $meta){
if ($meta['rank'] == $lv){
return $meta;
}
}
return array();
}
public static function exportRights($lv){
$meta = self::find($lv);
if (!$meta || empty($meta['rights'])){
return array();
}
$rightList = array();
$rights = explode('|',$meta['rights']);
foreach ($rights as $right){
$arr = explode(':',$right);
array_push($rightList,array(
'type' => $arr[0],
'val' => $arr[1],
));
}
return $rightList;
}
public static function getValByLv($lv,$type){
$rights = self::exportRights($lv);
$rightsHash = array();
array_walk($rights, function ($row) use(&$rightsHash) {
$rightsHash[$row['type']] = $row;
});
if (isset($rightsHash[$type])){
return $rightsHash[$type]['val'];
}
return 0;
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('stakingVip@stakingVip.php');
}
return self::$metaList;
}
protected static $metaList;
}