This commit is contained in:
aozhiwei 2022-09-21 16:47:56 +08:00
commit bcfe7d6547
4 changed files with 112 additions and 25 deletions

View File

@ -546,7 +546,9 @@ class ChipController extends BaseAuthedController
// Chip::update($chip['token_id'],['strength'=>$tili]);
// }
// $this->_rspOk();
// $a = mt\Parameter::getByName('CEG_Parameter');
$a =FormulaService::Hero_Parts_Synthetic_Cost();
print_r($a);
}

View File

@ -55,7 +55,7 @@ class FragmentController extends BaseAuthedController
foreach ($itemMetaList as $meta){
array_push($hero,$meta['id']);
}
$mint = \services\FormulaService::Hero_Parts_Synthetic_Cost($this->hero_count);
$mint = strval(\services\FormulaService::Hero_Parts_Synthetic_Cost());
$this->_rspData(array(
'list' => $hero,
'mint' => $mint
@ -69,7 +69,7 @@ class FragmentController extends BaseAuthedController
foreach ($itemMetaList as $meta){
array_push($gun,$meta['id']);
}
$mint = \services\FormulaService::Weapon_Parts_Synthetic_Cost($this->gun_count);
$mint = strval(\services\FormulaService::Weapon_Parts_Synthetic_Cost());
$this->_rspData(array(
'list' => $gun,
'mint' => $mint
@ -129,8 +129,8 @@ class FragmentController extends BaseAuthedController
}
$costItems = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => \services\FormulaService::Hero_Parts_Synthetic_Cost($this->hero_count)
'item_id' => V_ITEM_DIAMOND,
'item_num' => \services\FormulaService::Hero_Parts_Synthetic_Cost()
)
);
$lackItem = null;
@ -170,8 +170,8 @@ class FragmentController extends BaseAuthedController
}
$costItems = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => \services\FormulaService::Hero_Parts_Synthetic_Cost($this->hero_count)
'item_id' => V_ITEM_DIAMOND,
'item_num' => \services\FormulaService::Hero_Parts_Synthetic_Cost()
)
);
$lackItem = null;
@ -234,8 +234,8 @@ class FragmentController extends BaseAuthedController
}
$costItems = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => \services\FormulaService::Weapon_Parts_Synthetic_Cost($this->gun_count)
'item_id' => V_ITEM_DIAMOND,
'item_num' => \services\FormulaService::Weapon_Parts_Synthetic_Cost()
)
);
$lackItem = null;
@ -276,8 +276,8 @@ class FragmentController extends BaseAuthedController
}
$costItems = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => \services\FormulaService::Weapon_Parts_Synthetic_Cost($this->gun_count)
'item_id' => V_ITEM_DIAMOND,
'item_num' => \services\FormulaService::Weapon_Parts_Synthetic_Cost()
)
);
$lackItem = null;

View File

@ -310,7 +310,7 @@ class Chip extends BaseModel
foreach ($chipIdsArr as $val){
$chip = self::getChipByIdx($val);
$lucky = FormulaService::getChipLuckyValue($chip['chip_grade']);
$MaxStrength+=FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength($chip['chip_grade'],$lucky)*FormulaService::Hero_Chip_PSA_Value($chip['chip_grade']);
$MaxStrength+=FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength($chip['chip_grade'],$lucky)*FormulaService::Hero_Chip_PSA_Value($chip['chip_grade'])*FormulaService::Hero_Chip_GAC_PS_Value($chip['chip_grade']);
}
}
break;
@ -318,7 +318,7 @@ class Chip extends BaseModel
foreach ($chipIdsArr as $val){
$chip = self::getChipByIdx($val);
$lucky = FormulaService::getChipLuckyValue($chip['chip_grade']);
$MaxStrength+=FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength($chip['chip_grade'],$lucky)*FormulaService::Weapon_Chip_DA_Value($chip['chip_grade']);
$MaxStrength+=FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength($chip['chip_grade'],$lucky)*FormulaService::Weapon_Chip_DA_Value($chip['chip_grade'])*FormulaService::Weapon_Chip_GAC_PS_Value($chip['chip_grade']);
}
}
break;

View File

@ -306,8 +306,8 @@ class FormulaService extends BaseService {
//每天英雄NFT获得CEG上限值
public static function Hero_Max_CEG($heroDb){
//Hero_Max_CEG=((SIGN(英雄NFT阶数=1)*Hero_NFT_Maximum_Physical_Strength+SIGN(英雄NFT阶数>1)*Hero_Fixed_Physical_Strength)*Hero_PSA_Value+Hero_Chip_NFT_Maximum_Physical_Strength*Hero_PSA_Value)*10*CEG_Discount_Rate
return ((($heroDb['quality']==1?1:0)*self::Hero_NFT_Maximum_Physical_Strength($heroDb['quality'],$heroDb['lucky'])+($heroDb['quality']>1?1:0)*$heroDb['hero_tili'])*self::Hero_PSA_Value($heroDb['quality'])+$heroDb['chip_strength_sum'])*10*self::CEG_Discount_Rate();
//Hero_Max_CEG=((SIGN(英雄NFT阶数=1)*Hero_NFT_Maximum_Physical_Strength+SIGN(英雄NFT阶数>1)*Hero_Fixed_Physical_Strength)*Hero_PSA_Value*GAC_PS_Value+Hero_Chip_NFT_Maximum_Physical_Strength*Hero_Chip_PSA_Value*Hero_Chip_GAC_PS_Value)*10*CEG_Discount_Rate
return ((($heroDb['quality']==1?1:0)*self::Hero_NFT_Maximum_Physical_Strength($heroDb['quality'],$heroDb['lucky'])+($heroDb['quality']>1?1:0)*$heroDb['hero_tili'])*self::Hero_PSA_Value($heroDb['quality'])*self::GAC_PS_Value($heroDb['quality'])+$heroDb['chip_strength_sum'])*10*self::CEG_Discount_Rate();
}
//英雄PVP收益上限
@ -326,8 +326,8 @@ class FormulaService extends BaseService {
//每天枪械NFT获得CEG上限值
public static function Weapon_Max_CEG($weaponDb){
//Weapon_Max_CEG=((SIGN(武器NFT阶数=1)*Weapon_NFT_Maximum_Durability+SIGN(武器NFT阶数>1)*Weapon_Fixed_Durability)*Weapon_DA_Value+Weapon_Chip_NFT_Maximum_Durability*Weapon_Chip_DA_Value)*10*CEG_Discount_Rate
return ((($weaponDb['quality']==1?1:0)*self::Weapon_NFT_Maximum_Durability($weaponDb['quality'],$weaponDb['lucky'])+($weaponDb['quality']>1?1:0)*$weaponDb['durability'])*self::Weapon_DA_Value($weaponDb['quality'])+$weaponDb['chip_strength_sum'])*10*self::CEG_Discount_Rate();
//Weapon_Max_CEG=((SIGN(武器NFT阶数=1)*Weapon_NFT_Maximum_Durability+SIGN(武器NFT阶数>1)*Weapon_Fixed_Durability)*Weapon_DA_Value*GAC_D_Value+Weapon_NFT_Maximum_Durability*Weapon_Chip_DA_Value*Weapon_Chip_GAC_PS_Value)*10*CEG_Discount_Rate
return ((($weaponDb['quality']==1?1:0)*self::Weapon_NFT_Maximum_Durability($weaponDb['quality'],$weaponDb['lucky'])+($weaponDb['quality']>1?1:0)*$weaponDb['durability'])*self::Weapon_DA_Value($weaponDb['quality'])*self::GAC_D_Value($weaponDb['quality'])+$weaponDb['chip_strength_sum'])*10*self::CEG_Discount_Rate();
}
@ -345,16 +345,68 @@ class FormulaService extends BaseService {
return self::Weapon_Max_CEG($weaponDb)*0.35;
}
//CEG动态指数定义公式
public static function CEG_Dynamic_Index(){
//CEG_Dynamic_Index=ROUND(2/(1+EXP(-(CEG_Dynamic_Price/CEG_Base_Price)* CEG_Parameter+ CEG_Parameter)),2)
return round(2/(1+exp(-(self::CEG_Dynamic_Price()/self::CEG_Base_Price())*self::CEG_Parameter()+self::CEG_Parameter())),2);
}
//CEG动态价格
public static function CEG_Dynamic_Price(){
return 1;
}
//CEG调整系数
public static function CEG_Parameter(){
$meta = mt\Parameter::getByName('CEG_Parameter');
return $meta ? $meta['param_value'] : 0.5;
}
//CEG 默认基础价格,配置在全局表中
public static function CEG_Base_Price(){
$meta = mt\Parameter::getByName('CEG_Base_Price');
return $meta ? $meta['param_value'] : 0.1;
}
//CEG折扣比率
public static function CEG_Discount_Rate(){
//CEG_Discount_Rate=ROUND(CEG_Dynamic_Index /( CEG_Dynamic_Price / CEG_Base_Price),3)
return round(self::CEG_Dynamic_Index()/(self::CEG_Dynamic_Price()/self::CEG_Base_Price()),3);
}
//CEC动态指数定义公式
public static function CEC_Dynamic_Index(){
//CEC_Dynamic_Index=ROUND(2/(1+EXP(-(CEC_Dynamic_Price/ CEC_Base_Price)* CEC_Parameter + CEC_Parameter)),2)
return round(2/(1+exp(-(self::CEC_Dynamic_Price()/self::CEC_Base_Price())*self::CEC_Parameter()+self::CEC_Parameter())),2);
}
//CEC动态价格
public static function CEC_Dynamic_Price(){
return 1;
}
//CEC调整系数
public static function CEC_Parameter(){
$meta = mt\Parameter::getByName('CEC_Parameter');
return $meta ? $meta['param_value'] : 1.5;
}
//CEC 默认基础价格,配置在全局表中
public static function CEC_Base_Price(){
$meta = mt\Parameter::getByName('CEC_Base_Price');
return $meta ? $meta['param_value'] : 0.5;
}
//CEC折扣比率
public static function CEC_Discount_Rate(){
//CEC_Discount_Rate=ROUND(CEC_Dynamic_Index /( CEC_Dynamic_Price / CEC_Base_Price),3)
return 1;
return round(self::CEC_Dynamic_Index()/(self::CEC_Dynamic_Price()/self::CEC_Base_Price()),3);
}
//CEC锚定U的价格
public static function CEC_Anchor_Price(){
//CEC_Anchor_Price=ROUND(CEC_Dynamic_Price * CEC_Discount_Rate,3)
return round(self::CEC_Dynamic_Price()*self::CEC_Discount_Rate(),3);
}
//英雄劳力值
@ -369,7 +421,7 @@ class FormulaService extends BaseService {
//英雄芯片劳力值
public static function Hero_Chip_Labor_Value(){
return 1;
return 3;
}
//武器芯片劳力值
@ -540,15 +592,20 @@ class FormulaService extends BaseService {
}
//英雄NFT碎片合成费用
public static function Hero_Parts_Synthetic_Cost($hero_count){
//ROUND(每日新增1阶英雄NFT数量前1天官方商城正价购买*6%,0)*30%*2000*CEG折扣比率
return round($hero_count*0.06,0)*0.3*2000*self::CEG_Discount_Rate();
public static function Hero_Parts_Synthetic_Cost(){
// //ROUND(每日新增1阶英雄NFT数量前1天官方商城正价购买*6%,0)*30%*2000*CEG折扣比率
// return round($hero_count*0.06,0)*0.3*2000*self::CEG_Discount_Rate();
//player碎片合成MINT费用=50%*2000*CEC_Anchor_Price
return 0.5*2000*self::CEC_Anchor_Price();
}
//枪械NFT碎片合成费用
public static function Weapon_Parts_Synthetic_Cost($gun_count){
//ROUND(每日新增1阶枪械NFT数量前1天官方商城正价购买*6%,0)*30%*600*CEG折扣比率
return round($gun_count*0.06,0)*0.3*600*self::CEG_Discount_Rate();
public static function Weapon_Parts_Synthetic_Cost(){
// //ROUND(每日新增1阶枪械NFT数量前1天官方商城正价购买*6%,0)*30%*600*CEG折扣比率
// return round($gun_count*0.06,0)*0.3*600*self::CEG_Discount_Rate();
//equip碎片合成MINT费用=50%*600*CEC_Anchor_Price
return 0.5*600*self::CEC_Anchor_Price();
}
//每日英雄体力值衰减百分比
@ -586,4 +643,32 @@ class FormulaService extends BaseService {
//ROUND(-0.000015*武器阶数^3+0.0008*武器阶数^2-0.02325*武器阶数+0.606,3)
return round(-0.000015*pow($quality,3)+0.0008*pow($quality,2)-0.02325*$quality+0.606,3);
}
//英雄体力值全局衰减系数
public static function GAC_PS_Value($quality){
//GAC_PS_Value=ROUND(MAX(ROUND(2-0.2/30*服务器自然天数,3)/ROUND(1.2+0.0286*(英雄NFT阶数-1),3),1)*MAX(SIGN(服务器自然天数<=180)*1+SIGN(服务器自然天数>180)*99.87%^(服务器自然天数-180),90%),3)
$day = 180;
return round(max(round(2-0.2/30*$day,3)/round(1.2+0.0286*($quality-1),3),1)*max(($day<=180?1:0)*1+($day>180?1:0)*pow(0.9987,$day-180),0.9),3);
}
//武器耐久度全局衰减系数
public static function GAC_D_Value($quality){
//GAC_D_Value=ROUND(MAX(ROUND(2-0.2/30*服务器自然天数,3)/ROUND(1.2+0.0286*(枪械NFT阶数-1),3),1)*MAX(SIGN(服务器自然天数<=180)*1+SIGN(服务器自然天数>180)*99.87%^(服务器自然天数-180),90%),3)
$day = 180;
return round(max(round(2-0.2/30*$day,3)/round(1.2+0.0286*($quality-1),3),1)*max(($day<=180?1:0)*1+($day>180?1:0)*pow(0.9987,$day-180),0.9),3);
}
//英雄芯片体力值全局衰减系数
public static function Hero_Chip_GAC_PS_Value($grand){
//Hero_Chip_GAC_PS_Value=ROUND(MAX(ROUND(2-0.2/30*服务器自然天数,3)/ROUND(1+0.04*芯片星级,3),1)*MAX(SIGN(服务器自然天数<=180)*1+SIGN(服务器自然天数>180)*99.87%^(服务器自然天数-180),90%),3)
$day = 180;
return round(max(round(2-0.2/30*$day,3)/round(1+0.04*$grand,3),1)*max(($day<=180?1:0)*1+($day>180?1:0)*pow(0.9987,$day-180),0.9),3);
}
//武器芯片体力值全局衰减系数
public static function Weapon_Chip_GAC_PS_Value($grand){
//Weapon_Chip_GAC_PS_Value=ROUND(MAX(ROUND(2-0.2/30*服务器自然天数,3)/ROUND(1+0.04*芯片星级,3),1)*MAX(SIGN(服务器自然天数<=180)*1+SIGN(服务器自然天数>180)*99.87%^(服务器自然天数-180),90%),3)
$day = 180;
return round(max(round(2-0.2/30*$day,3)/round(1+0.04*$grand,3),1)*max(($day<=180?1:0)*1+($day>180?1:0)*pow(0.9987,$day-180),0.9),3);
}
}