This commit is contained in:
aozhiwei 2024-08-20 15:38:30 +08:00
parent 5065b63475
commit 2dd2b5c805
2 changed files with 9 additions and 7 deletions

View File

@ -526,6 +526,7 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
} }
level_ = obj.HasKey("level") ? obj.Get("level").GetInt() : 1; level_ = obj.HasKey("level") ? obj.Get("level").GetInt() : 1;
skin_id_ = obj.HasKey("hero_skin") ? obj.Get("hero_skin").GetInt() : 0; 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()) { if (obj.HasKey("hero_dto") && obj.At("hero_dto")->IsObject()) {
hero_dto = obj.At("hero_dto"); hero_dto = obj.At("hero_dto");
hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", ""); hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", "");
@ -1380,11 +1381,10 @@ bool BattleDataContext::HasWing()
bool BattleDataContext::HideBigEventBox() bool BattleDataContext::HideBigEventBox()
{ {
if (owner_.Get()->IsPlayer()) { return GetTotalLucky() < 0.01f;
if (hero_dto) { }
double lucky = hero_dto->Get("lucky", "");
return lucky < 0.1f; float BattleDataContext::GetTotalLucky()
} {
} return total_lucky_;
return false;
} }

View File

@ -95,6 +95,7 @@ struct BattleDataContext
int GetBattleTimes(); int GetBattleTimes();
bool HasWing(); bool HasWing();
bool HideBigEventBox(); bool HideBigEventBox();
float GetTotalLucky();
int GetHonor(); int GetHonor();
int GetElo() { return elo_; } int GetElo() { return elo_; }
@ -110,6 +111,7 @@ private:
CreatureWeakPtr owner_; CreatureWeakPtr owner_;
int revive_coin_ = 0; int revive_coin_ = 0;
int match_mode_ = 0; int match_mode_ = 0;
float total_lucky_ = 0.0f;
std::shared_ptr<HeroAbility> hero_ability_; std::shared_ptr<HeroAbility> hero_ability_;
std::shared_ptr<WeaponAbility> weapon1_ability_; std::shared_ptr<WeaponAbility> weapon1_ability_;