1
This commit is contained in:
parent
a4037375fe
commit
ff6f1cd69f
@ -125,6 +125,9 @@ void Explosion::ProcDamage()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
target->OnExplosionHit(this);
|
target->OnExplosionHit(this);
|
||||||
|
if (hit_cb_) {
|
||||||
|
hit_cb_({target});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ class Explosion : public std::enable_shared_from_this<Explosion>
|
|||||||
bool IsPreBattleExplosion();
|
bool IsPreBattleExplosion();
|
||||||
int GetExplosionEffect() { return explosion_effect_; };
|
int GetExplosionEffect() { return explosion_effect_; };
|
||||||
void SetDamageDelay(int delay) { explosion_damage_delay_ = delay; };
|
void SetDamageDelay(int delay) { explosion_damage_delay_ = delay; };
|
||||||
|
void SetHitCb(CommonCbProc cb) { hit_cb_ = cb;};
|
||||||
|
|
||||||
void IndifferenceAttack(Room* room,
|
void IndifferenceAttack(Room* room,
|
||||||
const a8::Vec2& center,
|
const a8::Vec2& center,
|
||||||
@ -49,6 +50,7 @@ protected:
|
|||||||
a8::Vec2 center_;
|
a8::Vec2 center_;
|
||||||
long long special_damage_type_ = 0;
|
long long special_damage_type_ = 0;
|
||||||
long long create_frameno_ = 0;
|
long long create_frameno_ = 0;
|
||||||
|
CommonCbProc hit_cb_;
|
||||||
|
|
||||||
friend class EntityFactory;
|
friend class EntityFactory;
|
||||||
};
|
};
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "metamgr.h"
|
#include "metamgr.h"
|
||||||
#include "trigger.h"
|
#include "trigger.h"
|
||||||
|
#include "skillhelper.h"
|
||||||
|
#include "entityfactory.h"
|
||||||
|
#include "explosion.h"
|
||||||
|
|
||||||
void Skill::Initialzie()
|
void Skill::Initialzie()
|
||||||
{
|
{
|
||||||
@ -305,9 +308,11 @@ void Skill::ProcSSJS()
|
|||||||
owner->GetTrigger()->AddListener
|
owner->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kReceiveDmgEvent,
|
kReceiveDmgEvent,
|
||||||
[] (const std::vector<std::any>& params)
|
[this] (const std::vector<std::any>& params)
|
||||||
{
|
{
|
||||||
|
if (GetLeftTime() <= 0) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -317,9 +322,12 @@ void Skill::ProcJSHX()
|
|||||||
owner->GetTrigger()->AddListener
|
owner->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kKillEvent,
|
kKillEvent,
|
||||||
[] (const std::vector<std::any>& params)
|
[this] (const std::vector<std::any>& params)
|
||||||
{
|
{
|
||||||
|
if (!owner->dead) {
|
||||||
|
float add_hp = SkillHelper::GetJshxHp(meta);
|
||||||
|
owner->AddHp(add_hp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -329,9 +337,24 @@ void Skill::ProcSWZB()
|
|||||||
owner->GetTrigger()->AddListener
|
owner->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kDieEvent,
|
kDieEvent,
|
||||||
[] (const std::vector<std::any>& params)
|
[this] (const std::vector<std::any>& params)
|
||||||
{
|
{
|
||||||
|
std::shared_ptr<Explosion> e = EntityFactory::Instance()->MakeExplosion();
|
||||||
|
e->SetHitCb
|
||||||
|
(
|
||||||
|
[] (const std::vector<std::any>& params)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
e->EnemyAndObstacleAttack
|
||||||
|
(
|
||||||
|
owner->GetWeakPtrRef(),
|
||||||
|
owner->GetPos(),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -113,3 +113,23 @@ int SkillHelper::GetCmxdDistance(const MetaData::Skill* skill_meta)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SkillHelper::GetJshxHp(const MetaData::Skill* skill_meta)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SkillHelper::GetSwzbRadius(const MetaData::Skill* skill_meta)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SkillHelper::GetSwzbDmg(const MetaData::Skill* skill_meta)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SkillHelper::GetSwzbPullDistance(const MetaData::Skill* skill_meta)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -18,6 +18,12 @@ class SkillHelper
|
|||||||
//此面向敌
|
//此面向敌
|
||||||
static int GetCmxdDmg(const MetaData::Skill* skill_meta);
|
static int GetCmxdDmg(const MetaData::Skill* skill_meta);
|
||||||
static int GetCmxdDistance(const MetaData::Skill* skill_meta);
|
static int GetCmxdDistance(const MetaData::Skill* skill_meta);
|
||||||
|
//击杀回血
|
||||||
|
static int GetJshxHp(const MetaData::Skill* skill_meta);
|
||||||
|
//死亡自爆
|
||||||
|
static int GetSwzbRadius(const MetaData::Skill* skill_meta);
|
||||||
|
static int GetSwzbDmg(const MetaData::Skill* skill_meta);
|
||||||
|
static int GetSwzbPullDistance(const MetaData::Skill* skill_meta);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user