This commit is contained in:
aozhiwei 2024-04-18 11:43:38 +08:00
parent 4cb1ac466a
commit c5d61bbea8

View File

@ -1764,35 +1764,35 @@ void Creature::CheckSpecObject(int new_poly_flags)
}
}
}
if ((1 << i) == SAMPLE_POLYFLAGS_MAGMA) {
if (a8::HasBitFlag(poly_ext_flags_, i)) {
ClearBuffById(kInMagmaBuffId);
} else {
int buff_uniid = TryAddBuffAndSetTime(this, kInMagmaBuffId, 9999999);
Buff* buff = GetBuffByUniId(buff_uniid);
if (buff) {
int dur_time = 1000;
room->xtimer.SetIntervalEx
(
dur_time / FRAME_RATE_MS,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!dead) {
float dmg = GetMaxHP() * mt::Param::s().magma_dec_hp_rate;
float dmg_out = 0.0f;
DecHP(dmg, VP_Magma,
TEXT("battle_server_killer_magma", "magma"), VW_Magma,
VP_Magma,
TEXT("battle_server_killer_magma", "magma"),
dmg_out,
0,
0);
}
}//endif
if ((1 << i) == SAMPLE_POLYFLAGS_MAGMA) {
if (a8::HasBitFlag(poly_ext_flags_, i)) {
ClearBuffById(kInMagmaBuffId);
} else {
int buff_uniid = TryAddBuffAndSetTime(this, kInMagmaBuffId, 9999999);
Buff* buff = GetBuffByUniId(buff_uniid);
if (buff) {
int dur_time = 1000;
room->xtimer.SetIntervalEx
(
dur_time / FRAME_RATE_MS,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!dead) {
float dmg = GetMaxHP() * mt::Param::s().magma_dec_hp_rate;
float dmg_out = 0.0f;
DecHP(dmg, VP_Magma,
TEXT("battle_server_killer_magma", "magma"), VW_Magma,
VP_Magma,
TEXT("battle_server_killer_magma", "magma"),
dmg_out,
0,
0);
}
},
&buff->xtimer_attacher);
}
}
},
&buff->xtimer_attacher);
}
}
}