1
This commit is contained in:
parent
b52127bdf4
commit
7b877a9193
@ -410,8 +410,9 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleDataContext::GetHeroLvQuality(int& hero_lv, int& quality)
|
||||
void BattleDataContext::GetHeroLvQuality(long long& hero_uniid, int& hero_lv, int& quality)
|
||||
{
|
||||
hero_uniid = 0;
|
||||
hero_lv = 1;
|
||||
quality = 1;
|
||||
if (owner_.Get()->IsPlayer()) {
|
||||
@ -422,8 +423,9 @@ void BattleDataContext::GetHeroLvQuality(int& hero_lv, int& quality)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleDataContext::GetWeaponLvQuality(int& weapon_lv, int& quality)
|
||||
void BattleDataContext::GetWeaponLvQuality(long long& weapon_uniid, int& weapon_lv, int& quality)
|
||||
{
|
||||
weapon_uniid = 0;
|
||||
weapon_lv = 1;
|
||||
quality = 1;
|
||||
if (owner_.Get()->IsPlayer()) {
|
||||
@ -771,9 +773,10 @@ void BattleDataContext::Init(Creature* c)
|
||||
|
||||
void BattleDataContext::GetSkillList(std::vector<int>& skill_list)
|
||||
{
|
||||
long long hero_uniid = 0;
|
||||
int hero_lv = 1;
|
||||
int quality = 1;
|
||||
GetHeroLvQuality(hero_lv, quality);
|
||||
GetHeroLvQuality(hero_uniid, hero_lv, quality);
|
||||
const mt::Skill* skill1 = mt::Skill::GetById(hero_ability_->hero_meta->skill1list());
|
||||
const mt::Skill* skill2 = mt::Skill::GetById(hero_ability_->hero_meta->skill2list());
|
||||
const mt::Skill* skill3 = mt::Skill::GetById(hero_ability_->hero_meta->skill3list());
|
||||
|
@ -41,8 +41,8 @@ struct BattleDataContext
|
||||
|
||||
BattleDataContext();
|
||||
|
||||
void GetHeroLvQuality(int& hero_lv, int& quality);
|
||||
void GetWeaponLvQuality(int& weapon_lv, int& quality);
|
||||
void GetHeroLvQuality(long long& hero_uniid, int& hero_lv, int& quality);
|
||||
void GetWeaponLvQuality(long long& weapon_uniid, int& weapon_lv, int& quality);
|
||||
|
||||
void ParseResult(a8::XObject& obj);
|
||||
|
||||
|
@ -194,7 +194,9 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
}
|
||||
Player* hum = room->NewPlayer();
|
||||
hum->proto_version = msg.proto_version();
|
||||
#if 0
|
||||
hum->hero_uniid = a8::XValue(msg.hero_uniid());
|
||||
#endif
|
||||
hum->battle_uuid = results.at(0)->battle_uuid;
|
||||
hum->is_valid_battle = results.at(0)->is_valid_battle;
|
||||
hum->payload = results.at(0)->payload;
|
||||
@ -211,6 +213,9 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
hum->room = room;
|
||||
hum->SetBattleContext(results.at(0));
|
||||
hum->GetBattleContext()->Init(hum);
|
||||
{
|
||||
|
||||
}
|
||||
room->AddPlayer(hum);
|
||||
hum->ProcSkillList();
|
||||
hum->SetHP(hum->GetBattleContext()->GetMaxHP());
|
||||
|
@ -105,15 +105,17 @@ void PlayerStats::Statement(Human* sender)
|
||||
long long a_value = 0;
|
||||
long long b_value = 0;
|
||||
if (a->GetBattleContext()) {
|
||||
long long hero_uniid = 0;
|
||||
int hero_lv = 0;
|
||||
int quality = 0;
|
||||
a->GetBattleContext()->GetHeroLvQuality(hero_lv, quality);
|
||||
a->GetBattleContext()->GetHeroLvQuality(hero_uniid, hero_lv, quality);
|
||||
a_value = hero_lv + quality;
|
||||
}
|
||||
if (b->GetBattleContext()) {
|
||||
long long hero_uniid = 0;
|
||||
int hero_lv = 0;
|
||||
int quality = 0;
|
||||
b->GetBattleContext()->GetHeroLvQuality(hero_lv, quality);
|
||||
b->GetBattleContext()->GetHeroLvQuality(hero_uniid, hero_lv, quality);
|
||||
b_value = hero_lv + quality;
|
||||
}
|
||||
if (a_value == b_value) {
|
||||
@ -128,9 +130,10 @@ void PlayerStats::Statement(Human* sender)
|
||||
[] (Human* hum)
|
||||
{
|
||||
if (hum->GetBattleContext()) {
|
||||
long long hero_uniid = 0;
|
||||
int hero_lv = 0;
|
||||
int quality = 0;
|
||||
hum->GetBattleContext()->GetHeroLvQuality(hero_lv, quality);
|
||||
hum->GetBattleContext()->GetHeroLvQuality(hero_uniid, hero_lv, quality);
|
||||
return hero_lv + quality > 0;
|
||||
}
|
||||
return false;
|
||||
@ -144,15 +147,17 @@ void PlayerStats::Statement(Human* sender)
|
||||
long long a_value = 0;
|
||||
long long b_value = 0;
|
||||
if (a->GetBattleContext()) {
|
||||
long long weapon_uniid = 0;
|
||||
int weapon_lv = 0;
|
||||
int quality = 0;
|
||||
a->GetBattleContext()->GetWeaponLvQuality(weapon_lv, quality);
|
||||
a->GetBattleContext()->GetWeaponLvQuality(weapon_uniid, weapon_lv, quality);
|
||||
a_value = weapon_lv + quality;
|
||||
}
|
||||
if (b->GetBattleContext()) {
|
||||
long long weapon_uniid = 0;
|
||||
int weapon_lv = 0;
|
||||
int quality = 0;
|
||||
b->GetBattleContext()->GetWeaponLvQuality(weapon_lv, quality);
|
||||
b->GetBattleContext()->GetWeaponLvQuality(weapon_uniid, weapon_lv, quality);
|
||||
b_value = weapon_lv + quality;
|
||||
}
|
||||
if (a_value == b_value) {
|
||||
@ -167,9 +172,10 @@ void PlayerStats::Statement(Human* sender)
|
||||
[] (Human* hum)
|
||||
{
|
||||
if (hum->GetBattleContext()) {
|
||||
long long weapon_uniid = 0;
|
||||
int weapon_lv = 0;
|
||||
int quality = 0;
|
||||
hum->GetBattleContext()->GetWeaponLvQuality(weapon_lv, quality);
|
||||
hum->GetBattleContext()->GetWeaponLvQuality(weapon_uniid, weapon_lv, quality);
|
||||
return weapon_lv + quality > 0;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user