This commit is contained in:
aozhiwei 2022-05-24 08:23:40 +08:00
parent e440ba7d21
commit 71e08d66ae
3 changed files with 24 additions and 0 deletions

View File

@ -307,6 +307,7 @@ private:
CreatureWeakPtrChunk weak_ptr_chunk_; CreatureWeakPtrChunk weak_ptr_chunk_;
HumanAbility ability; HumanAbility ability;
std::shared_ptr<Ability> ability_; std::shared_ptr<Ability> ability_;
std::shared_ptr<BattleDataContext> battle_context_;
int buff_uniid_ = 1000; int buff_uniid_ = 1000;
std::array<list_head, kBET_End> buff_effect_ = {}; std::array<list_head, kBET_End> buff_effect_ = {};
std::array<list_head, kBET_End> depend_effect_ = {}; std::array<list_head, kBET_End> depend_effect_ = {};

View File

@ -17,3 +17,19 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
weapon_dto2 = obj.At("weapon_dto2"); weapon_dto2 = obj.At("weapon_dto2");
} }
} }
float BattleDataContext::GetAttrAbs(int attr_id)
{
if (IsValidHumanAttr(attr_id)) {
return attr_abs_[attr_id];
}
return 0;
}
float BattleDataContext::GetAttrRate(int attr_id)
{
if (IsValidHumanAttr(attr_id)) {
return attr_rate_[attr_id];
}
return 0;
}

View File

@ -34,4 +34,11 @@ struct BattleDataContext
std::shared_ptr<a8::XObject> weapon_dto2; std::shared_ptr<a8::XObject> weapon_dto2;
void ParseResult(a8::XObject& obj); void ParseResult(a8::XObject& obj);
float GetAttrAbs(int attr_id);
float GetAttrRate(int attr_id);
private:
std::array<float, kHAT_End> attr_abs_ = {};
std::array<float, kHAT_End> attr_rate_ = {};
}; };