134 lines
3.4 KiB
C++
134 lines
3.4 KiB
C++
#include "precompile.h"
|
|
|
|
#include "mt/GraspBuff.h"
|
|
|
|
IMPL_TABLE(mt::GraspBuff)
|
|
|
|
namespace mt
|
|
{
|
|
|
|
void GraspBuff::Init1()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(graspbuff_trigger(), strings, '|');
|
|
if (strings.size() > 2) {
|
|
abort();
|
|
}
|
|
if (strings.empty()) {
|
|
abort();
|
|
}
|
|
std::vector<std::string> strings2;
|
|
a8::Split(strings[0], strings2, ',');
|
|
int type = a8::XValue(strings2[0]);
|
|
switch ((GraspBuffTrigger_e)type) {
|
|
case GraspBuffTrigger_e::kHit:
|
|
{
|
|
_trigger_type = type;
|
|
}
|
|
break;
|
|
case GraspBuffTrigger_e::kKill:
|
|
{
|
|
_trigger_type = type;
|
|
}
|
|
break;
|
|
case GraspBuffTrigger_e::kTakeOn:
|
|
{
|
|
_trigger_type = type;
|
|
}
|
|
break;
|
|
case GraspBuffTrigger_e::kCond:
|
|
{
|
|
_trigger_type = type;
|
|
_trigger_subtype = a8::XValue(strings2.at(1));
|
|
#if 0
|
|
if (_trigger_subtype != (int)GraspBuffTriggerCond_e::kImprint) {
|
|
abort();
|
|
}
|
|
#endif
|
|
_trigger_cond.push_back(a8::XValue(strings2.at(2)));
|
|
_trigger_cond.push_back(a8::XValue(strings.at(1)));
|
|
}
|
|
break;
|
|
case GraspBuffTrigger_e::kHitAndEnd:
|
|
{
|
|
_trigger_type = type;
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
abort();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(graspbuff_time(), strings, '|');
|
|
for (auto& str : strings) {
|
|
_buff_times.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(attr_num(), strings, '|');
|
|
for (auto& str : strings) {
|
|
_attr_nums.push_back(a8::XValue(str).GetDouble());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(effect_list(), strings, '|');
|
|
for (auto& str : strings) {
|
|
_effect_list.push_back(a8::XValue(str).GetDouble());
|
|
}
|
|
}
|
|
}
|
|
|
|
void GraspBuff::Init2()
|
|
{
|
|
|
|
}
|
|
|
|
int GraspBuff::GetBuffTime(int hero_lv) const
|
|
{
|
|
switch (hero_lv) {
|
|
case 10:
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
case 14:
|
|
case 15:
|
|
{
|
|
return _buff_times.size() > 1 ? _buff_times.at(1) :_buff_times.at(0);
|
|
}
|
|
default:
|
|
{
|
|
return _buff_times.at(0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
float GraspBuff::GetAttrNum(int hero_lv) const
|
|
{
|
|
switch (hero_lv) {
|
|
case 10:
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
case 14:
|
|
case 15:
|
|
{
|
|
return _attr_nums.size() > 1 ? _attr_nums.at(1) :_attr_nums.at(0);
|
|
}
|
|
default:
|
|
{
|
|
return _attr_nums.at(0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|