1
This commit is contained in:
parent
f438e45482
commit
6b76f3d0a7
@ -234,6 +234,7 @@ enum EquipType_e
|
||||
EQUIP_TYPE_CAMOUFLAGE = 11,
|
||||
EQUIP_TYPE_SPOILS = 12,
|
||||
EQUIP_TYPE_SINGAL_EMITTER = 13,
|
||||
EQUIP_TYPE_GIFT_PACKAGE = 14,
|
||||
EQUIP_TYPE_End
|
||||
};
|
||||
|
||||
|
@ -26,6 +26,7 @@ void GameLog::GameStart(Player* hum)
|
||||
prop->SetVal("game_uniid", a8::XValue(hum->room->GetRoomUuid()).GetString());
|
||||
prop->SetVal("room_type", a8::XValue(hum->room->GetRoomType()).GetString());
|
||||
prop->SetVal("room_mode", a8::XValue((int)hum->room->GetRoomMode()));
|
||||
prop->SetVal("hero_id", a8::XValue(hum->meta->i->id()));
|
||||
//prop->SetVal("game_param", "");
|
||||
prop->SetVal("nickname", hum->name);
|
||||
//prop->SetVal("localuuid", "");
|
||||
@ -62,6 +63,7 @@ void GameLog::GameEnd(Player* hum)
|
||||
prop->SetVal("game_uniid", a8::XValue(hum->room->GetRoomUuid()).GetString());
|
||||
prop->SetVal("room_type", a8::XValue(hum->room->GetRoomType()).GetString());
|
||||
prop->SetVal("room_mode", a8::XValue((int)hum->room->GetRoomMode()));
|
||||
prop->SetVal("hero_id", a8::XValue(hum->meta->i->id()));
|
||||
//prop->SetVal("game_param", "");
|
||||
prop->SetVal("game_gold", hum->stats.gold);
|
||||
prop->SetVal("game_score", hum->stats.score);
|
||||
|
@ -1783,6 +1783,7 @@ void Human::GenBattleReportData(a8::MutableXObject* params)
|
||||
params->SetVal("team_mode", GetTeam() && GetTeam()->GetMemberNum() > 1 ? 1 : 0);
|
||||
params->SetVal("map_tpl_name", room->GetMapTplName());
|
||||
params->SetVal("room_uuid", room->GetRoomUuid());
|
||||
params->SetVal("room_mode", room->GetRoomMode());
|
||||
params->SetVal("game_time", time(nullptr)); //?
|
||||
if (!dead) {
|
||||
params->SetVal("alive_time", room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
|
||||
@ -1854,48 +1855,11 @@ void Human::GenBattleReportData(a8::MutableXObject* params)
|
||||
}
|
||||
{
|
||||
std::string items_str;
|
||||
MetaData::RankReward* rank_reward_meta = MetaMgr::Instance()->GetRankReward(rank);
|
||||
#ifdef DEBUG1
|
||||
{
|
||||
#else
|
||||
if (rank_reward_meta && rank_reward_meta->i->drop() > 0) {
|
||||
#endif
|
||||
#ifdef DEBUG1
|
||||
{
|
||||
#else
|
||||
if (rand() % 100 < rank_reward_meta->i->drop()) {
|
||||
#endif
|
||||
MetaData::Equip* item_meta = MetaMgr::Instance()->GetEquip(grow_weapon.weapon_id);
|
||||
if (item_meta) {
|
||||
MetaData::Drop* drop_meta = MetaMgr::Instance()->GetDrop(item_meta->i->drop_id());
|
||||
if (drop_meta) {
|
||||
std::vector<std::tuple<int, int, int>> drop_items;
|
||||
drop_meta->RandItems(drop_items);
|
||||
for (auto& item : drop_items) {
|
||||
int item_id = std::get<0>(item);
|
||||
int item_num = std::get<1>(item);
|
||||
stats.items.push_back(std::make_pair(
|
||||
item_id,
|
||||
item_num
|
||||
));
|
||||
items_str += a8::Format("%d:%d|", {item_id, item_num});
|
||||
#ifdef DEBUG
|
||||
SendDebugMsg
|
||||
(a8::Format("drop weapon_id:%d drop_id:%d item_id:%d item_num:%d",
|
||||
{
|
||||
grow_weapon.weapon_id,
|
||||
item_meta->i->drop_id(),
|
||||
item_id,
|
||||
item_num
|
||||
}));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}//end if rank_reward_meta
|
||||
if (!items_str.empty() && items_str[items_str.size() - 1] == '|') {
|
||||
items_str.erase(items_str.begin() + items_str.size() - 1);
|
||||
for (auto& pair : battlein_items) {
|
||||
items_str += a8::Format("%d:%d|",
|
||||
{pair.first,
|
||||
pair.second
|
||||
});
|
||||
}
|
||||
params->SetVal("items", items_str);
|
||||
}
|
||||
@ -3578,6 +3542,28 @@ void Human::ProcLootSpecItem(AddItemDTO& dto)
|
||||
dto.handled = true;
|
||||
}
|
||||
|
||||
void Human::ProcGiftPackage(AddItemDTO& dto)
|
||||
{
|
||||
if (dto.item_meta->i->equip_type() == EQUIP_TYPE_GIFT_PACKAGE) {
|
||||
MetaData::Drop* drop_meta = MetaMgr::Instance()->GetDrop(dto.item_meta->i->drop_id());
|
||||
if (drop_meta) {
|
||||
std::vector<std::tuple<int, int, int>> drop_items;
|
||||
drop_meta->RandItems(drop_items);
|
||||
for (auto& item : drop_items) {
|
||||
int item_id = std::get<0>(item);
|
||||
int item_num = std::get<1>(item);
|
||||
auto itr = battlein_items.find(item_id);
|
||||
if (itr != battlein_items.end()) {
|
||||
itr->second += item_num;
|
||||
} else {
|
||||
battlein_items[item_id] = item_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dto.handled = true;
|
||||
}
|
||||
|
||||
void Human::ProcLootWeapon(AddItemDTO& dto)
|
||||
{
|
||||
//装备
|
||||
@ -3715,6 +3701,11 @@ void Human::ProcAddItemDto(AddItemDTO& dto)
|
||||
ProcNormalItem(dto);
|
||||
}
|
||||
break;
|
||||
case EQUIP_TYPE_GIFT_PACKAGE:
|
||||
{
|
||||
ProcGiftPackage(dto);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
ProcLootSpecItem(dto);
|
||||
|
@ -181,6 +181,7 @@ class Human : public Creature
|
||||
std::map<int, int> weapon_configs;
|
||||
std::map<int, int> skin_configs;
|
||||
std::map<int, int> spoils_items;
|
||||
std::map<int, int> battlein_items;
|
||||
|
||||
xtimer_list* ad_timer_ = nullptr;
|
||||
Human* last_human_target = nullptr;
|
||||
@ -319,6 +320,7 @@ protected:
|
||||
void ProcSpoils(AddItemDTO& dto);
|
||||
void ProcLootBag(AddItemDTO& dto);
|
||||
void ProcLootProtection(AddItemDTO& dto);
|
||||
void ProcGiftPackage(AddItemDTO& dto);
|
||||
void ProcLootSpecItem(AddItemDTO& dto);
|
||||
void CancelRevive();
|
||||
Weapon* TakeonWeapon(MetaData::Equip* equip_meta);
|
||||
|
@ -471,8 +471,9 @@ void Room::ScatterDrop(a8::Vec2 center, int drop_id)
|
||||
dir.Rotate(a8::RandAngle());
|
||||
DropItemEx(center,
|
||||
center + dir * (5 + rand() % 50),
|
||||
std::get<0>(item), std::get<1>(item),
|
||||
std::get<0>(item),
|
||||
std::get<1>(item),
|
||||
std::get<2>(item),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user