1
This commit is contained in:
parent
1218520980
commit
93bb206c07
@ -51,6 +51,7 @@ class Car : public Creature
|
||||
bool IsSingle();
|
||||
bool CanOn(Human* hum);
|
||||
void SetSpecialOperators(std::set<int>& special_operators);
|
||||
std::set<int>& GetSpecialOperators() { return special_operators_; };
|
||||
|
||||
private:
|
||||
int AllocSeat();
|
||||
|
@ -114,13 +114,18 @@ public:
|
||||
});
|
||||
RegisterCProc
|
||||
(
|
||||
"caster.get_hero_atk",
|
||||
"myself.get_init_max_hp",
|
||||
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
|
||||
{
|
||||
double result = 0.0f;
|
||||
if (context_.buff->GetCaster().Get()) {
|
||||
result = context_.buff->GetCaster().Get()->GetBattleContext()->GetHeroTotalAtk();
|
||||
}
|
||||
double result = context_.buff->owner->GetBattleContext()->GetMaxHP();
|
||||
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
|
||||
});
|
||||
RegisterCProc
|
||||
(
|
||||
"myself.get_uniid",
|
||||
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
|
||||
{
|
||||
double result = context_.buff->owner->GetUniId();
|
||||
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
|
||||
});
|
||||
RegisterCProc
|
||||
@ -224,6 +229,17 @@ public:
|
||||
}
|
||||
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
|
||||
});
|
||||
RegisterCProc
|
||||
(
|
||||
"caster.get_hero_atk",
|
||||
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
|
||||
{
|
||||
double result = 0.0f;
|
||||
if (context_.buff->GetCaster().Get()) {
|
||||
result = context_.buff->GetCaster().Get()->GetBattleContext()->GetHeroTotalAtk();
|
||||
}
|
||||
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
|
||||
});
|
||||
}
|
||||
|
||||
float Eval(std::shared_ptr<a8::lisp::Value> expr,
|
||||
|
@ -453,7 +453,7 @@ namespace mtb
|
||||
{
|
||||
a8::reflect::Class* meta_class = nullptr;
|
||||
if (!meta_class) {
|
||||
meta_class = new a8::reflect::Class("Buff", 36, 0);
|
||||
meta_class = new a8::reflect::Class("Buff", 38, 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_));
|
||||
@ -490,8 +490,8 @@ namespace mtb
|
||||
meta_class->SetSimpleField(33, "effect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, effect_list_));
|
||||
meta_class->SetSimpleField(34, "res_scale", a8::reflect::ET_STRING, my_offsetof2(Buff, res_scale_));
|
||||
meta_class->SetSimpleField(35, "tenacity", a8::reflect::ET_INT32, my_offsetof2(Buff, tenacity_));
|
||||
meta_class->SetSimpleField(36, "buff_param6", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param7_));
|
||||
meta_class->SetSimpleField(37, "buff_param6", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param8_));
|
||||
meta_class->SetSimpleField(36, "buff_param7", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param7_));
|
||||
meta_class->SetSimpleField(37, "buff_param8", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param8_));
|
||||
}
|
||||
return meta_class;
|
||||
}
|
||||
|
@ -379,6 +379,9 @@ void Car::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data)
|
||||
if (GetDriver()) {
|
||||
Creature_FillSkillList(this, p->mutable_skill_list());
|
||||
}
|
||||
for (int op_id : GetSpecialOperators()) {
|
||||
p->add_special_operators(op_id);
|
||||
}
|
||||
}
|
||||
|
||||
void Hero::FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user