1
This commit is contained in:
parent
c8025803fb
commit
47b43aca61
@ -77,7 +77,7 @@ int Buff::GetLeftTime()
|
|||||||
|
|
||||||
int Buff::GetLastingTime()
|
int Buff::GetLastingTime()
|
||||||
{
|
{
|
||||||
return meta->GetDurationTime(skill_meta) * 1000;
|
return meta->GetDurationTime(owner, skill_meta) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buff::InternalTimerAddBuff()
|
void Buff::InternalTimerAddBuff()
|
||||||
|
@ -275,7 +275,7 @@ int Creature::AddBuff(Creature* caster,
|
|||||||
{
|
{
|
||||||
buff->remover_timer = room->xtimer.SetTimeoutWpEx
|
buff->remover_timer = room->xtimer.SetTimeoutWpEx
|
||||||
(
|
(
|
||||||
buff_meta->GetDurationTime(buff_skill_meta) * SERVER_FRAME_RATE,
|
buff_meta->GetDurationTime(this, buff_skill_meta) * SERVER_FRAME_RATE,
|
||||||
[buff_wp = (std::weak_ptr<Buff>)buff] (int event, const a8::Args* args)
|
[buff_wp = (std::weak_ptr<Buff>)buff] (int event, const a8::Args* args)
|
||||||
{
|
{
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
|
#include "lispenv.h"
|
||||||
|
|
||||||
#include "mt/Buff.h"
|
#include "mt/Buff.h"
|
||||||
#include "mt/Hero.h"
|
#include "mt/Hero.h"
|
||||||
|
|
||||||
@ -319,11 +321,44 @@ namespace mt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Buff::GetDurationTime(const mt::Skill* skill_meta) const
|
float Buff::GetDurationTime(Creature* c, const mt::Skill* skill_meta) const
|
||||||
{
|
{
|
||||||
|
if (_duration_time_expr) {
|
||||||
|
return LispEnv::Instance()->EvalSkillNumberExpr
|
||||||
|
(
|
||||||
|
_duration_time_expr,
|
||||||
|
c,
|
||||||
|
skill_meta
|
||||||
|
);
|
||||||
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Buff::GetBuffParam1(Creature* c, const mt::Skill* skill_meta) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
float Buff::GetBuffParam2(Creature* c, const mt::Skill* skill_meta) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
float Buff::GetBuffParam3(Creature* c, const mt::Skill* skill_meta) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
float Buff::GetBuffParam4(Creature* c, const mt::Skill* skill_meta) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
float Buff::GetBuffParam5(Creature* c, const mt::Skill* skill_meta) const
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Buff::duration_time() const
|
std::string Buff::duration_time() const
|
||||||
{
|
{
|
||||||
return mtb::Buff::duration_time();
|
return mtb::Buff::duration_time();
|
||||||
|
@ -12,6 +12,7 @@ namespace a8
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Creature;
|
||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -53,11 +54,21 @@ namespace mt
|
|||||||
|
|
||||||
std::vector<int> _child_buff_list;
|
std::vector<int> _child_buff_list;
|
||||||
|
|
||||||
float GetDurationTime(const mt::Skill* skill_meta) const;
|
float GetDurationTime(Creature* c, const mt::Skill* skill_meta) const;
|
||||||
|
float GetBuffParam1(Creature* c, const mt::Skill* skill_meta) const;
|
||||||
|
float GetBuffParam2(Creature*, const mt::Skill* skill_meta) const;
|
||||||
|
float GetBuffParam3(Creature* c, const mt::Skill* skill_meta) const;
|
||||||
|
float GetBuffParam4(Creature* c, const mt::Skill* skill_meta) const;
|
||||||
|
float GetBuffParam5(Creature* c, const mt::Skill* skill_meta) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _duration_time = 0.0f;
|
float _duration_time = 0.0f;
|
||||||
std::shared_ptr<a8::lisp::Value> _duration_time_expr;
|
std::shared_ptr<a8::lisp::Value> _duration_time_expr;
|
||||||
|
std::shared_ptr<a8::lisp::Value> _buff_param1_expr;
|
||||||
|
std::shared_ptr<a8::lisp::Value> _buff_param2_expr;
|
||||||
|
std::shared_ptr<a8::lisp::Value> _buff_param3_expr;
|
||||||
|
std::shared_ptr<a8::lisp::Value> _buff_param4_expr;
|
||||||
|
std::shared_ptr<a8::lisp::Value> _buff_param5_expr;
|
||||||
|
|
||||||
std::string duration_time() const;
|
std::string duration_time() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user