Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb
This commit is contained in:
commit
21a0482018
@ -143,6 +143,7 @@ class BattleController extends BaseAuthedController {
|
||||
}
|
||||
{
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
if (isset($member['weapon_uniid' . $i])) {
|
||||
$gunDb = Gun::findByAccountId($member['account_id'],
|
||||
$member['weapon_uniid' . $i]);
|
||||
if ($gunDb) {
|
||||
@ -151,6 +152,7 @@ class BattleController extends BaseAuthedController {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
array_push($data['members'], $info);
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ class FragmentPool extends BaseModel {
|
||||
self::decNum($fragmentId);
|
||||
return $fragmentId;
|
||||
}
|
||||
return 110101;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -28,6 +29,7 @@ class FragmentPool extends BaseModel {
|
||||
self::decNum($fragmentId);
|
||||
return $fragmentId;
|
||||
}
|
||||
return 110121;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -38,6 +40,7 @@ class FragmentPool extends BaseModel {
|
||||
foreach ($items as $item) {
|
||||
$num += $item['fragment_num'];
|
||||
}
|
||||
return 100;
|
||||
return $num;
|
||||
}
|
||||
|
||||
@ -48,6 +51,7 @@ class FragmentPool extends BaseModel {
|
||||
foreach ($items as $item) {
|
||||
$num += $item['fragment_num'];
|
||||
}
|
||||
return 100;
|
||||
return $num;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -249,7 +249,8 @@ class Item {
|
||||
self::FUNC_TYPE,
|
||||
self::MATERIAL_TYPE,
|
||||
self::FRAGMENT_TYPE,
|
||||
14
|
||||
14,
|
||||
self::FRAGMENT_BOX_TYPE,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,11 @@ require_once('models/RealtimeData.php');
|
||||
|
||||
require_once('services/RankActivityService.php');
|
||||
require_once('services/FormulaService.php');
|
||||
require_once('services/AwardService.php');
|
||||
require_once('services/PropertyChgService.php');
|
||||
|
||||
use mt;
|
||||
use services;
|
||||
use phpcommon\SqlHelper;
|
||||
use models\Season;
|
||||
use models\Battle;
|
||||
@ -52,9 +55,21 @@ class BattleDataService extends BaseService {
|
||||
private $weapon2Dto = null;
|
||||
|
||||
private $reward = array(
|
||||
'hero' => array(),
|
||||
'weapon1' => array(),
|
||||
'weapon2' => array(),
|
||||
'hero' => array(
|
||||
'hero_uniid' => '',
|
||||
'ceg_uplimit' => 0,
|
||||
'obtain_ceg' => 0,
|
||||
),
|
||||
'weapon1' => array(
|
||||
'gun_uniid' => '',
|
||||
'ceg_uplimit' => 0,
|
||||
'obtain_ceg' => 0,
|
||||
),
|
||||
'weapon2' => array(
|
||||
'gun_uniid' => '',
|
||||
'ceg_uplimit' => 0,
|
||||
'obtain_ceg' => 0,
|
||||
),
|
||||
'items' => array()
|
||||
);
|
||||
private $rankActivityService = null;
|
||||
@ -133,7 +148,7 @@ class BattleDataService extends BaseService {
|
||||
case self::MATCH_MODE_PVE:
|
||||
{
|
||||
//pve
|
||||
$this>updatePveData();
|
||||
$this->updatePveData();
|
||||
if ($this->pveGeminiMeta &&
|
||||
$this->pveGeminiMetaMode) {
|
||||
$this->rewardCegPve();
|
||||
@ -477,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(
|
||||
@ -625,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,
|
||||
@ -666,6 +698,7 @@ class BattleDataService extends BaseService {
|
||||
|
||||
private function randWeight($items)
|
||||
{
|
||||
error_log(json_encode($items));
|
||||
$weights = array();
|
||||
{
|
||||
$weight = 0;
|
||||
@ -713,6 +746,8 @@ class BattleDataService extends BaseService {
|
||||
|
||||
private function procDrop($dropIdx)
|
||||
{
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
$awardService = new services\AwardService();
|
||||
$matchMode = getReqVal('match_mode', 0);
|
||||
if ($dropIdx == 0) {
|
||||
$itemId = FragmentPool::dropHero();
|
||||
@ -722,6 +757,15 @@ class BattleDataService extends BaseService {
|
||||
'item_id' => $itemId,
|
||||
'item_num' => 1
|
||||
));
|
||||
myself()->_addItems(
|
||||
array(
|
||||
array(
|
||||
'item_id' => $itemId,
|
||||
'item_num' => 1
|
||||
)),
|
||||
$awardService,
|
||||
$propertyChgService
|
||||
);
|
||||
if ($matchMode == self::MATCH_MODE_PVE) {
|
||||
myself()->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0, 1);
|
||||
} else {
|
||||
@ -736,6 +780,15 @@ class BattleDataService extends BaseService {
|
||||
'item_id' => $itemId,
|
||||
'item_num' => 1
|
||||
));
|
||||
myself()->_addItems(
|
||||
array(
|
||||
array(
|
||||
'item_id' => $itemId,
|
||||
'item_num' => 1
|
||||
)),
|
||||
$awardService,
|
||||
$propertyChgService
|
||||
);
|
||||
if ($matchMode == self::MATCH_MODE_PVE) {
|
||||
myself()->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0, 1);
|
||||
} else {
|
||||
|
@ -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