This commit is contained in:
aozhiwei 2023-03-06 15:04:22 +08:00
parent 2ab1f4b904
commit ddd9fc18a1
6 changed files with 22 additions and 47 deletions

View File

@ -179,32 +179,3 @@ void SprintBuff::OnEnemyHit(Creature* enemy)
enemy->TryAddBuff(owner, buff_id, skill_meta);
}
}
#if 0
void SprintBuff::ProcXiongHun()
{
owner->TryAddBuff(owner, 209016);
owner->GetAbility()->DelSpeedAddition(skill_meta->_number_meta->_float_speed);
owner->room->grid_service->TraverseCreatures
(owner->room->GetRoomIdx(),
owner->GetGridList(),
[this] (Creature* c, bool& stop)
{
if (c->dead) {
return;
}
if (!owner->IsProperTarget(c)) {
return;
}
if (Collision::CheckCC(owner,
skill_meta->_number_meta->_float_range3,
c,
c->GetHitRadius())) {
c->TryAddBuffAndSetTime(owner,
kVertigoEffectBuffId,
skill_meta->_number_meta->_float_time * SERVER_FRAME_RATE);
}
}
);
}
#endif

View File

@ -261,6 +261,9 @@ int Creature::AddBuff(Creature* caster,
if (buff->meta->lock_dir()) {
IncDisableAttackDirTimes();
}
if (buff->meta->lock_move_dir()) {
IncDisableMoveDirTimes();
}
if (buff->meta->disable_shot()) {
GetAbility()->IncDisableShotTimes();
}
@ -645,6 +648,9 @@ void Creature::OnBuffRemove(Buff& buff)
if (buff.meta->lock_dir()) {
DecDisableAttackDirTimes();
}
if (buff.meta->lock_move_dir()) {
DecDisableMoveDirTimes();
}
if (buff.meta->disable_shot()) {
GetAbility()->DecDisableShotTimes();
}

View File

@ -30,7 +30,7 @@ public:
});
RegisterCProc
(
"!myself.get_hero_atk",
"myself.get_hero_atk",
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
{
double result = context_.buff->owner->GetBattleContext()->GetHeroTotalAtk();
@ -38,7 +38,7 @@ public:
});
RegisterCProc
(
"!caster.get_hero_atk",
"caster.get_hero_atk",
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
{
double result = 0.0f;
@ -90,14 +90,7 @@ public:
auto&& symbol = std::any_cast<a8::lisp::Symbol>(node->value);
int idx = mt::SkillNumber::GetAttrIdxByName(symbol.name);
if (idx < 0) {
auto cproc = Find("!" + symbol.name);
if (!cproc) {
abort();
}
if (!cproc->IsType(a8::lisp::ValueType::kCProc)) {
abort();
}
func_call_exprs->push_back(cproc);
abort();
} else {
{
auto cproc = Find("!getSkillNumber");

View File

@ -39,6 +39,7 @@ namespace mtb
int no_immune() const { return no_immune_; };
int lock_move() const { return lock_move_; };
int lock_dir() const { return lock_dir_; };
int lock_move_dir() const { return lock_move_dir_; };
int disable_shot() const { return disable_shot_; };
int disable_useskill() const { return disable_useskill_; };
const std::string effect_list() const { return effect_list_; };
@ -72,9 +73,10 @@ namespace mtb
bool has_no_immune() const { return __flags__.test(26);};
bool has_lock_move() const { return __flags__.test(27);};
bool has_lock_dir() const { return __flags__.test(28);};
bool has_disable_shot() const { return __flags__.test(29);};
bool has_disable_useskill() const { return __flags__.test(30);};
bool has_effect_list() const { return __flags__.test(31);};
bool has_lock_move_dir() const { return __flags__.test(29);};
bool has_disable_shot() const { return __flags__.test(30);};
bool has_disable_useskill() const { return __flags__.test(31);};
bool has_effect_list() const { return __flags__.test(32);};
protected:
@ -107,12 +109,13 @@ namespace mtb
int no_immune_ = 0;
int lock_move_ = 0;
int lock_dir_ = 0;
int lock_move_dir_ = 0;
int disable_shot_ = 0;
int disable_useskill_ = 0;
std::string effect_list_;
public:
std::bitset<32> __flags__;
std::bitset<33> __flags__;
};
};

View File

@ -442,7 +442,7 @@ namespace mtb
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("Buff", 32, 0);
meta_class = new a8::reflect::Class("Buff", 33, 0);
meta_class->SetSimpleField(0, "buff_id", a8::reflect::ET_INT32, my_offsetof2(Buff, buff_id_));
meta_class->SetSimpleField(1, "name", a8::reflect::ET_STRING, my_offsetof2(Buff, name_));
meta_class->SetSimpleField(2, "buff_target", a8::reflect::ET_INT32, my_offsetof2(Buff, buff_target_));
@ -472,9 +472,10 @@ namespace mtb
meta_class->SetSimpleField(26, "no_immune", a8::reflect::ET_INT32, my_offsetof2(Buff, no_immune_));
meta_class->SetSimpleField(27, "lock_move", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_move_));
meta_class->SetSimpleField(28, "lock_dir", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_dir_));
meta_class->SetSimpleField(29, "disable_shot", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_shot_));
meta_class->SetSimpleField(30, "disable_useskill", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_useskill_));
meta_class->SetSimpleField(31, "effect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, effect_list_));
meta_class->SetSimpleField(29, "lock_move_dir", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_move_dir_));
meta_class->SetSimpleField(30, "disable_shot", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_shot_));
meta_class->SetSimpleField(31, "disable_useskill", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_useskill_));
meta_class->SetSimpleField(32, "effect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, effect_list_));
}
return meta_class;
}

View File

@ -374,6 +374,7 @@ message Buff
optional int32 no_immune = 30;
optional int32 lock_move = 31;
optional int32 lock_dir = 34;
optional int32 lock_move_dir = 36;
optional int32 disable_shot = 32;
optional int32 disable_useskill = 33;
optional string effect_list = 35;