每日任务迭代
This commit is contained in:
parent
97c4ab7a66
commit
ed9b26bae7
@ -62,6 +62,7 @@ class MissionController extends BaseAuthedController {
|
||||
$this->missionService->init($this->userInfo, $this->seasonDb);
|
||||
}
|
||||
|
||||
|
||||
public function missionList()
|
||||
{
|
||||
$type = getReqVal('type', 0);
|
||||
@ -79,7 +80,7 @@ class MissionController extends BaseAuthedController {
|
||||
if (in_array($missionMeta['subtype'],
|
||||
array(
|
||||
mt\Task::DAILY_ACTIVE_VALUE_MISSON_SUBTYPE,
|
||||
// mt\Task::WEAKLY_ACTIVE_VALUE_MISSON_SUBTYPE
|
||||
mt\Task::WEAKLY_ACTIVE_VALUE_MISSON_SUBTYPE
|
||||
))) {
|
||||
array_push($missionDtoList1, $missionDto);
|
||||
} else {
|
||||
|
@ -50,7 +50,15 @@ class Task {
|
||||
const T1OTAL_CREATE_OR_JOIN_GUILD_COUNT_COND = 43; //段位达到X且进行Y场比赛
|
||||
const DAILY_ACTIVE_VALUE_COND = 44; //每日活跃度达到X
|
||||
const WEEKLY_ACTIVE_VALUE_COND = 45; //每周活跃度达到X
|
||||
const OFFER_REWARD_COND = 46;
|
||||
const TOTAL_USE_HERO_BATTLE_TIMES_COND = 46; // 使用英雄X进行Y次游戏
|
||||
const TOTAL_USE_HERO_SKILL_TIMES_COND = 47; //使用英雄X的技能Y次
|
||||
const TOTAL_USE_GRENADE_TIMES_COND = 48; //累积使用X次手雷
|
||||
const TOTAL_USE_BURNING_SHOT_TIMES_COND = 49; //累积使用X次燃烧弹
|
||||
const TOTAL_USE_HERO_DAMGE_OUT_COND = 50; // 使用英雄X造成Y点伤害
|
||||
const TOTAL_USE_HERO_WINS_TIMES_COND = 51; // 使用英雄X获得Y次胜利
|
||||
const TOTAL_USE_HERO_KILLS_COND = 52; // 使用英雄X击败Y个敌人
|
||||
const TOTAL_USE_MAP_WINS_TIMES_COND = 53; // 在XX地图获得Y场胜利
|
||||
const OFFER_REWARD_COND = 99;
|
||||
|
||||
const DAILY_MISSON_TYPE = 1;
|
||||
const ACHIEVEMENT_MISSON_TYPE = 2;
|
||||
@ -94,63 +102,44 @@ class Task {
|
||||
public static function getCustomTypeMetaList($type, $missionService)
|
||||
{
|
||||
$metaList = array();
|
||||
if ($type == self::OFFER_REWARD_MISSION_CUSTOM_TYPE) {
|
||||
|
||||
switch ($type){
|
||||
case 0 :{
|
||||
foreach ($missionService->getDailyMissions() as $mission) {
|
||||
$meta = self::get($mission['mission_id']);
|
||||
if ($meta) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
case self::DAILY_MISSON_TYPE : {
|
||||
foreach ($missionService->getDailyMissions() as $mission) {
|
||||
$meta = self::get($mission['mission_id']);
|
||||
if ($meta) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
if ($meta['type'] == self::DAILY_MISSON_TYPE &&
|
||||
in_array($meta['subtype'],
|
||||
array(
|
||||
self::DAILY_ACTIVE_VALUE_MISSON_SUBTYPE,
|
||||
self::WEAKLY_ACTIVE_VALUE_MISSON_SUBTYPE
|
||||
))) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case self::OFFER_REWARD_MISSION_CUSTOM_TYPE:{
|
||||
foreach ($missionService->getOfferRewardMissions() as $mission) {
|
||||
$meta = self::get($mission['mission_id']);
|
||||
if ($meta && $meta['type'] == self::OFFER_REWARD_MISSON_TYPE) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
} else if ($type == self::DAILY_MISSON_TYPE) {
|
||||
foreach ($missionService->getDailyMissions() as $mission) {
|
||||
$meta = self::get($mission['mission_id']);
|
||||
if ($meta) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
if ($meta['type'] == self::DAILY_MISSON_TYPE && $meta['subtype'] == self::DAILY_ACTIVE_VALUE_MISSON_SUBTYPE) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
}else if ($type == 0) {
|
||||
foreach ($missionService->getDailyMissions() as $mission) {
|
||||
$meta = self::get($mission['mission_id']);
|
||||
if ($meta) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
switch ($type) {
|
||||
// case self::DAILY_MISSION_CUSTOM_TYPE:
|
||||
// {
|
||||
// if ($meta['type'] == self::DAILY_MISSON_TYPE) {
|
||||
// array_push($metaList, $meta);
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
case self::SEASON_WEEKLY_MISSION_CUSTOM_TYPE:
|
||||
{
|
||||
if ($meta['type'] == self::SEASONCARD_MISSON_TYPE &&
|
||||
$meta['subtype'] == self::SEASON_WEAKLY_MISSON_SUBTYPE) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case self::ACHIEVEMENT_MISSION_CUSTOM_TYPE:
|
||||
{
|
||||
if ($meta['type'] == self::ACHIEVEMENT_MISSON_TYPE) {
|
||||
array_push($metaList, $meta);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $metaList;
|
||||
}
|
||||
|
@ -174,68 +174,10 @@ class MissionService extends BaseService {
|
||||
$handled = true;
|
||||
|
||||
//统计上一场战斗的数据
|
||||
if ($missionMeta['display']){
|
||||
$missionDto['last_game'] = 0;
|
||||
switch ($missionMeta['condition']) {
|
||||
case mt\Task::DAILY_LOGIN_TIMES_COND:
|
||||
{
|
||||
//进行X场比赛
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_battle_times');
|
||||
$current = $this->getLastGameData('total_battle_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TEAM_BATTLE_RANK_COND:
|
||||
{
|
||||
//组队比赛排名前X次数
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_team_top_X_battle_times');
|
||||
$current = $this->getLastGameData('total_team_top_X_battle_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_KILL_NUM_COND:
|
||||
{
|
||||
//累计击败X个敌人
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_kills_times');
|
||||
$current = $this->getLastGameData('total_kills_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_DAMGE_OUT_COND:
|
||||
{
|
||||
//累计造成X点伤害
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_damage_out');
|
||||
$current = $this->getLastGameData('total_damage_out');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::RESCUE_TEAMMATE_TIMES_COND:
|
||||
{
|
||||
//救援X个队友
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'rescue_teammate_times');
|
||||
$current = $this->getLastGameData('rescue_teammate_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_SURVIVAL_TIME_COND:
|
||||
{
|
||||
//累计生存X分钟
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_alive_time');
|
||||
$current = $this->getLastGameData('total_alive_time');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_SKILL_TIMES_COND:
|
||||
{
|
||||
//累计使用X次角色技能
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'use_skill_times');
|
||||
$current = $this->getLastGameData('use_skill_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->getGameMissionDto($missionDto,$missionMeta,$missionDto);
|
||||
|
||||
$heroBattleInfo = $this->getHeroBattleInfo($missionDb, $missionMeta);
|
||||
switch ($missionMeta['condition']) {
|
||||
case mt\Task::DAILY_LOGIN_TIMES_COND:
|
||||
{
|
||||
@ -531,6 +473,54 @@ class MissionService extends BaseService {
|
||||
$missionDto['current'] = myself()->_getWeeklyV(TN_WEEKLY_ACTIVE, 0);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_BATTLE_TIMES_COND:
|
||||
{
|
||||
//使用英雄X进行Y次游戏
|
||||
$missionDto['current'] = getXVal($heroBattleInfo, "battle_times",0);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_SKILL_TIMES_COND:
|
||||
{
|
||||
//使用英雄X的技能Y次
|
||||
$missionDto['current'] = getXVal($heroBattleInfo, "use_skill_times",0);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_GRENADE_TIMES_COND:
|
||||
{
|
||||
//累积使用X次手雷
|
||||
$missionDto['current'] = $this->getWeaponSlotUseTimes($missionMeta);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_BURNING_SHOT_TIMES_COND:
|
||||
{
|
||||
//累积使用X次燃烧弹
|
||||
$missionDto['current'] = $this->getWeaponSlotUseTimes($missionMeta);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_DAMGE_OUT_COND:
|
||||
{
|
||||
//使用英雄X造成Y点伤害
|
||||
$missionDto['current'] = getXVal($heroBattleInfo, "damage_out",0);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_WINS_TIMES_COND:
|
||||
{
|
||||
//使用英雄X获得Y次胜利
|
||||
$missionDto['current'] = getXVal($heroBattleInfo, "win_times",0);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_KILLS_COND:
|
||||
{
|
||||
//使用英雄X击败Y个敌人
|
||||
$missionDto['current'] = getXVal($heroBattleInfo, "kills_times",0);
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_MAP_WINS_TIMES_COND:
|
||||
{
|
||||
//在XX地图获得Y场胜利
|
||||
$missionDto['current'] = $this->getMapWinsTimes($missionMeta);
|
||||
}
|
||||
break;
|
||||
case mt\Task::OFFER_REWARD_COND:
|
||||
{
|
||||
$this->getOfferRewardMissionInfo($missionDto, $missionMeta);
|
||||
@ -553,6 +543,145 @@ class MissionService extends BaseService {
|
||||
return $missionDto;
|
||||
}
|
||||
|
||||
private function getGameMissionDto($missionDb, $missionMeta,&$missionDto){
|
||||
// if ($missionMeta['id'] == 71041){
|
||||
// $heroBattleInfo = $this->getHeroBattleInfo($missionDb, $missionMeta);
|
||||
// $lastGameHeroBattleInfo = $this->getLastGameHeroBattleInfo($missionDb, $missionMeta);
|
||||
// print_r($lastGameHeroBattleInfo);die;
|
||||
// }
|
||||
if ($missionMeta['display']){
|
||||
$missionDto['last_game'] = 0;
|
||||
$heroBattleInfo = $this->getHeroBattleInfo($missionDb, $missionMeta);
|
||||
$lastGameHeroBattleInfo = $this->getLastGameHeroBattleInfo($missionDb, $missionMeta);
|
||||
switch ($missionMeta['condition']) {
|
||||
case mt\Task::DAILY_LOGIN_TIMES_COND:
|
||||
{
|
||||
//进行X场比赛
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_battle_times');
|
||||
$current = $this->getLastGameData('total_battle_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TEAM_BATTLE_RANK_COND:
|
||||
{
|
||||
//组队比赛排名前X次数
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_team_top_X_battle_times');
|
||||
$current = $this->getLastGameData('total_team_top_X_battle_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_KILL_NUM_COND:
|
||||
{
|
||||
//累计击败X个敌人
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_kills_times');
|
||||
$current = $this->getLastGameData('total_kills_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_DAMGE_OUT_COND:
|
||||
{
|
||||
//累计造成X点伤害
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_damage_out');
|
||||
$current = $this->getLastGameData('total_damage_out');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::RESCUE_TEAMMATE_TIMES_COND:
|
||||
{
|
||||
//救援X个队友
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'rescue_teammate_times');
|
||||
$current = $this->getLastGameData('rescue_teammate_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_SURVIVAL_TIME_COND:
|
||||
{
|
||||
//累计生存X分钟
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'total_alive_time');
|
||||
$current = $this->getLastGameData('total_alive_time');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_SKILL_TIMES_COND:
|
||||
{
|
||||
//累计使用X次角色技能
|
||||
$total = $this->getBattleData($missionDb, $missionMeta, 'use_skill_times');
|
||||
$current = $this->getLastGameData('use_skill_times');
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_BATTLE_TIMES_COND:
|
||||
{
|
||||
//使用英雄X进行Y次游戏
|
||||
$total = getXVal($heroBattleInfo, "battle_times",0);
|
||||
$current = getXVal($lastGameHeroBattleInfo, "battle_times",0);
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_SKILL_TIMES_COND:
|
||||
{
|
||||
//使用英雄X的技能Y次
|
||||
$total = getXVal($heroBattleInfo, "use_skill_times",0);
|
||||
$current = getXVal($lastGameHeroBattleInfo, "use_skill_times",0);
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_GRENADE_TIMES_COND:
|
||||
{
|
||||
//累积使用X次手雷
|
||||
$total = $this->getWeaponSlotUseTimes($missionMeta);
|
||||
$current = $this->getLastGameParamTimes($missionMeta,"weapons_slot_data");
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_BURNING_SHOT_TIMES_COND:
|
||||
{
|
||||
//累积使用X次燃烧弹
|
||||
$total = $this->getWeaponSlotUseTimes($missionMeta);
|
||||
$current = $this->getLastGameParamTimes($missionMeta,"weapons_slot_data");
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_DAMGE_OUT_COND:
|
||||
{
|
||||
//使用英雄X造成Y点伤害
|
||||
$total = getXVal($heroBattleInfo, "damage_out",0);
|
||||
$current = getXVal($lastGameHeroBattleInfo, "damage_out",0);
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_WINS_TIMES_COND:
|
||||
{
|
||||
//使用英雄X获得Y次胜利
|
||||
$total = getXVal($heroBattleInfo, "win_times",0);
|
||||
$current = getXVal($lastGameHeroBattleInfo, "win_times",0);
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_HERO_KILLS_COND:
|
||||
{
|
||||
//使用英雄X击败Y个敌人
|
||||
$total = getXVal($heroBattleInfo, "kills_times",0);
|
||||
$current = getXVal($lastGameHeroBattleInfo, "kills_times",0);
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
|
||||
}
|
||||
break;
|
||||
case mt\Task::TOTAL_USE_MAP_WINS_TIMES_COND:
|
||||
{
|
||||
//在XX地图获得Y场胜利
|
||||
$total = $this->getMapWinsTimes($missionMeta);
|
||||
$current = $this->getLastGameParamTimes($missionMeta,"total_map_win_times");
|
||||
$missionDto['last_game'] = $this->celRealityDto($total,$missionMeta['target'],$current) ;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getLastGameData($key){
|
||||
$battleData = $this->lastGameBattleData;
|
||||
$val = getXVal($battleData, $key, 0);
|
||||
@ -597,6 +726,17 @@ class MissionService extends BaseService {
|
||||
return $battleData ? $battleData : array();
|
||||
}
|
||||
|
||||
private function getMapWinsTimes($missionMeta){
|
||||
$val = 0;
|
||||
$battleData = $this->internalGetBattleData($missionMeta);
|
||||
$mapData = getXVal($battleData, 'total_map_win_times', null);
|
||||
if ($mapData) {
|
||||
$key = $missionMeta['param1'];
|
||||
$val = getXVal($mapData, $key, 0);
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
private function getWeaponDamageOut($missionMeta)
|
||||
{
|
||||
$val = 0;
|
||||
@ -631,13 +771,10 @@ class MissionService extends BaseService {
|
||||
{
|
||||
$val = 0;
|
||||
$battleData = $this->internalGetBattleData($missionMeta);
|
||||
$weaponData = getXVal($battleData, 'weapon_slot_data', null);
|
||||
$weaponData = getXVal($battleData, 'weapons_slot_data', null);
|
||||
if ($weaponData) {
|
||||
$key = $missionMeta['param1'];
|
||||
$data = getXVal($weaponData, $key, null);
|
||||
if ($data) {
|
||||
$val = getXVal($data, 'use_times', 0);
|
||||
}
|
||||
$val = getXVal($weaponData, $key, null);
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
@ -673,6 +810,40 @@ class MissionService extends BaseService {
|
||||
return $val;
|
||||
}
|
||||
|
||||
private function getHeroBattleInfo($missionDb, $missionMeta){
|
||||
$data = array();
|
||||
$battleData = $this->internalGetBattleData($missionMeta);
|
||||
$heroBattleInfo = getXVal($battleData, 'hero_info', null);
|
||||
if ($heroBattleInfo){
|
||||
$key = $missionMeta['param1'];
|
||||
$data = getXVal($heroBattleInfo, $key, array());
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function getLastGameHeroBattleInfo($missionDb, $missionMeta){
|
||||
$data = array();
|
||||
$battleData = $this->lastGameBattleData;
|
||||
$heroBattleInfo = getXVal($battleData, "hero_info", null);
|
||||
if ($heroBattleInfo){
|
||||
$key = $missionMeta['param1'];
|
||||
$data = getXVal($heroBattleInfo, $key, array());
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function getLastGameParamTimes($missionMeta,$key){
|
||||
$val = 0;
|
||||
$battleData = $this->lastGameBattleData;
|
||||
$mapData = getXVal($battleData, $key, null);
|
||||
if ($mapData) {
|
||||
$key = $missionMeta['param1'];
|
||||
$val = getXVal($mapData, $key, 0);
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
private function getMissionV($missionMeta, $dailyX, $weeklyX, $hisX, $y)
|
||||
{
|
||||
if ($missionMeta['type'] == mt\Task::DAILY_MISSON_TYPE) {
|
||||
|
@ -1005,11 +1005,19 @@ class TameBattleDataService extends BaseService {
|
||||
$this->incValue($battleData, 'total_team_top_X_battle_times', 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($battleData['total_map_win_times'])) {
|
||||
$battleData['total_map_win_times'] = array();
|
||||
}
|
||||
$mapId = getXVal($this->allInfo,'map_id', 0);
|
||||
|
||||
//排名
|
||||
$ranked = getXVal($this->battleInfo,'pvp_team_rank', 0);
|
||||
if ($ranked == 1) {
|
||||
//吃鸡次数
|
||||
$this->incValue($battleData, 'total_win_times', 1);
|
||||
//地图吃鸡数
|
||||
$this->incValue($battleData['total_map_win_times'], $mapId, 1);
|
||||
}
|
||||
if ($ranked <= 3 && $ranked>0){
|
||||
//排名前十 总次数
|
||||
@ -1055,6 +1063,7 @@ class TameBattleDataService extends BaseService {
|
||||
//单局最大存活时间
|
||||
$this->maxValue($battleData, 'max_alive_time', $aliveTime);
|
||||
}
|
||||
|
||||
//救援次数
|
||||
$this->incValue($battleData, 'rescue_teammate_times', getXVal($this->battleInfo,'rescue_teammate_times', 0));
|
||||
//潜水次数
|
||||
@ -1126,16 +1135,12 @@ class TameBattleDataService extends BaseService {
|
||||
$tmpStrs1 = explode('|', getXVal($this->battleInfo,'weapons_slot', ''));
|
||||
foreach ($tmpStrs1 as $str) {
|
||||
$tmpStrs2 = explode(':', $str);
|
||||
if (count($tmpStrs2) >= 4) {
|
||||
if (count($tmpStrs2) >= 2) {
|
||||
list($weaponId, $use_times) = $tmpStrs2;
|
||||
$weaponMeta = mt\Equip::get($weaponId);
|
||||
if ($weaponMeta && $weaponMeta['inventory_slot'] > 0) {
|
||||
$key = $weaponMeta['inventory_slot'];
|
||||
if (!isset($weaponsSlotDb[$key])) {
|
||||
$weaponsSlotDb[$key] = array();
|
||||
}
|
||||
//使用次数
|
||||
$this->incValue($weaponsSlotDb, 'use_times', $use_times);
|
||||
$this->incValue($weaponsSlotDb, $weaponId, $use_times);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1175,37 +1180,27 @@ class TameBattleDataService extends BaseService {
|
||||
$battleData['hero_info'] = array();
|
||||
}
|
||||
$heroInfo = &$battleData['hero_info'];
|
||||
{
|
||||
$hero_uniid = getXVal($this->battleInfo,'hero_uniid', '');
|
||||
$hero = Hero::find($hero_uniid);
|
||||
if ($hero){
|
||||
if (!isset($heroInfo[$hero['hero_id']])){
|
||||
$heroInfo[$hero['hero_id']] = array();
|
||||
$heroId = $this->heroDto['hero_id'];
|
||||
if (!isset($heroInfo[$heroId])){
|
||||
$heroInfo[$heroId] = array();
|
||||
}
|
||||
$this->incValue($heroInfo[$hero['hero_id']], "use_times", 1); //每个英雄使用次数
|
||||
$this->incValue($heroInfo[$heroId], "battle_times", 1); //英雄使用次数
|
||||
$ranked = getXVal($this->battleInfo,'pvp_team_rank', 0);
|
||||
if ($ranked == 1) {
|
||||
//吃鸡次数
|
||||
$this->incValue($heroInfo[$hero['hero_id']], 'win_times', 1);//使用该英雄吃鸡获胜次数
|
||||
}
|
||||
if ($ranked <= 10){
|
||||
//排名前十 总次数
|
||||
$this->incValue($heroInfo[$hero['hero_id']], 'top_ten_times', 1);//使用该英雄进前十次数
|
||||
}
|
||||
if (!isset($heroInfo[$hero['hero_id']]['weapon'])){
|
||||
$heroInfo[$hero['hero_id']]['weapon'] = array();
|
||||
}
|
||||
$weapon_uuid1 = getXVal($this->battleInfo,'weapon_uuid1', 0);
|
||||
$weapon1 = Gun::find($weapon_uuid1);
|
||||
if ($weapon1){
|
||||
$this->incValue($heroInfo[$hero['hero_id']]['weapon'], $weapon1['gun_id'], 1);//该英雄下选用每个武器的次数
|
||||
}
|
||||
$weapon_uuid2 = getXVal($this->battleInfo,'weapon_uuid2', 0);
|
||||
$weapon2 = Gun::find($weapon_uuid2);
|
||||
if ($weapon2){
|
||||
$this->incValue($heroInfo[$hero['hero_id']]['weapon'], $weapon2['gun_id'], 1);//该英雄下选用每个武器的次数
|
||||
$this->incValue($heroInfo[$heroId], 'win_times', 1);//英雄吃鸡获胜次数
|
||||
}
|
||||
//英雄释放技能数
|
||||
$this->incValue($heroInfo[$heroId], 'use_skill_times', getXVal($this->battleInfo,'use_skill_times', 0));
|
||||
//英雄击杀次数
|
||||
$kills = getXVal($this->battleInfo,'kills', 0);
|
||||
if ($kills > 0) {
|
||||
$this->incValue($heroInfo[$heroId], 'kills_times', $kills);
|
||||
}
|
||||
//英雄输出
|
||||
$damageOut = getXVal($this->battleInfo,'damage_out', 0);
|
||||
if ($damageOut > 0) {
|
||||
$this->incValue($heroInfo[$heroId], 'damage_out', $damageOut);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user