box reward
This commit is contained in:
parent
6a8d0d5806
commit
69e67f3de6
@ -127,7 +127,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
if ($this->mapMode == mt\MapMode::TREASURE_BOX_MODE && $member['move_distance'] <= 2000 ){
|
if ($this->mapMode == mt\MapMode::TREASURE_BOX_MODE && $member['move_distance'] <= 2000 ){
|
||||||
error_log("金币模式:消极战斗");
|
error_log("金币模式:消极战斗");
|
||||||
}else{
|
}else{
|
||||||
$this->_getBattleRewards($userDb,$heroDb,$battleScore,$myTeamScoreAvg,$myTeamScore,$member['reward']);
|
$this->_getBattleRewards($userDb,$heroDb,$battleScore,$myTeamScoreAvg,$myTeamScore,$member['reward'], $member);
|
||||||
myself()->_addItems($member['reward'], $awardService,$propertyChgService);
|
myself()->_addItems($member['reward'], $awardService,$propertyChgService);
|
||||||
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
||||||
$member['today_hero_battles'] = $heroDb['idx'] . '|' .myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$heroDb['idx']);
|
$member['today_hero_battles'] = $heroDb['idx'] . '|' .myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$heroDb['idx']);
|
||||||
@ -158,7 +158,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _getBattleRewards($userDb,$heroDb,$battleScore,$teamScoreAvg,$teamScore,&$reward){
|
public function _getBattleRewards($userDb,$heroDb,$battleScore,$teamScoreAvg,$teamScore,&$reward, $member){
|
||||||
error_log('settlementReward -> _getBattleRewards');
|
error_log('settlementReward -> _getBattleRewards');
|
||||||
$mapModeMeta = mt\MapMode::findByMapMode($this->mapMode);
|
$mapModeMeta = mt\MapMode::findByMapMode($this->mapMode);
|
||||||
$teamRank = getXVal($this->teamData,'pvp_team_rank', 0);
|
$teamRank = getXVal($this->teamData,'pvp_team_rank', 0);
|
||||||
@ -260,7 +260,8 @@ class RoomBattleDataService extends BaseService {
|
|||||||
//宝箱掉落
|
//宝箱掉落
|
||||||
$chestLootProbArr = explode(";",$rewardMeta['chestLootProb']);
|
$chestLootProbArr = explode(";",$rewardMeta['chestLootProb']);
|
||||||
$rate = isset($chestLootProbArr[$teamRank-1]) ? $chestLootProbArr[$teamRank-1] : 0;
|
$rate = isset($chestLootProbArr[$teamRank-1]) ? $chestLootProbArr[$teamRank-1] : 0;
|
||||||
if ($rate > 0){
|
if ($rate > 0 && !empty($member['box_num'])){
|
||||||
|
for ($i = 0; i < $member['box_num']; ++$i) {
|
||||||
$rand = $rate * 100;
|
$rand = $rate * 100;
|
||||||
$rnd = rand(1,100);
|
$rnd = rand(1,100);
|
||||||
if ($rnd <= $rand){
|
if ($rnd <= $rand){
|
||||||
@ -285,6 +286,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TGLog::writeToLog("game_2006_api","battleReport",array(
|
TGLog::writeToLog("game_2006_api","battleReport",array(
|
||||||
'account_id' => $userDb['account_id'],
|
'account_id' => $userDb['account_id'],
|
||||||
'map_mode' => $this->mapMode,
|
'map_mode' => $this->mapMode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user