39 lines
874 B
C++
39 lines
874 B
C++
#pragma once
|
|
|
|
namespace MetaData
|
|
{
|
|
struct Buff;
|
|
};
|
|
|
|
class Weapon;
|
|
class Creature;
|
|
class Skill;
|
|
class Buff;
|
|
class Trigger
|
|
{
|
|
public:
|
|
|
|
Trigger(Creature* owner) { owner_ = owner; };
|
|
void Init();
|
|
void UnInit();
|
|
Creature* GetOwner() { return owner_; };
|
|
void TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon);
|
|
void Shot(MetaData::Equip* weapon_meta);
|
|
void Kill(Creature* target);
|
|
void UseItemAction(int slot_id);
|
|
void UseSkill(Skill* skill);
|
|
void HpChg(float old_hp, float new_hp);
|
|
void Die();
|
|
void ActiveBuff(MetaData::Buff* buff_meta);
|
|
void DeactiveBuff(MetaData::Buff* buff_meta);
|
|
|
|
private:
|
|
void TraverseCondBuffs(int cond, std::function<void (Buff*, bool&)> func);
|
|
void TriggeCondBuffAll(int cond);
|
|
void AddBuff(int cond, int buff_id);
|
|
|
|
private:
|
|
Creature* owner_ = nullptr;
|
|
int kill_num_ = 0;
|
|
};
|