This commit is contained in:
aozhiwei 2024-02-27 15:14:07 +08:00
parent 150b4940db
commit eef264dec4
2 changed files with 21 additions and 2 deletions

View File

@ -15,17 +15,29 @@ void SelectTargetWithSelfPosBuff::Activate()
hold_param3_ = meta->GetBuffParam3(this);
hold_param4_ = meta->GetBuffParam4(this);
std::vector<Creature*> targets;
bool include_car = false;
bool exclude_passenger = false;
if (meta->_buff_param8_int_set.empty()) {
include_car = meta->_buff_param8_int_set.find(1) != meta->_buff_param8_int_set.end();
exclude_passenger = meta->_buff_param8_int_set.find(2) != meta->_buff_param8_int_set.end();
}
owner->TraverseCreatures
(
[this, &targets] (Creature* c, bool& stop)
[this, &targets, include_car, exclude_passenger] (Creature* c, bool& stop)
{
if (c->dead ||
c->IsCar() ||
(c->IsCar() && !include_car) ||
a8::HasBitFlag(c->status, CS_Disable) ||
c->HasBuffEffect(kBET_Dive)
) {
return;
}
if (exclude_passenger) {
if (c->HasBuffEffect(kBET_Driver) &&
c->HasBuffEffect(kBET_Passenger)) {
return;
}
}
float distance = owner->GetPos().Distance2D2(c->GetPos());
float angle = 0.0f;
if (distance > 0.0001f) {

View File

@ -376,6 +376,13 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
}
Creature* killer = room->GetCreatureByUniId(real_killer_id);
if (killer && real_dmg_out > 0.999) {
if (!nature_recover_hp_idle_timer.expired()) {
room->xtimer.FireEvent
(
nature_recover_hp_idle_timer,
kRemoveNatureRecoverTimerEvent,
nullptr);
}
if (killer->IsHuman()) {
room->frame_event.AddPropChgEx
(