1
This commit is contained in:
parent
efa7ec98af
commit
092ed238cf
@ -17,6 +17,7 @@ require_once('services/BattleDataService.php');
|
||||
require_once('services/TameBattleDataService.php');
|
||||
require_once('services/FormulaService.php');
|
||||
require_once('mt/RankSeason.php');
|
||||
require_once('mt/ServerTask.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use models\Hero;
|
||||
@ -126,11 +127,32 @@ class BattleController extends BaseAuthedController {
|
||||
// $ranked = getReqVal('pvp_personal_rank', 0);
|
||||
$teamBattleDataService = new services\TameBattleDataService();
|
||||
$teamBattleDataService->calStarNum();
|
||||
$item = array(
|
||||
"item_id" => 300001,
|
||||
"item_num" => 1,
|
||||
);
|
||||
Bag::addItem($item['item_id'],$item['item_num']);
|
||||
$mode = getReqVal('room_mode', 0);
|
||||
$status = myself()->_getV(TN_SERVER_TASK_STATE,0);
|
||||
$item = array();
|
||||
switch ($status){
|
||||
case \mt\ServerTask::ACCOMPLISH_MOBA_STATE :{
|
||||
if ($mode == \services\TameBattleDataService::ROOM_MODE_PVP){
|
||||
$item = array(
|
||||
"item_id" => 300001,
|
||||
"item_num" => 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case \mt\ServerTask::ACCOMPLISH_PVP_STATE : {
|
||||
if ($mode == \services\TameBattleDataService::ROOM_MODE_MOBA){
|
||||
$item = array(
|
||||
"item_id" => 300001,
|
||||
"item_num" => 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ($item){
|
||||
Bag::addItem($item['item_id'],$item['item_num']);
|
||||
}
|
||||
$this->_rspData($item);
|
||||
}
|
||||
|
||||
|
@ -39,17 +39,13 @@ class FragmentController extends BaseAuthedController
|
||||
Bag::decItem($itemId,$pieceNum);
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
$propertyChgService->addBagChg();
|
||||
$Info = array();
|
||||
|
||||
if ($itemMeta['sub_type'] == \mt\Item::HERO_FRAGMENT_SUBTYPE){
|
||||
Hero::addFreeHero($itemMetaDto);
|
||||
// $heroIdx = SqlHelper::getLastInsertId($this->_getSelfMysql());
|
||||
// $Info = Hero::toDto(Hero::find($heroIdx));
|
||||
Hero::addSyntheticHero($itemMetaDto,$itemMeta['quality']);
|
||||
$propertyChgService->addHeroChg();
|
||||
}
|
||||
if ($itemMeta['sub_type'] == \mt\Item::CHIP_FRAGMENT_SUBTYPE){
|
||||
Chip::addFreeChip($itemMetaDto);
|
||||
// $chipIdx = SqlHelper::getLastInsertId($this->_getSelfMysql());
|
||||
// $Info = Chip::toDto(Chip::find($chipIdx));
|
||||
Chip::addSyntheticChip($itemMetaDto,$itemMeta['quality']);
|
||||
$propertyChgService->addChip();
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,19 @@ class Chip extends BaseModel
|
||||
self::GETED_STATE);
|
||||
}
|
||||
|
||||
public static function internalAddItem($conn, $itemMeta, $accountId, $tokenId,$state)
|
||||
public static function addSyntheticChip($itemMeta,$quality)
|
||||
{
|
||||
|
||||
return self::internalAddItem(
|
||||
myself()->_getSelfMysql(),
|
||||
$itemMeta,
|
||||
myself()->_getAccountId(),
|
||||
null,
|
||||
self::FREE_STATE,
|
||||
$quality);
|
||||
}
|
||||
|
||||
public static function internalAddItem($conn, $itemMeta, $accountId, $tokenId,$state,$quality=1)
|
||||
{
|
||||
|
||||
$randAttr = array();
|
||||
@ -242,7 +254,7 @@ class Chip extends BaseModel
|
||||
'chip_grade' => 1,
|
||||
'chip_type' => $itemMeta['sub_type'],
|
||||
'activate' => 1,
|
||||
'quality' => 1,
|
||||
'quality' => $quality,
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
);
|
||||
|
@ -385,7 +385,18 @@ class Hero extends BaseModel {
|
||||
self::GETED_STATE);
|
||||
}
|
||||
|
||||
public static function internalAddHero($conn, $heroMeta, $accountId, $tokenId,$type)
|
||||
//添加合成英雄
|
||||
public static function addSyntheticHero($heroMeta,$quality){
|
||||
return self::internalAddHero(
|
||||
myself()->_getSelfMysql(),
|
||||
$heroMeta,
|
||||
myself()->_getAccountId(),
|
||||
null,
|
||||
self::TYPE_FREE,
|
||||
$quality );
|
||||
}
|
||||
|
||||
public static function internalAddHero($conn, $heroMeta, $accountId, $tokenId,$type,$quality = 1)
|
||||
{
|
||||
$skinItemMeta = \mt\Item::getMetaListByType(\mt\Item::HERO_SKIN_TYPE);
|
||||
if ($skinItemMeta){
|
||||
@ -401,7 +412,7 @@ class Hero extends BaseModel {
|
||||
$fieldsKv = array(
|
||||
'hero_id' => $heroMeta['id'],
|
||||
'hero_lv' => 1,
|
||||
'quality' => 1,
|
||||
'quality' => $quality,
|
||||
// 'hero_tili' => FormulaService::Hero_NFT_Maximum_Physical_Strength(1,FormulaService::Hero_Advanced_Lucky_Value(1)),
|
||||
'state' => $state,
|
||||
'skill_lv1' => 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user