1
This commit is contained in:
parent
2da4f25521
commit
7b54c6acb2
@ -657,28 +657,6 @@ void Creature::ClearBuffList()
|
|||||||
RecalcBuffAttr();
|
RecalcBuffAttr();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 222
|
|
||||||
#if 0
|
|
||||||
void Creature::FillBuffList(Human* hum, ::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list)
|
|
||||||
{
|
|
||||||
for (auto& itr : buff_list_) {
|
|
||||||
if (itr.NeedSync(hum)) {
|
|
||||||
auto buff = pb_buff_list->Add();
|
|
||||||
itr.FillMFBuff(buff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Creature::FillSkillList(::google::protobuf::RepeatedPtrField< cs::MFSkill >*
|
|
||||||
pb_skill_list)
|
|
||||||
{
|
|
||||||
for (auto& pair : skill_hash_) {
|
|
||||||
auto skill = pb_skill_list->Add();
|
|
||||||
pair.second->FillMFSkill(skill);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Creature::AddPassiveSkill(int skill_id)
|
void Creature::AddPassiveSkill(int skill_id)
|
||||||
{
|
{
|
||||||
const mt::Skill* skill_meta = mt::Skill::GetById(skill_id);
|
const mt::Skill* skill_meta = mt::Skill::GetById(skill_id);
|
||||||
@ -2796,6 +2774,17 @@ void Creature::TraverseBuff(std::function<void (Buff*, bool&)> func)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::TraverseSkill(std::function<void (Skill*, bool&)> func)
|
||||||
|
{
|
||||||
|
bool stop = false;
|
||||||
|
for (auto& pair : skill_hash_) {
|
||||||
|
func(pair.second, stop);
|
||||||
|
if (stop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Creature::TrySummonHero(const mt::Hero* hero_meta, glm::vec3 dir, Position born_pos, bool through_wall)
|
bool Creature::TrySummonHero(const mt::Hero* hero_meta, glm::vec3 dir, Position born_pos, bool through_wall)
|
||||||
{
|
{
|
||||||
AabbCollider collider;
|
AabbCollider collider;
|
||||||
|
@ -154,11 +154,6 @@ class Creature : public MoveableEntity
|
|||||||
void RecalcBuffAttr();
|
void RecalcBuffAttr();
|
||||||
void RemoveBuffByEffectId(int buff_effect_id);
|
void RemoveBuffByEffectId(int buff_effect_id);
|
||||||
void ClearBuffList();
|
void ClearBuffList();
|
||||||
// 222
|
|
||||||
#if 0
|
|
||||||
void FillBuffList(Human* hum, ::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list);
|
|
||||||
void FillSkillList(::google::protobuf::RepeatedPtrField< cs::MFSkill >* pb_skill_list);
|
|
||||||
#endif
|
|
||||||
void TriggerBuff(Skill* skill, std::set<Creature*>& target_list, BuffTriggerType_e trigger_type);
|
void TriggerBuff(Skill* skill, std::set<Creature*>& target_list, BuffTriggerType_e trigger_type);
|
||||||
Skill* GetSkill(int skill_id);
|
Skill* GetSkill(int skill_id);
|
||||||
int GetSkillTargetId() { return skill_target_id_; };
|
int GetSkillTargetId() { return skill_target_id_; };
|
||||||
@ -261,6 +256,7 @@ class Creature : public MoveableEntity
|
|||||||
void SetBattleContext(std::shared_ptr<BattleDataContext> c);
|
void SetBattleContext(std::shared_ptr<BattleDataContext> c);
|
||||||
void RefreshHP();
|
void RefreshHP();
|
||||||
void TraverseBuff(std::function<void (Buff*, bool&)> func);
|
void TraverseBuff(std::function<void (Buff*, bool&)> func);
|
||||||
|
void TraverseSkill(std::function<void (Skill*, bool&)> func);
|
||||||
long long GetCollisionTimes() { return collision_times_; };
|
long long GetCollisionTimes() { return collision_times_; };
|
||||||
std::string DebugOutBuffList();
|
std::string DebugOutBuffList();
|
||||||
bool CanFollow(Creature* follower);
|
bool CanFollow(Creature* follower);
|
||||||
|
@ -36,6 +36,30 @@
|
|||||||
#include "mt/PveGeminiMode.h"
|
#include "mt/PveGeminiMode.h"
|
||||||
#include "mt/PveGeminiContent.h"
|
#include "mt/PveGeminiContent.h"
|
||||||
|
|
||||||
|
static void Creature_FillBuffList(Creature* self, Human* hum, ::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list)
|
||||||
|
{
|
||||||
|
self->TraverseBuff
|
||||||
|
(
|
||||||
|
[hum, pb_buff_list] (Buff* buff, bool& stop)
|
||||||
|
{
|
||||||
|
if (buff->NeedSync(hum)) {
|
||||||
|
auto p = pb_buff_list->Add();
|
||||||
|
buff->FillMFBuff(p);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Creature_FillSkillList(Creature* self, ::google::protobuf::RepeatedPtrField< cs::MFSkill >*
|
||||||
|
pb_skill_list)
|
||||||
|
{
|
||||||
|
self->TraverseSkill
|
||||||
|
(
|
||||||
|
[self, pb_skill_list] (Skill* skill, bool& stop)
|
||||||
|
{
|
||||||
|
auto p = pb_skill_list->Add();
|
||||||
|
skill->FillMFSkill(p);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void PBUtils::Ability_FillMFAttrAdditionList(Ability* self, Human* hum, cs::MFActivePlayerData* player_data)
|
void PBUtils::Ability_FillMFAttrAdditionList(Ability* self, Human* hum, cs::MFActivePlayerData* player_data)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user