This commit is contained in:
aozhiwei 2023-02-13 13:45:30 +08:00
parent c2fb7b3371
commit 1e87d4adc1
28 changed files with 173 additions and 173 deletions

View File

@ -14,7 +14,7 @@ float Ability::GetAttrAbs(int attr_id)
if (owner.Get()) {
Buff* buff = owner.Get()->GetBuffByEffectId(kBET_Car);
if (buff) {
const mt::Equip* equip_meta = mt::Equip::GetById(buff->meta->_param4);
const mt::Equip* equip_meta = mt::Equip::GetById(buff->meta->_buff_param4);
if (equip_meta) {
switch (attr_id) {
case kHAT_Atk:

View File

@ -97,7 +97,7 @@ void Buff::InternalTimerAddBuff()
receiver->context_dir = receiver->GetAttackDir();
receiver->context_pos = receiver->GetPos();
int buff_id = meta->_int_param2;
int buff_id = meta->_int_buff_param2;
const mt::Buff* buff_meta = mt::Buff::GetById(buff_id);
if (buff_meta) {
SkillCasterState old_caster_state;
@ -119,7 +119,7 @@ void Buff::InternalTimerAddBuff()
{
owner->room->xtimer.SetTimeoutEx
(
meta->_param1 * SERVER_FRAME_RATE,
meta->_buff_param1 * SERVER_FRAME_RATE,
timer_func,
&xtimer_attacher
);
@ -129,7 +129,7 @@ void Buff::InternalTimerAddBuff()
{
owner->room->xtimer.SetIntervalEx
(
meta->_param1 / FRAME_RATE_MS,
meta->_buff_param1 / FRAME_RATE_MS,
timer_func,
&xtimer_attacher
);
@ -245,7 +245,7 @@ void Buff::PreProcess()
switch (meta->buff_effect()) {
case kBET_CallFunc:
{
switch (meta->_int_param1) {
switch (meta->_int_buff_param1) {
case 1:
{
event_handlers_.push_back
@ -284,11 +284,11 @@ void Buff::PreProcess()
if (meta->buff_id() == 8042) {
#ifdef DEBUG
{
a8::XPrintf("添加减速%f", {meta->_param3});
a8::XPrintf("添加减速%f", {meta->_buff_param3});
}
#endif
if (owner->GetAbility()->GetSpeedRuduceTimes() <= 0) {
owner->GetAbility()->AddSpeedRuduce(-meta->_param3/100.0f);
owner->GetAbility()->AddSpeedRuduce(-meta->_buff_param3/100.0f);
}
}
#endif
@ -296,16 +296,16 @@ void Buff::PreProcess()
void Buff::ProcSputteringFunc(Bullet* bullet)
{
const mt::Equip* weapon_meta = mt::Equip::GetById(meta->_int_param2);
const mt::Equip* weapon_meta = mt::Equip::GetById(meta->_int_buff_param2);
if (!weapon_meta) {
return;
}
for (int i = 0; i < meta->_param4_int_list.size(); ++i) {
for (int i = 0; i < meta->_buff_param4_int_list.size(); ++i) {
glm::vec3 bullet_dir = GlmHelper::UP;
GlmHelper::RotateY(bullet_dir, meta->_param4_int_list[i] / 180.f);
GlmHelper::RotateY(bullet_dir, meta->_buff_param4_int_list[i] / 180.f);
Position bullet_born_pos = owner->GetPos();
bullet_born_pos.AddGlmVec3(bullet_dir * meta->_param3);
bullet_born_pos.AddGlmVec3(bullet_dir * meta->_buff_param3);
int bullet_uniid = owner->room->AllocUniid();
owner->room->frame_event.AddBullet
(bullet_uniid,
@ -346,7 +346,7 @@ void Buff::Activate()
{
owner->RecalcBuffAttr();
if (meta->buff_effect() == kBET_Car) {
const mt::Equip* equip_meta = mt::Equip::GetById(meta->_param4);
const mt::Equip* equip_meta = mt::Equip::GetById(meta->_buff_param4);
if (equip_meta &&
equip_meta->equip_type() == EQUIP_TYPE_CAR &&
equip_meta->equip_subtype() == 1

View File

@ -11,7 +11,7 @@
void AddCarBuff::Activate()
{
if (owner->IsHuman() && owner->AsHuman()->GetCar()) {
owner->AsHuman()->GetCar()->TryAddBuff(owner, meta->_int_param1);
owner->AsHuman()->GetCar()->TryAddBuff(owner, meta->_int_buff_param1);
}
}

View File

@ -9,9 +9,9 @@
void AddInventoryBuff::Activate()
{
for (int slot : meta->_param2_int_list) {
for (int slot : meta->_buff_param2_int_list) {
if (IsValidSlotId(slot)) {
owner->buff_inventory_[slot].num += meta->_int_param1;
owner->buff_inventory_[slot].num += meta->_int_buff_param1;
}
}
if (owner->IsHuman()) {
@ -23,9 +23,9 @@ void AddInventoryBuff::Activate()
void AddInventoryBuff::Deactivate()
{
if (owner->IsHuman()) {
for (int slot : meta->_param2_int_list) {
for (int slot : meta->_buff_param2_int_list) {
if (IsValidSlotId(slot)) {
owner->AsHuman()->buff_inventory_[slot].num -= meta->_int_param1;
owner->AsHuman()->buff_inventory_[slot].num -= meta->_int_buff_param1;
owner->AsHuman()->buff_inventory_[slot].num =
std::max(0, owner->AsHuman()->buff_inventory_[slot].num);
}

View File

@ -13,10 +13,10 @@ void BeatBackBuff::Activate()
if (caster_.Get()) {
if (std::abs(caster_.Get()->context_dir.x) > FLT_EPSILON ||
std::abs(caster_.Get()->context_dir.x) > FLT_EPSILON) {
if (std::abs(meta->_int_param1) > 0) {
if (std::abs(meta->_int_buff_param1) > 0) {
glm::vec3 old_move_dir = owner->GetMoveDir();
owner->SetMoveDir(caster_.Get()->context_dir);
owner->ForwardMove(meta->_param1);
owner->ForwardMove(meta->_buff_param1);
owner->SetMoveDir(old_move_dir);
}
}

View File

@ -10,7 +10,7 @@
void BecomeBuff::Activate()
{
hold_curr_weapon_idx_ = caster_.Get()->GetCurrWeapon()->weapon_idx;
if (caster_.Get()->IsHuman() && meta->_param2 > 0.01) {
if (caster_.Get()->IsHuman() && meta->_buff_param2 > 0.01) {
std::vector<std::string> strings;
a8::Split(meta->buff_param2(), strings, ':');
for (size_t i = 0; i < strings.size(); ++i) {

View File

@ -17,7 +17,7 @@ void BePullBuff::Activate()
owner->SetPos(caster_.Get()->GetPos());
owner->target_pos = caster_.Get()->GetPos();
} else {
if (target_distance <= meta->_param3) {
if (target_distance <= meta->_buff_param3) {
owner->SetPos(caster_.Get()->GetPos());
owner->target_pos = caster_.Get()->GetPos();
} else {
@ -25,7 +25,7 @@ void BePullBuff::Activate()
GlmHelper::Normalize(move_dir);
owner->SetMoveDir(move_dir);
owner->target_pos = owner->GetPos();
owner->target_pos.AddGlmVec3(owner->GetMoveDir() * (target_distance - meta->_param3));
owner->target_pos.AddGlmVec3(owner->GetMoveDir() * (target_distance - meta->_buff_param3));
}
}
} else {

View File

@ -10,14 +10,14 @@
void CallFuncBuff::Activate()
{
switch (meta->_int_param1) {
switch (meta->_int_buff_param1) {
case 1:
{
}
break;
case 2:
{
owner->GetAbility()->AddSpeedRuduce(meta->_param2);
owner->GetAbility()->AddSpeedRuduce(meta->_buff_param2);
}
break;
case 3:
@ -34,7 +34,7 @@ void CallFuncBuff::Activate()
void CallFuncBuff::Deactivate()
{
switch (meta->_int_param1) {
switch (meta->_int_buff_param1) {
case 1:
{
@ -42,7 +42,7 @@ void CallFuncBuff::Deactivate()
break;
case 2:
{
owner->GetAbility()->DelSpeedRuduce(meta->_param2);
owner->GetAbility()->DelSpeedRuduce(meta->_buff_param2);
}
break;
default:
@ -56,7 +56,7 @@ void CallFuncBuff::ProcIntervalRangeAddBuffFunc()
{
owner->room->xtimer.SetIntervalEx
(
meta->_param4 / FRAME_RATE_MS,
meta->_buff_param4 / FRAME_RATE_MS,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
@ -74,8 +74,8 @@ void CallFuncBuff::ProcIntervalRangeAddBuffFunc()
return;
}
if (GetCaster().Get()->team_id != c->team_id) {
if (owner->GetPos().Distance2D2(c->GetPos()) < meta->_param2) {
c->TryAddBuff(GetCaster().Get(), meta->_int_param3, skill_meta);
if (owner->GetPos().Distance2D2(c->GetPos()) < meta->_buff_param2) {
c->TryAddBuff(GetCaster().Get(), meta->_int_buff_param3, skill_meta);
}
}
});

View File

@ -11,15 +11,15 @@
void CamouflageAdditionBuff::Activate()
{
Buff* camouflage_buff = owner->GetBuffByEffectId(kBET_Camouflage);
if (camouflage_buff && !camouflage_buff->remover_timer.expired() && meta->_int_param1 > 0) {
if (camouflage_buff && !camouflage_buff->remover_timer.expired() && meta->_int_buff_param1 > 0) {
int remain_time = owner->room->xtimer.GetRemainTime(camouflage_buff->remover_timer) * FRAME_RATE_MS;
remain_time += meta->_int_param1;
remain_time += meta->_int_buff_param1;
owner->room->xtimer.ModifyTime(camouflage_buff->remover_timer, remain_time / FRAME_RATE_MS);
}
if (meta->_int_param2 != 0) {
if (meta->_int_buff_param2 != 0) {
++owner->camouflage_move_addition_;
}
if (meta->_int_param3 != 0) {
if (meta->_int_buff_param3 != 0) {
++owner->camouflage_aiming_addition_;
}
}
@ -27,10 +27,10 @@ void CamouflageAdditionBuff::Activate()
void CamouflageAdditionBuff::Deactivate()
{
if (owner->AsHuman()) {
if (meta->_int_param2 != 0) {
if (meta->_int_buff_param2 != 0) {
--owner->AsHuman()->camouflage_move_addition_;
}
if (meta->_int_param3 != 0) {
if (meta->_int_buff_param3 != 0) {
--owner->AsHuman()->camouflage_aiming_addition_;
}
owner->AsHuman()->camouflage_move_addition_ = std::max(owner->AsHuman()->camouflage_move_addition_, 0);

View File

@ -8,10 +8,10 @@
void CondAddBuff::Activate()
{
if (!IsValidCondBuff(meta->_int_param1)) {
if (!IsValidCondBuff(meta->_int_buff_param1)) {
A8_ABORT();
}
list_add_tail(&cond_entry, &owner->cond_buffs_[meta->_int_param1]);
list_add_tail(&cond_entry, &owner->cond_buffs_[meta->_int_buff_param1]);
}
void CondAddBuff::Deactivate()

View File

@ -13,7 +13,7 @@ void DisperseBuff::Activate()
(
[this, &del_buffs] (Buff* buff, bool& stop)
{
for (int tag : meta->_param1_int_set) {
for (int tag : meta->_buff_param1_int_set) {
if (buff->meta->_tags.find(tag) != buff->meta->_tags.end()) {
del_buffs.push_back(buff->buff_uniid);
break;
@ -24,7 +24,7 @@ void DisperseBuff::Activate()
owner->RemoveBuffByUniId(buff_uniid);
}
if (!del_buffs.empty()) {
owner->TryAddBuff(owner, meta->_int_param2);
owner->TryAddBuff(owner, meta->_int_buff_param2);
}
}

View File

@ -8,7 +8,7 @@
void FlashMoveBuff::Activate()
{
if (meta->_int_param1 == 0) {
if (meta->_int_buff_param1 == 0) {
owner->SpecDirMove(owner->skill_dir_, std::max(owner->skill_distance_, 300.0f));
}
}

View File

@ -9,14 +9,14 @@
void ImmuneBuff::Activate()
{
for (int tag : meta->_param1_int_list) {
for (int tag : meta->_buff_param1_int_list) {
owner->GetAbility()->IncImmuneTimes(tag);
}
}
void ImmuneBuff::Deactivate()
{
for (int tag : meta->_param1_int_list) {
for (int tag : meta->_buff_param1_int_list) {
owner->GetAbility()->DecImmuneTimes(tag);
}
}

View File

@ -16,7 +16,7 @@ void JumpToBuff::Activate()
owner->SetPos(entity->GetPos());
owner->target_pos = entity->GetPos();
} else {
if (target_distance <= meta->_param3) {
if (target_distance <= meta->_buff_param3) {
owner->SetPos(entity->GetPos());
owner->target_pos = entity->GetPos();
} else {
@ -25,7 +25,7 @@ void JumpToBuff::Activate()
owner->SetMoveDir(move_dir);
owner->skill_dir_ = owner->GetMoveDir();
owner->target_pos = owner->GetPos();
owner->target_pos.AddGlmVec3(owner->GetMoveDir() * (target_distance - meta->_param3));
owner->target_pos.AddGlmVec3(owner->GetMoveDir() * (target_distance - meta->_buff_param3));
}
}
}

View File

@ -22,7 +22,7 @@ void OnceChgAttrBuff::InternalProcOnceChgAttr()
if (owner->dead) {
return;
}
switch (meta->_int_param1) {
switch (meta->_int_buff_param1) {
case kHAT_Hp:
{
int real_killer_id = 0;
@ -31,13 +31,13 @@ void OnceChgAttrBuff::InternalProcOnceChgAttr()
real_killer_id = caster_.Get()->GetUniId();
real_killer_name = caster_.Get()->GetName();
}
if (meta->_int_param2 == 1) {
if (meta->_int_buff_param2 == 1) {
//绝对值
if (meta->_param3 > 0) {
owner->AddHp(meta->_param3);
} else if (meta->_param3 < 0) {
if (meta->_buff_param3 > 0) {
owner->AddHp(meta->_buff_param3);
} else if (meta->_buff_param3 < 0) {
owner->over_delay_time = 100;
owner->DecHP(std::abs(meta->_param3),
owner->DecHP(std::abs(meta->_buff_param3),
VP_Buff,
"",
meta->buff_id(),
@ -45,9 +45,9 @@ void OnceChgAttrBuff::InternalProcOnceChgAttr()
real_killer_name);
owner->over_delay_time = 0;
}
} else if (meta->_int_param2 == 2) {
} else if (meta->_int_buff_param2 == 2) {
//百分比
float chg_hp = owner->GetHP() * meta->_param3;
float chg_hp = owner->GetHP() * meta->_buff_param3;
if (chg_hp > 0.0001f) {
owner->AddHp(chg_hp);
} else if (chg_hp < 0.0001f) {
@ -66,8 +66,8 @@ void OnceChgAttrBuff::InternalProcOnceChgAttr()
std::string dbg_msg = a8::Format
("buff扣血 type:%s val:%f",
{
meta->_int_param2,
meta->_int_param3,
meta->_int_buff_param2,
meta->_int_buff_param3,
});
owner->room->BroadcastDebugMsg(dbg_msg);
}

View File

@ -11,7 +11,7 @@
void RemoveCarBuff::Activate()
{
if (owner->IsHuman() && owner->AsHuman()->GetCar()) {
owner->AsHuman()->GetCar()->RemoveBuffById(meta->_int_param1);
owner->AsHuman()->GetCar()->RemoveBuffById(meta->_int_buff_param1);
}
}

View File

@ -34,8 +34,8 @@ void ReverseBuff::Activate()
break;
}
} else {
if (meta->_param1 > 0.001) {
owner->ForwardMove(meta->_param1);
if (meta->_buff_param1 > 0.001) {
owner->ForwardMove(meta->_buff_param1);
}
}
}

View File

@ -13,8 +13,8 @@ void SelectTargetWithSelfPosBuff::Activate()
(
[this, &targets] (Creature* c, bool& stop)
{
if (owner->GetPos().Distance2D2(c->GetPos()) < meta->_int_param3) {
switch (meta->_int_param1) {
if (owner->GetPos().Distance2D2(c->GetPos()) < meta->_int_buff_param3) {
switch (meta->_int_buff_param1) {
case kBST_All:
{
targets.push_back(c);
@ -64,7 +64,7 @@ void SelectTargetWithSelfPosBuff::Activate()
}
);
for (auto& target : targets) {
for (int buff_id : meta->_param2_int_list) {
for (int buff_id : meta->_buff_param2_int_list) {
target->TryAddBuff(caster_.Get(), buff_id);
}
}

View File

@ -13,7 +13,7 @@
void SprintBuff::Activate()
{
if (meta->_int_param5) {
if (meta->_int_buff_param5) {
owner->IncDisableMoveDirTimes();
}
@ -26,7 +26,7 @@ void SprintBuff::Activate()
void SprintBuff::Deactivate()
{
if (meta->_int_param5) {
if (meta->_int_buff_param5) {
owner->DecDisableMoveDirTimes();
}
if (owner->AsHuman()) {
@ -94,7 +94,7 @@ void SprintBuff::CoCollisionCheck()
(int event, const a8::Args* args) mutable
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!meta->_param3_int_list.empty() || skill_meta) {
if (!meta->_buff_param3_int_list.empty() || skill_meta) {
Check(pre_pos, hited_objects);
}
}
@ -116,7 +116,7 @@ void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_object
for (int i = 0; i < (distance + 6); i += 5) {
glm::vec3 center = owner->GetPos().ToGlmVec3() + dir * (float)i;
std::set<Creature*> enemys;
owner->GetHitEnemys(enemys, center, meta->_param4);
owner->GetHitEnemys(enemys, center, meta->_buff_param4);
for (auto& enemy : enemys) {
if (enemy->IsEntityType(ET_Car)) {
continue;
@ -124,7 +124,7 @@ void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_object
auto itr = hited_objects.find(enemy->GetUniId());
if (itr != hited_objects.end()) {
if ((owner->room->GetFrameNo() - itr->second) * FRAME_RATE_MS <
meta->_int_param5) {
meta->_int_buff_param5) {
continue;
}
}
@ -137,7 +137,7 @@ void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_object
void SprintBuff::OnEnemyHit(Creature* enemy)
{
for (int buff_id : meta->_param3_int_list) {
for (int buff_id : meta->_buff_param3_int_list) {
enemy->TryAddBuff(owner, buff_id);
}
if (skill_meta) {

View File

@ -9,7 +9,7 @@
void SummonObstacleBuff::Activate()
{
if (!owner->dead || meta->dead_valid() != 0) {
owner->SummonObstacle(this, meta->_param1, owner->context_pos);
owner->SummonObstacle(this, meta->_buff_param1, owner->context_pos);
}
}

View File

@ -49,7 +49,7 @@ void TurnOverBuff::Activate()
}
float moved_distance = owner->GetPos().Distance2D2(old_pos);
moved_distance = std::min(moved_distance, 200.0f);
if (!meta->_param1_int_list.empty() && moved_distance > 2.0f) {
if (!meta->_buff_param1_int_list.empty() && moved_distance > 2.0f) {
std::set<Creature*> target_list;
owner->TraverseCreatures
(
@ -75,14 +75,14 @@ void TurnOverBuff::Activate()
target_list.erase(target);
target->room->xtimer.SetTimeoutEx
(
meta->_int_param4 / FRAME_RATE_MS * (i / moved_distance),
meta->_int_buff_param4 / FRAME_RATE_MS * (i / moved_distance),
[this, target] (int event, const a8::Args* args) mutable
{
Creature* c = target;
const mt::Buff* buff_meta = meta;
Entity* caster = c->room->GetEntityByUniId(owner->GetUniId());
if (caster && caster->IsCreature(c->room)) {
for (int buff_id : buff_meta->_param1_int_list) {
for (int buff_id : buff_meta->_buff_param1_int_list) {
c->TryAddBuff((Creature*)caster, buff_id);
}
}
@ -95,10 +95,10 @@ void TurnOverBuff::Activate()
Global::Instance()->verify_set_pos = 0;
owner->room->grid_service->MoveCreature(owner);
}
if (!meta->_param2_int_list.empty()) {
if (!meta->_buff_param2_int_list.empty()) {
owner->room->xtimer.SetTimeoutEx
(
meta->_int_param4 / FRAME_RATE_MS,
meta->_int_buff_param4 / FRAME_RATE_MS,
[this] (int event, const a8::Args* args) mutable
{
Creature* c = owner;
@ -107,8 +107,8 @@ void TurnOverBuff::Activate()
(
[c, buff_meta] (Creature* target, bool& stop)
{
if (c->GetPos().Distance2D2(target->GetPos()) < buff_meta->_int_param3) {
for (int buff_id : buff_meta->_param2_int_list) {
if (c->GetPos().Distance2D2(target->GetPos()) < buff_meta->_int_buff_param3) {
for (int buff_id : buff_meta->_buff_param2_int_list) {
target->TryAddBuffWithTarget(c, buff_id);
}
}

View File

@ -10,7 +10,7 @@
void UseSkillBuff::Activate()
{
Skill* skill = owner->GetSkill(meta->_int_param1);
Skill* skill = owner->GetSkill(meta->_int_buff_param1);
if (skill) {
++skill->force_use_times;
Position target_pos = owner->GetPos();

View File

@ -267,11 +267,11 @@ int Creature::AddBuff(Creature* caster,
buff_meta->buff_id(),
buff_meta->buff_effect(),
buff_meta->name(),
buff_meta->_int_param1,
buff_meta->_int_param2,
buff_meta->_int_param3,
buff_meta->_int_param4,
buff_meta->_int_param5,
buff_meta->_int_buff_param1,
buff_meta->_int_buff_param2,
buff_meta->_int_buff_param3,
buff_meta->_int_buff_param4,
buff_meta->_int_buff_param5,
buff->buff_uniid,
room->xtimer.GetRemainTime(buff->remover_timer)
}));
@ -506,18 +506,18 @@ void Creature::RecalcBuffAttr()
if (buff->meta->buff_effect() == kBET_ChgAttr ||
buff->meta->buff_effect() == kBET_Car ||
buff->meta->buff_effect() == kBET_CrazyMode) {
int attr_type = (int)buff->meta->_param1;
int calc_type = (int)buff->meta->_param2;
int attr_type = (int)buff->meta->_buff_param1;
int calc_type = (int)buff->meta->_buff_param2;
if (IsValidHumanAttr(attr_type)) {
if (calc_type == 1) {
float* p = ability_->GetBuffAttrAbsPtr(attr_type);
if (p) {
*p += buff->meta->_param3;
*p += buff->meta->_buff_param3;
}
} else if (calc_type == 2) {
float* p = ability_->GetBuffAttrRatePtr(attr_type);
if (p) {
*p += buff->meta->_param3;
*p += buff->meta->_buff_param3;
}
}
}
@ -583,11 +583,11 @@ void Creature::OnBuffRemove(Buff& buff)
#if 999
if (buff.meta->buff_id() == 8042) {
if (GetAbility()->GetSpeedRuduceTimes() > 0) {
GetAbility()->DelSpeedRuduce(-buff.meta->_param3/100.0f);
GetAbility()->DelSpeedRuduce(-buff.meta->_buff_param3/100.0f);
}
#ifdef DEBUG
{
a8::XPrintf("移除减速%f\nad", {buff.meta->_param3});
a8::XPrintf("移除减速%f\nad", {buff.meta->_buff_param3});
}
#endif
}
@ -1431,8 +1431,8 @@ void Creature::CheckSpecObject(int new_poly_flags)
void Creature::SummonObstacle(Buff* buff, int id, const Position& target_pos)
{
if (buff->meta->_int_param2 > 0) {
RemoveSurplusObstacle(buff->meta->buff_id(), id, buff->meta->_int_param2);
if (buff->meta->_int_buff_param2 > 0) {
RemoveSurplusObstacle(buff->meta->buff_id(), id, buff->meta->_int_buff_param2);
}
float *p_rotate = nullptr;
float rotate = 0.0f;
@ -2643,7 +2643,7 @@ void Creature::CheckBulletHitHoldShield(IBullet* bullet, bool& eat)
Buff* hold_shield_buff = GetBuffByEffectId(kBET_HoldShield);
if (hold_shield_buff && !bullet->IsBomb() && !dead && this != bullet->GetSender().Get()) {
//param2是距离 param4是宽度
glm::vec3 shield_pos = GetPos().ToGlmVec3() + GetAttackDir() * hold_shield_buff->meta->_param2;
glm::vec3 shield_pos = GetPos().ToGlmVec3() + GetAttackDir() * hold_shield_buff->meta->_buff_param2;
bool ret = Collision::Check2dRotationRectangle
(GetPos().x,
GetPos().y,
@ -2651,7 +2651,7 @@ void Creature::CheckBulletHitHoldShield(IBullet* bullet, bool& eat)
bullet->GetGunMeta()->bullet_rad(),
shield_pos.x,
shield_pos.y,
hold_shield_buff->meta->_param4,
hold_shield_buff->meta->_buff_param4,
mt::Param::s().bullet_planck_step_length,
GetAttackDirRotate() * 180.0f
);

View File

@ -418,13 +418,13 @@ float Human::GetSpeed()
{
Buff* buff = GetBuffByEffectId(kBET_JumpTo);
if (buff) {
return buff->meta->_param2;
return buff->meta->_buff_param2;
}
}
{
Buff* buff = GetBuffByEffectId(kBET_HoldShield);
if (buff) {
return buff->meta->_param1;
return buff->meta->_buff_param1;
}
}
{
@ -436,13 +436,13 @@ float Human::GetSpeed()
{
Buff* buff = GetBuffByEffectId(kBET_BePull);
if (buff) {
return buff->meta->_param2;
return buff->meta->_buff_param2;
}
}
{
Buff* buff = GetBuffByEffectId(kBET_Sprint);
if (buff) {
return buff->meta->_param2;
return buff->meta->_buff_param2;
}
}
float speed = 1.0;
@ -599,7 +599,7 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string& killer_name, i
{
Buff* buff = GetBuffByEffectId(kBET_Shield);
if (buff) {
dec_hp = std::max((float)1.0, dec_hp - buff->meta->_param2);
dec_hp = std::max((float)1.0, dec_hp - buff->meta->_buff_param2);
}
}
if (HasBuffEffect(kBET_Invincible)) {
@ -1853,8 +1853,8 @@ void Human::AdjustDecHp(float old_health, float& new_health)
{
Buff* buff = GetBuffByEffectId(kBET_NewProtect);
if (buff) {
if (new_health < GetMaxHP() * buff->meta->_param1) {
new_health = std::max(GetMaxHP() * buff->meta->_param1, (float)0);
if (new_health < GetMaxHP() * buff->meta->_buff_param1) {
new_health = std::max(GetMaxHP() * buff->meta->_buff_param1, (float)0);
}
}
}
@ -2331,7 +2331,7 @@ void Human::OnBulletHit(IBullet* bullet)
}
{
Buff* buff = GetBuffByEffectId(kBET_Camouflage);
if (buff && buff->meta->_int_param2 == 1) {
if (buff && buff->meta->_int_buff_param2 == 1) {
return;
}
}

View File

@ -10,16 +10,16 @@ namespace mt
void Buff::Init1()
{
_param1 = a8::XValue(buff_param1()).GetDouble();
_param2 = a8::XValue(buff_param2()).GetDouble();
_param3 = a8::XValue(buff_param3()).GetDouble();
_param4 = a8::XValue(buff_param4()).GetDouble();
_param5 = a8::XValue(buff_param5()).GetDouble();
_int_param1 = a8::XValue(buff_param1());
_int_param2 = a8::XValue(buff_param2());
_int_param3 = a8::XValue(buff_param3());
_int_param4 = a8::XValue(buff_param4());
_int_param5 = a8::XValue(buff_param5());
_buff_param1 = a8::XValue(buff_param1()).GetDouble();
_buff_param2 = a8::XValue(buff_param2()).GetDouble();
_buff_param3 = a8::XValue(buff_param3()).GetDouble();
_buff_param4 = a8::XValue(buff_param4()).GetDouble();
_buff_param5 = a8::XValue(buff_param5()).GetDouble();
_int_buff_param1 = a8::XValue(buff_param1());
_int_buff_param2 = a8::XValue(buff_param2());
_int_buff_param3 = a8::XValue(buff_param3());
_int_buff_param4 = a8::XValue(buff_param4());
_int_buff_param5 = a8::XValue(buff_param5());
{
std::vector<std::string> strings;
a8::Split(child_buff(), strings, '|');
@ -38,8 +38,8 @@ namespace mt
std::vector<std::string> strings;
a8::Split(buff_param1(), strings, '|');
for (auto& str : strings) {
_param1_int_list.push_back(a8::XValue(str).GetInt());
_param1_int_set.insert(a8::XValue(str).GetInt());
_buff_param1_int_list.push_back(a8::XValue(str).GetInt());
_buff_param1_int_set.insert(a8::XValue(str).GetInt());
}
}
{
@ -49,22 +49,22 @@ namespace mt
A8_ABORT();
}
for (auto& str : strings) {
_param2_int_list.push_back(a8::XValue(str).GetInt());
_param2_int_set.insert(a8::XValue(str).GetInt());
_buff_param2_int_list.push_back(a8::XValue(str).GetInt());
_buff_param2_int_set.insert(a8::XValue(str).GetInt());
}
}
{
std::vector<std::string> strings;
a8::Split(buff_param3(), strings, '|');
for (auto& str : strings) {
_param3_int_list.push_back(a8::XValue(str).GetInt());
_buff_param3_int_list.push_back(a8::XValue(str).GetInt());
}
}
{
std::vector<std::string> strings;
a8::Split(buff_param4(), strings, '|');
for (auto& str : strings) {
_param4_int_list.push_back(a8::XValue(str).GetInt());
_buff_param4_int_list.push_back(a8::XValue(str).GetInt());
}
}
{
@ -204,7 +204,7 @@ namespace mt
}
}
if (buff_effect() == kBET_CondAddBuff) {
if (!IsValidCondBuff(_int_param1)) {
if (!IsValidCondBuff(_int_buff_param1)) {
A8_ABORT();
}
}
@ -215,8 +215,8 @@ namespace mt
switch (buff_effect()) {
case kBET_ChgAttr:
{
assert(_int_param2 == 1 || _int_param2 == 2);
if (_int_param2 == 2) {
assert(_int_buff_param2 == 1 || _int_buff_param2 == 2);
if (_int_buff_param2 == 2) {
if (buff_param3().find('.') != std::string::npos) {
A8_ABORT();
}
@ -236,16 +236,16 @@ namespace mt
break;
case kBET_DelayAddBuff:
{
assert(_param1 < duration_time());
if (!mt::Buff::GetById(_int_param2)) {
assert(_buff_param1 < duration_time());
if (!mt::Buff::GetById(_int_buff_param2)) {
A8_ABORT();
}
}
break;
case kBET_IntervalAddBuff:
{
assert(_int_param1 < duration_time() * 1000);
if (!mt::Buff::GetById(_int_param2)) {
assert(_int_buff_param1 < duration_time() * 1000);
if (!mt::Buff::GetById(_int_buff_param2)) {
A8_ABORT();
}
}

View File

@ -17,22 +17,22 @@ namespace mt
bool IsImmuneBuffEffect(int buff_effect) const;
bool Match(CondAddBuff_e cond, int val) const;
float _param1 = 0.0f;
float _param2 = 0.0f;
float _param3 = 0.0f;
float _param4 = 0.0f;
float _param5 = 0.0f;
int _int_param1 = 0;
int _int_param2 = 0;
int _int_param3 = 0;
int _int_param4 = 0;
int _int_param5 = 0;
std::vector<int> _param1_int_list;
std::vector<int> _param2_int_list;
std::set<int> _param1_int_set;
std::set<int> _param2_int_set;
std::vector<int> _param3_int_list;
std::vector<int> _param4_int_list;
float _buff_param1 = 0.0f;
float _buff_param2 = 0.0f;
float _buff_param3 = 0.0f;
float _buff_param4 = 0.0f;
float _buff_param5 = 0.0f;
int _int_buff_param1 = 0;
int _int_buff_param2 = 0;
int _int_buff_param3 = 0;
int _int_buff_param4 = 0;
int _int_buff_param5 = 0;
std::vector<int> _buff_param1_int_list;
std::vector<int> _buff_param2_int_list;
std::set<int> _buff_param1_int_set;
std::set<int> _buff_param2_int_set;
std::vector<int> _buff_param3_int_list;
std::vector<int> _buff_param4_int_list;
std::vector<std::tuple<int, std::vector<std::tuple<int, int>>>> _batch_add_list;
std::vector<std::tuple<int, std::vector<int>>> _post_remove_action;
std::set<int> _immune_buffeffect;

View File

@ -607,7 +607,7 @@ void Skill::ProcCMXD()
20,
target_pos.x,
target_pos.y,
shield_buff_meta->_param4,
shield_buff_meta->_buff_param4,
SkillHelper::GetCmxdRange(this_skill_meta),
sender.Get()->GetAttackDirRotate() * 180.0f
);

View File

@ -46,13 +46,13 @@ void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon)
[this, cond, weapon_meta] (Buff* buff, bool& stop)
{
if (weapon_meta->Match((CondAddBuff_e)cond,
buff->meta->_int_param3,
buff->meta->_int_param5)) {
switch (buff->meta->_int_param2) {
buff->meta->_int_buff_param3,
buff->meta->_int_buff_param5)) {
switch (buff->meta->_int_buff_param2) {
case kWeaponOptTakeoff:
case kWeaponOptKeep:
{
RemoveBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
RemoveBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
break;
default:
@ -74,17 +74,17 @@ void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon)
[this, cond, weapon_meta] (Buff* buff, bool& stop)
{
if (weapon_meta->Match((CondAddBuff_e)cond,
buff->meta->_int_param3,
buff->meta->_int_param5)) {
switch (buff->meta->_int_param2) {
buff->meta->_int_buff_param3,
buff->meta->_int_buff_param5)) {
switch (buff->meta->_int_buff_param2) {
case kWeaponOptTakeon:
{
AddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
AddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
break;
case kWeaponOptKeep:
{
TryAddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
TryAddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
break;
default:
@ -107,18 +107,18 @@ void Trigger::Shot(const mt::Equip* weapon_meta)
[this, cond, weapon_meta] (Buff* buff, bool& stop)
{
if (weapon_meta->Match((CondAddBuff_e)cond,
buff->meta->_int_param2,
buff->meta->_int_param5)) {
AddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
buff->meta->_int_buff_param2,
buff->meta->_int_buff_param5)) {
AddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
});
}
{
Buff* buff = owner_->GetBuffByEffectId(kBET_MachineGun);
if (buff && buff->meta->_int_param2 == 1) {
if (buff && buff->meta->_int_buff_param2 == 1) {
auto buff_uniid = buff->buff_uniid;
owner_->room->xtimer.SetTimeoutEx
(buff->meta->_int_param3 / FRAME_RATE_MS,
(buff->meta->_int_buff_param3 / FRAME_RATE_MS,
[this, buff_uniid] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
@ -151,8 +151,8 @@ void Trigger::Kill(Creature* target, int weapon_id)
(kCondBuffKillTarget,
[this] (Buff* buff, bool& stop)
{
if (buff->meta->_int_param2 > 0 && (kill_num_ % buff->meta->_int_param2) == 0) {
AddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
if (buff->meta->_int_buff_param2 > 0 && (kill_num_ % buff->meta->_int_buff_param2) == 0) {
AddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
});
DispatchEvent(kKillEvent, {kill_num_, target, weapon_id});
@ -164,8 +164,8 @@ void Trigger::UseItemAction(int slot_id)
(kCondBuffEatDrug,
[this, slot_id] (Buff* buff, bool& stop)
{
if (buff->meta->_param2_int_set.find(slot_id) != buff->meta->_param2_int_set.end()) {
AddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
if (buff->meta->_buff_param2_int_set.find(slot_id) != buff->meta->_buff_param2_int_set.end()) {
AddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
});
}
@ -176,8 +176,8 @@ void Trigger::UseSkill(Skill* skill)
(kCondBuffUseSkill,
[this, skill] (Buff* buff, bool& stop)
{
if (buff->meta->_int_param2 == skill->meta->skill_id()) {
AddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
if (buff->meta->_int_buff_param2 == skill->meta->skill_id()) {
AddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
});
DispatchEvent(kUseSkillEvent, {skill});
@ -190,27 +190,27 @@ void Trigger::HpChg()
[this] (Buff* buff, bool& stop)
{
bool match = false;
switch (buff->meta->_int_param2) {
switch (buff->meta->_int_buff_param2) {
case kHpOptLeAbs:
{
match = owner_->GetHP() < buff->meta->_int_param3;
match = owner_->GetHP() < buff->meta->_int_buff_param3;
}
break;
case kHpOptLeRate:
{
//match = (owner_->GetHP() / owner_->GetMaxHP() * 100) < buff->meta->_int_param3;
match = owner_->GetHP() / owner_->GetMaxHP() < buff->meta->_param3;
match = owner_->GetHP() / owner_->GetMaxHP() < buff->meta->_buff_param3;
}
break;
case kHpOptGeAbs:
{
match = owner_->GetHP() > buff->meta->_int_param3;
match = owner_->GetHP() > buff->meta->_int_buff_param3;
}
break;
case kHpOptGeRate:
{
//match = (owner_->GetHP() / owner_->GetMaxHP() * 100) > buff->meta->_int_param3;
match = owner_->GetHP() / owner_->GetMaxHP() > buff->meta->_param3;
match = owner_->GetHP() / owner_->GetMaxHP() > buff->meta->_buff_param3;
}
break;
default:
@ -219,9 +219,9 @@ void Trigger::HpChg()
break;
}
if (match) {
TryAddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
TryAddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
} else {
RemoveBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
RemoveBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
});
}
@ -304,7 +304,7 @@ void Trigger::TriggeCondBuffAll(int cond)
(cond,
[this, cond] (Buff* buff, bool& stop)
{
AddBuffs(cond, buff->meta->_param4_int_list);
AddBuffs(cond, buff->meta->_buff_param4_int_list);
});
owner_->context_dir = old_context_dir;
owner_->context_pos = old_context_pos;
@ -318,16 +318,16 @@ void Trigger::ActiveBuff(const mt::Buff* buff_meta)
(cond,
[this, cond, buff_meta] (Buff* buff, bool& stop)
{
if (buff_meta->Match((CondAddBuff_e)cond, buff->meta->_int_param3)) {
switch (buff->meta->_int_param2) {
if (buff_meta->Match((CondAddBuff_e)cond, buff->meta->_int_buff_param3)) {
switch (buff->meta->_int_buff_param2) {
case kBuffOptActive:
{
AddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
AddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
break;
case kBuffOptKeep:
{
TryAddBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
TryAddBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
break;
default:
@ -347,12 +347,12 @@ void Trigger::DeactiveBuff(const mt::Buff* buff_meta)
(cond,
[this, cond, buff_meta] (Buff* buff, bool& stop)
{
if (buff_meta->Match((CondAddBuff_e)cond, buff->meta->_int_param3)) {
switch (buff->meta->_int_param2) {
if (buff_meta->Match((CondAddBuff_e)cond, buff->meta->_int_buff_param3)) {
switch (buff->meta->_int_buff_param2) {
case kBuffOptDeactive:
case kBuffOptKeep:
{
RemoveBuffs(buff->meta->_int_param1, buff->meta->_param4_int_list);
RemoveBuffs(buff->meta->_int_buff_param1, buff->meta->_buff_param4_int_list);
}
break;
default: