1
This commit is contained in:
parent
5065b63475
commit
2dd2b5c805
@ -526,6 +526,7 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
|
||||
}
|
||||
level_ = obj.HasKey("level") ? obj.Get("level").GetInt() : 1;
|
||||
skin_id_ = obj.HasKey("hero_skin") ? obj.Get("hero_skin").GetInt() : 0;
|
||||
total_lucky_ = obj.HasKey("total_lucky") ? obj.Get("total_lucky").GetDouble() : 0;
|
||||
if (obj.HasKey("hero_dto") && obj.At("hero_dto")->IsObject()) {
|
||||
hero_dto = obj.At("hero_dto");
|
||||
hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", "");
|
||||
@ -1380,11 +1381,10 @@ bool BattleDataContext::HasWing()
|
||||
|
||||
bool BattleDataContext::HideBigEventBox()
|
||||
{
|
||||
if (owner_.Get()->IsPlayer()) {
|
||||
if (hero_dto) {
|
||||
double lucky = hero_dto->Get("lucky", "");
|
||||
return lucky < 0.1f;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return GetTotalLucky() < 0.01f;
|
||||
}
|
||||
|
||||
float BattleDataContext::GetTotalLucky()
|
||||
{
|
||||
return total_lucky_;
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ struct BattleDataContext
|
||||
int GetBattleTimes();
|
||||
bool HasWing();
|
||||
bool HideBigEventBox();
|
||||
float GetTotalLucky();
|
||||
|
||||
int GetHonor();
|
||||
int GetElo() { return elo_; }
|
||||
@ -110,6 +111,7 @@ private:
|
||||
CreatureWeakPtr owner_;
|
||||
int revive_coin_ = 0;
|
||||
int match_mode_ = 0;
|
||||
float total_lucky_ = 0.0f;
|
||||
|
||||
std::shared_ptr<HeroAbility> hero_ability_;
|
||||
std::shared_ptr<WeaponAbility> weapon1_ability_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user