merge hero
This commit is contained in:
commit
5677b168a5
@ -137,3 +137,15 @@ void Buff::InternalTimerAddBuff(Creature* caster)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Buff::ProcSummonHero(Creature* caster)
|
||||||
|
{
|
||||||
|
if (!caster->IsHuman()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Buff::NeedSync(Human* hum)
|
||||||
|
{
|
||||||
|
return !meta->i->only_server() || !(meta->i->only_self() && owner == hum);
|
||||||
|
}
|
||||||
|
@ -15,6 +15,7 @@ namespace cs
|
|||||||
class MFBuff;
|
class MFBuff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Human;
|
||||||
class Creature;
|
class Creature;
|
||||||
class Buff
|
class Buff
|
||||||
{
|
{
|
||||||
@ -28,11 +29,13 @@ class Buff
|
|||||||
|
|
||||||
int GetLeftTime();
|
int GetLeftTime();
|
||||||
int GetLastingTime();
|
int GetLastingTime();
|
||||||
|
bool NeedSync(Human* hum);
|
||||||
void FillMFBuff(cs::MFBuff* buff_pb);
|
void FillMFBuff(cs::MFBuff* buff_pb);
|
||||||
|
|
||||||
void ProcDelayAddBuff(Creature* caster);
|
void ProcDelayAddBuff(Creature* caster);
|
||||||
void ProcIntervalAddBuff(Creature* caster);
|
void ProcIntervalAddBuff(Creature* caster);
|
||||||
void ProcBatchAddBuff(Creature* caster);
|
void ProcBatchAddBuff(Creature* caster);
|
||||||
|
void ProcSummonHero(Creature* caster);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InternalTimerAddBuff(Creature* caster);
|
void InternalTimerAddBuff(Creature* caster);
|
||||||
|
@ -347,11 +347,13 @@ float Creature::GetBuffAttrRate(int attr_type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::FillBuffList(::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list)
|
void Creature::FillBuffList(Human* hum, ::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list)
|
||||||
{
|
{
|
||||||
for (auto& itr : buff_list_) {
|
for (auto& itr : buff_list_) {
|
||||||
auto buff = pb_buff_list->Add();
|
if (itr.NeedSync(hum)) {
|
||||||
itr.FillMFBuff(buff);
|
auto buff = pb_buff_list->Add();
|
||||||
|
itr.FillMFBuff(buff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,7 +832,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
break;
|
break;
|
||||||
case kBET_SummonHero:
|
case kBET_SummonHero:
|
||||||
{
|
{
|
||||||
|
buff->ProcSummonHero(caster);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kBET_Shield:
|
case kBET_Shield:
|
||||||
|
@ -70,7 +70,7 @@ class Creature : public MoveableEntity
|
|||||||
void ClearBuffList();
|
void ClearBuffList();
|
||||||
float GetBuffAttrAbs(int attr_id);
|
float GetBuffAttrAbs(int attr_id);
|
||||||
float GetBuffAttrRate(int attr_id);
|
float GetBuffAttrRate(int attr_id);
|
||||||
void FillBuffList(::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list);
|
void FillBuffList(Human* hum, ::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list);
|
||||||
void FillSkillList(::google::protobuf::RepeatedPtrField< cs::MFSkill >* pb_skill_list);
|
void FillSkillList(::google::protobuf::RepeatedPtrField< cs::MFSkill >* pb_skill_list);
|
||||||
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);
|
||||||
|
@ -203,7 +203,7 @@ void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data
|
|||||||
p->set_parachute(parachute);
|
p->set_parachute(parachute);
|
||||||
}
|
}
|
||||||
FillBodyState(p->mutable_states());
|
FillBodyState(p->mutable_states());
|
||||||
FillBuffList(p->mutable_buff_list());
|
FillBuffList(hum, p->mutable_buff_list());
|
||||||
FillSkillList(p->mutable_skill_list());
|
FillSkillList(p->mutable_skill_list());
|
||||||
if (dead) {
|
if (dead) {
|
||||||
p->set_killer_name(stats.killer_name);
|
p->set_killer_name(stats.killer_name);
|
||||||
|
@ -213,6 +213,8 @@ message Buff
|
|||||||
optional float buff_valueup = 11;
|
optional float buff_valueup = 11;
|
||||||
required string immune_buffeffect_list = 12;
|
required string immune_buffeffect_list = 12;
|
||||||
optional string post_remove_action = 13;
|
optional string post_remove_action = 13;
|
||||||
|
optional int32 only_server = 14;
|
||||||
|
optional int32 only_self = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Drop
|
message Drop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user