From 28193516974325425f43d6b7fd693907ab451ca7 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Fri, 17 Mar 2023 13:53:34 +0800 Subject: [PATCH] 1 --- webapp/bootstrap/constant.php | 3 --- webapp/models/Gun.php | 2 +- webapp/mt/Equip.php | 8 ------- webapp/mt/GunLevel.php | 27 ++------------------- webapp/mt/GunQuality.php | 44 ----------------------------------- webapp/mt/Hero.php | 8 ------- webapp/mt/HeroLevelAttr.php | 2 +- webapp/mt/HeroQuality.php | 42 ++------------------------------- 8 files changed, 6 insertions(+), 130 deletions(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index f269a61e..1945f021 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -18,11 +18,8 @@ define('TN_SHOP', 8003); define('TN_RECHARGE_UPGRADE_TIMES', 8004); define('TN_SHARE_GAMES', 8005); define('TN_HERO_LEVEL_UP', 8006); -define('TN_GUN_LEVEL_UP', 80006); define('TN_HERO_QUALITY_UP', 8007); -define('TN_GUN_QUALITY_UP', 80007); define('TN_HERO_MAX_LEVEL', 8008); -define('TN_GUN_MAX_LEVEL', 80008); define('TN_HERO_MAX_QUALITY', 8009); define('TN_GUN_MAX_QUALITY', 80009); define('TN_RANK_STATUS', 99999); diff --git a/webapp/models/Gun.php b/webapp/models/Gun.php index 7fa40818..25507257 100644 --- a/webapp/models/Gun.php +++ b/webapp/models/Gun.php @@ -594,7 +594,7 @@ class Gun extends BaseModel { 'attr_id' => $v['attr_id'], 'val' => $temp, )); - }else if($val['attr_id'] == $v['attr_id'] && in_array($v['attr_id'] ,array(kHAT_Volume,kHAT_BulletSpeed,kHAT_ShotRange,kHAT_Critical,kHAT_CriDamage))){ + }else if($val['attr_id'] == $v['attr_id'] && in_array($v['attr_id'] ,array(kHAT_Volume,kHAT_BulletSpeed,kHAT_ShotRange))){ //子弹数 子弹飞行速度 射程 暴击率 暴击增伤 //上级数值+表格数据 $temp = $val['val'] + $v['val']; diff --git a/webapp/mt/Equip.php b/webapp/mt/Equip.php index aa705e1a..323ccf33 100644 --- a/webapp/mt/Equip.php +++ b/webapp/mt/Equip.php @@ -20,14 +20,6 @@ class Equip { 'attr_id' => kHAT_Atk, 'type' => kHAT_ABS_VAL, 'field_name' => 'atk' - ],[//暴击率-百分比 - 'attr_id' => kHAT_Critical, - 'type' => kHAT_RATE_VAL, - 'field_name' => 'critical' - ],[//暴击伤害-百分比 - 'attr_id' => kHAT_CriDamage, - 'type' => kHAT_RATE_VAL, - 'field_name' => 'cri_damage' ],[//射速-固定值 'attr_id' => kHAT_FireRate, 'type' => kHAT_ABS_VAL, diff --git a/webapp/mt/GunLevel.php b/webapp/mt/GunLevel.php index 02d467ab..8bf97a2f 100644 --- a/webapp/mt/GunLevel.php +++ b/webapp/mt/GunLevel.php @@ -10,7 +10,7 @@ use mt; class GunLevel { - private static $BASE_ATTR = [kHAT_Volume,kHAT_ReloadTime,kHAT_FireRate,kHAT_Atk,kHAT_BulletSpeed,kHAT_ShotRange,kHAT_Critical,kHAT_CriDamage]; + private static $BASE_ATTR = [kHAT_Volume,kHAT_ReloadTime,kHAT_FireRate,kHAT_Atk,kHAT_BulletSpeed,kHAT_ShotRange]; public static function find($id,$level) { @@ -61,18 +61,7 @@ class GunLevel { 'val' => self::getRandValue($meta,'range') )); } - if ($meta['crit_atk']){ - array_push($attr,array( - 'attr_id' => kHAT_Critical, - 'val' => self::getRandValue($meta,'crit_atk') - )); - } - if ($meta['damage']){ - array_push($attr,array( - 'attr_id' => kHAT_CriDamage, - 'val' => self::getRandValue($meta,'damage') - )); - } + }else{ array_push($attr,array( 'attr_id' => kHAT_Atk, @@ -108,18 +97,6 @@ class GunLevel { 'val' => self::getRandValueMin($meta,'range') )); } - if ($meta['crit_atk']){ - array_push($attr,array( - 'attr_id' => kHAT_Critical, - 'val' => self::getRandValueMin($meta,'crit_atk') - )); - } - if ($meta['damage']){ - array_push($attr,array( - 'attr_id' => kHAT_CriDamage, - 'val' => self::getRandValueMin($meta,'damage') - )); - } } } diff --git a/webapp/mt/GunQuality.php b/webapp/mt/GunQuality.php index 7f1f3325..f73a2503 100644 --- a/webapp/mt/GunQuality.php +++ b/webapp/mt/GunQuality.php @@ -17,50 +17,6 @@ class GunQuality { return getXVal(self::$qualityHash, $quality, null); } - public static function getCoefficientByQuality($quality,$gun_id){ - $meta = self::getByQuality($quality); - return [ - [ - 'attr_id'=>kHAT_Volume, - 'val' => self::_getCoefficient($meta,$gun_id,'clip_volume_rate') - ], [ - 'attr_id'=>kHAT_ReloadTime, - 'val' => self::_getCoefficient($meta,$gun_id,'reload_time_rate') - ], [ - 'attr_id'=>kHAT_FireRate, - 'val' => self::_getCoefficient($meta,$gun_id,'fire_rate_rate') - ], [ - 'attr_id'=>kHAT_Atk, - 'val' => self::_getCoefficient($meta,$gun_id,'atk_rate') - ], [ - 'attr_id'=>kHAT_BulletSpeed, - 'val' => self::_getCoefficient($meta,$gun_id,'bullet_speed_rate') - ], [ - 'attr_id'=>kHAT_ShotRange, - 'val' => self::_getCoefficient($meta,$gun_id,'range') - ], [ - 'attr_id'=>kHAT_Critical, - 'val' => self::_getCoefficient($meta,$gun_id,'crit_atk_rate') - ], [ - 'attr_id'=>kHAT_CriDamage, - 'val' => self::_getCoefficient($meta,$gun_id,'damage_rate') - ], - ]; - } - - private static function _getCoefficient($meta,$hero_id,$title){ - if ($meta[$title.'2']){ - $item = explode('|',$meta[$title.'2']); - foreach ($item as $val){ - $item_1 = explode(':',$val); - if ($item_1[0] == $hero_id){ - return $item_1[1]; - } - } - return $meta[$title]; - } - return $meta[$title]; - } public static function getRandAttr($qualityMeta) { diff --git a/webapp/mt/Hero.php b/webapp/mt/Hero.php index 430cabcf..a33e9a46 100644 --- a/webapp/mt/Hero.php +++ b/webapp/mt/Hero.php @@ -47,14 +47,6 @@ class Hero { 'attr_id' => kHAT_CriDamage, 'type' => kHAT_RATE_VAL, 'field_name' => 'crit_atk_damage' - ),array(//闪避-百分比 - 'attr_id' => kHAT_Dodge, - 'type' => kHAT_RATE_VAL, - 'field_name' => 'miss' - ),array(//闪避减伤-百分比 - 'attr_id' => kHAT_Ruduce, - 'type' => kHAT_RATE_VAL, - 'field_name' => 'miss_damage_ruduce' ) ); $attr = array(); diff --git a/webapp/mt/HeroLevelAttr.php b/webapp/mt/HeroLevelAttr.php index 81b925ff..ffc54dd0 100644 --- a/webapp/mt/HeroLevelAttr.php +++ b/webapp/mt/HeroLevelAttr.php @@ -9,7 +9,7 @@ require_once('mt/Hero.php'); use phpcommon; class HeroLevelAttr { - private static $BASE_ATTR = [kHAT_Hp,kHAT_Atk,kHAT_Def,kHAT_Critical,kHAT_CriDamage,kHAT_Dodge,kHAT_Ruduce]; + private static $BASE_ATTR = [kHAT_Hp,kHAT_Atk,kHAT_Def,kHAT_Critical,kHAT_CriDamage]; public static function find($id) { diff --git a/webapp/mt/HeroQuality.php b/webapp/mt/HeroQuality.php index d9930c9e..0e33aaba 100644 --- a/webapp/mt/HeroQuality.php +++ b/webapp/mt/HeroQuality.php @@ -28,33 +28,7 @@ class HeroQuality { // return getXVal(self::$coefficientHash, $index, null); } - public static function getCoefficientByQuality($quality,$hero_id){ - $meta = self::getByQuality($quality); - return [ - [ - 'attr_id'=>kHAT_Hp, - 'val' => self::_getCoefficient($meta,$hero_id,'hp_rate') - ], [ - 'attr_id'=>kHAT_Atk, - 'val' => self::_getCoefficient($meta,$hero_id,'atk_rate') - ], [ - 'attr_id'=>kHAT_Def, - 'val' => self::_getCoefficient($meta,$hero_id,'def_rate') - ], [ - 'attr_id'=>kHAT_Critical, - 'val' => self::_getCoefficient($meta,$hero_id,'crit_atk_rate') - ], [ - 'attr_id'=>kHAT_CriDamage, - 'val' => self::_getCoefficient($meta,$hero_id,'damage_rate') - ], [ - 'attr_id'=>kHAT_Dodge, - 'val' => self::_getCoefficient($meta,$hero_id,'miss_rate') - ], [ - 'attr_id'=>kHAT_Ruduce, - 'val' => self::_getCoefficient($meta,$hero_id,'ruduce_rate') - ], - ]; - } + public static function getRandAttr($qualityMeta) { @@ -77,19 +51,7 @@ class HeroQuality { } return $result; } - private static function _getCoefficient($meta,$hero_id,$title){ - if ($meta[$title.'2']){ - $item = explode('|',$meta[$title.'2']); - foreach ($item as $val){ - $item_1 = explode(':',$val); - if ($item_1[0] == $hero_id){ - return $item_1[1]; - } - } - return $meta[$title]; - } - return $meta[$title]; - } + protected static function getMetaList() {