This commit is contained in:
aozhiwei 2022-10-09 19:42:35 +08:00
parent fe0f6bfc85
commit d779c11d0f
5 changed files with 40 additions and 7 deletions

View File

@ -462,13 +462,20 @@ void Skill::ProcJYFH()
{ {
owner->GetTrigger()->AddListener owner->GetTrigger()->AddListener
( (
kRescueEvent, kStartRescueEvent,
[] (const std::vector<std::any>& params) [this] (const std::vector<std::any>& params)
{
owner->GetTrigger()->AddListener
(
kEndRescueEvent,
[this] (const std::vector<std::any>& params)
{ {
} }
); );
} }
);
}
void Skill::ProcFH() void Skill::ProcFH()
{ {

View File

@ -337,3 +337,18 @@ int SkillHelper::GetYlzRecoverHp(Creature* sender, Creature* target, const MetaD
(1 + target->GetBattleContext()->GetExtRecoverHp()); (1 + target->GetBattleContext()->GetExtRecoverHp());
return hp; return hp;
} }
int SkillHelper::GetJyfhBuffId(const MetaData::Skill* skill_meta)
{
return 0;
}
int SkillHelper::GetJyfhBuffTime(const MetaData::Skill* skill_meta)
{
return 0;
}
int SkillHelper::GetJyfhDmgRuduce(const MetaData::Skill* skill_meta)
{
return 0;
}

View File

@ -39,6 +39,10 @@ class SkillHelper
//医疗站 //医疗站
static int GetYlzRange(const MetaData::Skill* skill_meta); static int GetYlzRange(const MetaData::Skill* skill_meta);
static int GetYlzRecoverHp(Creature* sender, Creature* target, const MetaData::Skill* skill_meta); static int GetYlzRecoverHp(Creature* sender, Creature* target, const MetaData::Skill* skill_meta);
//救援防护
static int GetJyfhBuffId(const MetaData::Skill* skill_meta);
static int GetJyfhBuffTime(const MetaData::Skill* skill_meta);
static int GetJyfhDmgRuduce(const MetaData::Skill* skill_meta);
static void ProcBulletHitBuff(Bullet* bullet, Creature* c, int buff_uniid); static void ProcBulletHitBuff(Bullet* bullet, Creature* c, int buff_uniid);
static bool ProcBulletDmg(Bullet* bullet, Creature* target, float& finaly_dmg); static bool ProcBulletDmg(Bullet* bullet, Creature* target, float& finaly_dmg);

View File

@ -434,9 +434,14 @@ void Trigger::ShieldDestory()
DispatchEvent(kShieldDestoryEvent, {}); DispatchEvent(kShieldDestoryEvent, {});
} }
void Trigger::Rescue(Human* target) void Trigger::StartRescue(Human* target)
{ {
DispatchEvent(kRescueEvent, {target}); DispatchEvent(kStartRescueEvent, {target});
}
void Trigger::EndRescue(Human* target)
{
DispatchEvent(kEndRescueEvent, {target});
} }
void Trigger::YsBuffRemove(Buff* buff) void Trigger::YsBuffRemove(Buff* buff)

View File

@ -27,9 +27,10 @@ enum EventId_e
kDieEvent, kDieEvent,
kShieldDestoryEvent, kShieldDestoryEvent,
kFlyHookPullEvent, kFlyHookPullEvent,
kRescueEvent,
kBulletHitEvent, kBulletHitEvent,
kYsRemoveEvent kYsRemoveEvent,
kStartRescueEvent,
kEndRescueEvent,
}; };
class Weapon; class Weapon;
@ -58,7 +59,8 @@ public:
void DeactiveBuff(MetaData::Buff* buff_meta); void DeactiveBuff(MetaData::Buff* buff_meta);
void BulletHit(Bullet* bullet, Creature* target); void BulletHit(Bullet* bullet, Creature* target);
void ShieldDestory(); void ShieldDestory();
void Rescue(Human* target); void StartRescue(Human* target);
void EndRescue(Human* target);
void YsBuffRemove(Buff* buff); void YsBuffRemove(Buff* buff);
std::weak_ptr<EventHandlerPtr> AddListener(int event_id, CommonCbProc cb); std::weak_ptr<EventHandlerPtr> AddListener(int event_id, CommonCbProc cb);