1
This commit is contained in:
parent
0a1ac2342d
commit
27f73b2c30
@ -143,10 +143,12 @@ class BattleController extends BaseAuthedController {
|
||||
}
|
||||
{
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
$gunDb = Gun::findByAccountId($member['account_id'],
|
||||
$member['weapon_uniid' . $i]);
|
||||
if ($gunDb) {
|
||||
$info['weapon_dto' . $i] = Gun::toDto($gunDb);
|
||||
if (isset($member['weapon_uniid' . $i])) {
|
||||
$gunDb = Gun::findByAccountId($member['account_id'],
|
||||
$member['weapon_uniid' . $i]);
|
||||
if ($gunDb) {
|
||||
$info['weapon_dto' . $i] = Gun::toDto($gunDb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ class Hero extends BaseModel {
|
||||
return $finalyAddGold;
|
||||
}
|
||||
|
||||
public static function gainGoldPve($heroDto, $count)
|
||||
public static function gainGoldPve($heroDto, $addGold)
|
||||
{
|
||||
$newGold = min($heroDto['pve_ceg_uplimit'],
|
||||
$heroDto['current_pve_get_ceg'] + $addGold);
|
||||
|
@ -492,15 +492,20 @@ class BattleDataService extends BaseService {
|
||||
$userInfo = myself()->_getOrmUserInfo();
|
||||
$this->pveGeminiMeta = mt\PveGemini::get($instanceId);
|
||||
if ($this->pveGeminiMeta) {
|
||||
if (!($userInfo['pve_instance_id'] == $instanceId ||
|
||||
$userInfo['pve_instance_id'] == $instanceId + 1)) {
|
||||
if (!(
|
||||
$instanceId == mt\PveGemini::FIRST_INSTANCE_ID ||
|
||||
$userInfo['pve_instance_id'] == $instanceId ||
|
||||
$userInfo['pve_instance_id'] == $instanceId + 1)
|
||||
) {
|
||||
$this->pveGeminiMeta = null;
|
||||
}
|
||||
}
|
||||
error_log(json_encode($this->pveGeminiMeta));
|
||||
$this->pveGeminiMetaMode = mt\PveGeminiMode::get($instanceMode);
|
||||
if ($this->pveGeminiModeMeta) {
|
||||
$this->instanceRank = mt\PveGeminiMode::calcStar($this->pveGeminiModeMeta, $pveRankScore);
|
||||
}
|
||||
error_log(json_encode($this->pveGeminiMetaMode));
|
||||
if (getReqVal('pve_kill_boss', 0) == 1) {
|
||||
if ($this->pveGeminiMeta) {
|
||||
myself()->_updateUserInfo(array(
|
||||
@ -640,16 +645,28 @@ class BattleDataService extends BaseService {
|
||||
private function rewardCegPve()
|
||||
{
|
||||
$instanceLevel = $this->pveGeminiMeta['gemini_lv'];
|
||||
$bossReward = getReqVal(pve_kill_boss) ? 1 : 0;
|
||||
$bossReward = getReqVal('pve_kill_boss', 0) ? 1 : 0;
|
||||
|
||||
$heroPveCeg = FormulaService::calcHeroPveCeg($this->heroDto, $instanceLevel, $instanceRank, $bossReward);
|
||||
$heroPveCeg = FormulaService::calcHeroPveCeg(
|
||||
$this->heroDto,
|
||||
$instanceLevel,
|
||||
$this->instanceRank,
|
||||
$bossReward);
|
||||
$weaponPveCeg1 = 0;
|
||||
$weaponPveCeg2 = 0;
|
||||
if ($this->weapon1Dto) {
|
||||
$weaponPveCeg1 = FormulaService::calcWeaponPveCeg($this->weapon1Dto, $instanceLevel, $instanceRank, $bossReward);
|
||||
$weaponPveCeg1 = FormulaService::calcWeaponPveCeg(
|
||||
$this->weapon1Dto,
|
||||
$instanceLevel,
|
||||
$this->instanceRank,
|
||||
$bossReward);
|
||||
}
|
||||
if ($this->weapon2Dto) {
|
||||
$weaponPveCeg2 = FormulaService::calcWeaponPveCeg($this->weapon2Dto, $instanceLevel, $instanceRank, $bossReward);
|
||||
$weaponPveCeg2 = FormulaService::calcWeaponPveCeg(
|
||||
$this->weapon2Dto,
|
||||
$instanceLevel,
|
||||
$this->instanceRank,
|
||||
$bossReward);
|
||||
}
|
||||
error_log(json_encode(array(
|
||||
'heroPveCeg' => $heroPveCeg,
|
||||
|
@ -53,7 +53,7 @@ class FormulaService extends BaseService {
|
||||
(0.8 - ($instanceRank - 1) * 0.25 + $bossReward * 0.2) *
|
||||
1/10;
|
||||
|
||||
return round(ceg);
|
||||
return round($ceg);
|
||||
}
|
||||
|
||||
public static function calcWeaponPvpCeg($weaponDto, $params)
|
||||
@ -153,7 +153,7 @@ class FormulaService extends BaseService {
|
||||
public static function calcHeroFragmentProbabilityPve($heroQuality,
|
||||
$onlineNum,
|
||||
$heroFragmentNum,
|
||||
$todayPvpBattleTimes,
|
||||
$todayPveBattleTimes,
|
||||
$instanceLevel,
|
||||
$instanceRank,
|
||||
$instanceRankRate,
|
||||
@ -172,7 +172,7 @@ class FormulaService extends BaseService {
|
||||
public static function calcWeaponFragmentProbabilityPve($heroQuality,
|
||||
$onlineNum,
|
||||
$gunFragmentNum,
|
||||
$todayPvpBattleTimes,
|
||||
$todayPveBattleTimes,
|
||||
$instanceLevel,
|
||||
$instanceRank,
|
||||
$instanceRankRate,
|
||||
|
Loading…
x
Reference in New Issue
Block a user