1
This commit is contained in:
parent
adbb00ff28
commit
6b814243a0
@ -122,7 +122,7 @@ bool App::Init(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
auto env = std::make_shared<a8::lisp::GlobalScope>();
|
auto env = std::make_shared<a8::lisp::GlobalScope>();
|
||||||
auto p = a8::lisp::Expr::Compile("(+ 1 3)", env);
|
auto p = a8::lisp::Expr::Compile("(+ 1 3 (+ 100 200))", env);
|
||||||
auto ret = a8::lisp::Expr::Eval(p, env);
|
auto ret = a8::lisp::Expr::Eval(p, env);
|
||||||
a8::XPrintf("p:%s ret:%f\n", {p->ToXObject().ToJsonStr(), ret->ToXObject().ToJsonStr()});
|
a8::XPrintf("p:%s ret:%f\n", {p->ToXObject().ToJsonStr(), ret->ToXObject().ToJsonStr()});
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ int Buff::GetLeftTime()
|
|||||||
|
|
||||||
int Buff::GetLastingTime()
|
int Buff::GetLastingTime()
|
||||||
{
|
{
|
||||||
return meta->duration_time() * 1000;
|
return meta->GetDurationTime(skill_meta) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buff::InternalTimerAddBuff()
|
void Buff::InternalTimerAddBuff()
|
||||||
|
@ -224,7 +224,7 @@ int Creature::AddBuff(Creature* caster,
|
|||||||
{
|
{
|
||||||
buff->remover_timer = room->xtimer.SetTimeoutWpEx
|
buff->remover_timer = room->xtimer.SetTimeoutWpEx
|
||||||
(
|
(
|
||||||
buff_meta->duration_time() * SERVER_FRAME_RATE,
|
buff_meta->GetDurationTime(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) {
|
||||||
|
@ -243,7 +243,9 @@ namespace mt
|
|||||||
break;
|
break;
|
||||||
case kBET_DelayAddBuff:
|
case kBET_DelayAddBuff:
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
assert(_buff_param1 < duration_time());
|
assert(_buff_param1 < duration_time());
|
||||||
|
#endif
|
||||||
if (!mt::Buff::GetById(_int_buff_param2)) {
|
if (!mt::Buff::GetById(_int_buff_param2)) {
|
||||||
A8_ABORT();
|
A8_ABORT();
|
||||||
}
|
}
|
||||||
@ -251,7 +253,9 @@ namespace mt
|
|||||||
break;
|
break;
|
||||||
case kBET_IntervalAddBuff:
|
case kBET_IntervalAddBuff:
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
assert(_int_buff_param1 < duration_time() * 1000);
|
assert(_int_buff_param1 < duration_time() * 1000);
|
||||||
|
#endif
|
||||||
if (!mt::Buff::GetById(_int_buff_param2)) {
|
if (!mt::Buff::GetById(_int_buff_param2)) {
|
||||||
A8_ABORT();
|
A8_ABORT();
|
||||||
}
|
}
|
||||||
@ -315,4 +319,14 @@ namespace mt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Buff::GetDurationTime(const mt::Skill* skill_meta) const
|
||||||
|
{
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Buff::duration_time() const
|
||||||
|
{
|
||||||
|
return mtb::Buff::duration_time();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,15 @@
|
|||||||
#include "mt/macro.h"
|
#include "mt/macro.h"
|
||||||
#include "mtb/Buff.h"
|
#include "mtb/Buff.h"
|
||||||
|
|
||||||
|
namespace a8
|
||||||
|
{
|
||||||
|
namespace lisp
|
||||||
|
{
|
||||||
|
struct Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -44,6 +53,14 @@ namespace mt
|
|||||||
|
|
||||||
std::vector<int> _child_buff_list;
|
std::vector<int> _child_buff_list;
|
||||||
|
|
||||||
|
float GetDurationTime(const mt::Skill* skill_meta) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
float _duration_time = 0.0f;
|
||||||
|
std::shared_ptr<a8::lisp::Value> _duration_time_expr;
|
||||||
|
|
||||||
|
std::string duration_time() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace mtb
|
|||||||
const std::string buff_param3() const { return buff_param3_; };
|
const std::string buff_param3() const { return buff_param3_; };
|
||||||
const std::string buff_param4() const { return buff_param4_; };
|
const std::string buff_param4() const { return buff_param4_; };
|
||||||
const std::string buff_param5() const { return buff_param5_; };
|
const std::string buff_param5() const { return buff_param5_; };
|
||||||
float duration_time() const { return duration_time_; };
|
const std::string duration_time() const { return duration_time_; };
|
||||||
float buff_valueup() const { return buff_valueup_; };
|
float buff_valueup() const { return buff_valueup_; };
|
||||||
const std::string immune_buffeffect_list() const { return immune_buffeffect_list_; };
|
const std::string immune_buffeffect_list() const { return immune_buffeffect_list_; };
|
||||||
const std::string post_remove_action() const { return post_remove_action_; };
|
const std::string post_remove_action() const { return post_remove_action_; };
|
||||||
@ -88,7 +88,7 @@ namespace mtb
|
|||||||
std::string buff_param3_;
|
std::string buff_param3_;
|
||||||
std::string buff_param4_;
|
std::string buff_param4_;
|
||||||
std::string buff_param5_;
|
std::string buff_param5_;
|
||||||
float duration_time_ = 0.0f;
|
std::string duration_time_;
|
||||||
float buff_valueup_ = 0.0f;
|
float buff_valueup_ = 0.0f;
|
||||||
std::string immune_buffeffect_list_;
|
std::string immune_buffeffect_list_;
|
||||||
std::string post_remove_action_;
|
std::string post_remove_action_;
|
||||||
|
@ -453,7 +453,7 @@ namespace mtb
|
|||||||
meta_class->SetSimpleField(7, "buff_param3", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param3_));
|
meta_class->SetSimpleField(7, "buff_param3", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param3_));
|
||||||
meta_class->SetSimpleField(8, "buff_param4", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param4_));
|
meta_class->SetSimpleField(8, "buff_param4", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param4_));
|
||||||
meta_class->SetSimpleField(9, "buff_param5", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param5_));
|
meta_class->SetSimpleField(9, "buff_param5", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param5_));
|
||||||
meta_class->SetSimpleField(10, "duration_time", a8::reflect::ET_FLOAT, my_offsetof2(Buff, duration_time_));
|
meta_class->SetSimpleField(10, "duration_time", a8::reflect::ET_STRING, my_offsetof2(Buff, duration_time_));
|
||||||
meta_class->SetSimpleField(11, "buff_valueup", a8::reflect::ET_FLOAT, my_offsetof2(Buff, buff_valueup_));
|
meta_class->SetSimpleField(11, "buff_valueup", a8::reflect::ET_FLOAT, my_offsetof2(Buff, buff_valueup_));
|
||||||
meta_class->SetSimpleField(12, "immune_buffeffect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, immune_buffeffect_list_));
|
meta_class->SetSimpleField(12, "immune_buffeffect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, immune_buffeffect_list_));
|
||||||
meta_class->SetSimpleField(13, "post_remove_action", a8::reflect::ET_STRING, my_offsetof2(Buff, post_remove_action_));
|
meta_class->SetSimpleField(13, "post_remove_action", a8::reflect::ET_STRING, my_offsetof2(Buff, post_remove_action_));
|
||||||
|
@ -355,7 +355,7 @@ message Buff
|
|||||||
required string buff_param3 = 8;
|
required string buff_param3 = 8;
|
||||||
required string buff_param4 = 9;
|
required string buff_param4 = 9;
|
||||||
optional string buff_param5 = 19;
|
optional string buff_param5 = 19;
|
||||||
required float duration_time = 10;
|
required string duration_time = 10;
|
||||||
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;
|
||||||
|
2
third_party/a8
vendored
2
third_party/a8
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 8cf0d04a936a352fff2a502bf39d9c5729a15e12
|
Subproject commit bb2f76674df56baa480924081cb3be5ca1737e1f
|
Loading…
x
Reference in New Issue
Block a user