This commit is contained in:
aozhiwei 2024-04-10 15:07:41 +08:00
parent d8b1d6484d
commit f4c7f5dd38
4 changed files with 30 additions and 0 deletions

View File

@ -967,6 +967,12 @@ void Creature::DoSkill(int skill_id,
kRemoveNatureRecoverTimerEvent,
nullptr);
}
if (HaveBallingEnemy()) {
last_battling_frameno = room->GetFrameNo();
if (!battling_grass_hide_delay_timer.expired()) {
room->xtimer.ResetTimer(battling_grass_hide_delay_timer);
}
}
if (skill->GetMinorType()) {
auto old_context_dir = context_dir;
auto old_context_pos = context_pos;

View File

@ -385,6 +385,10 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
kRemoveNatureRecoverTimerEvent,
nullptr);
}
last_battling_frameno = room->GetFrameNo();
if (!battling_grass_hide_delay_timer.expired()) {
room->xtimer.ResetTimer(battling_grass_hide_delay_timer);
}
bool only_self = !room->IsMobaModeRoom();
if (killer->IsHuman()) {
room->frame_event.AddPropChgEx
@ -2346,6 +2350,10 @@ void Human::OnBulletHit(IBullet* bullet)
kRemoveNatureRecoverTimerEvent,
nullptr);
}
last_battling_frameno = room->GetFrameNo();
if (!battling_grass_hide_delay_timer.expired()) {
room->xtimer.ResetTimer(battling_grass_hide_delay_timer);
}
GetTrigger()->Attacked(bullet->GetSender().Get());
if (!dead && (bullet->IsBomb() || bullet->GetSender().Get()->team_id != team_id)) {
float finaly_dmg = 0;
@ -2519,6 +2527,10 @@ void Human::OnExplosionHit(Explosion* e)
kRemoveNatureRecoverTimerEvent,
nullptr);
}
last_battling_frameno = room->GetFrameNo();
if (!battling_grass_hide_delay_timer.expired()) {
room->xtimer.ResetTimer(battling_grass_hide_delay_timer);
}
float finaly_dmg = GetNetData()->CalcDmg(e);
#if 1
{

View File

@ -2982,6 +2982,12 @@ int Creature::Throw(int slot, const glm::vec3& bomb_pos, const glm::vec3& bomb_d
kRemoveNatureRecoverTimerEvent,
nullptr);
}
if (HaveBallingEnemy()) {
last_battling_frameno = room->GetFrameNo();
if (!battling_grass_hide_delay_timer.expired()) {
room->xtimer.ResetTimer(battling_grass_hide_delay_timer);
}
}
--weapon.ammo;
room->frame_event.AddPropChgEx
(

View File

@ -556,6 +556,12 @@ void InternalShot(Creature* c,
kRemoveNatureRecoverTimerEvent,
nullptr);
}
if (c->HaveBallingEnemy()) {
c->last_battling_frameno = c->room->GetFrameNo();
if (!c->battling_grass_hide_delay_timer.expired()) {
c->room->xtimer.ResetTimer(c->battling_grass_hide_delay_timer);
}
}
if (c->aiming) {
c->aiming = false;
c->aiming_frameno = 0;