This commit is contained in:
aozhiwei 2021-07-07 13:40:31 +00:00
parent 084f8eb9a5
commit bc585e9467
3 changed files with 7 additions and 4 deletions

View File

@ -407,7 +407,7 @@ void Creature::RecalcBuffAttr()
}
}
}
if (buff.add_frameno == room->GetFrameNo() ||
if (buff.add_frameno == room->GetFrameNo() &&
attr_type == kHAT_MaxHp) {
need_refresh_hp = true;
}
@ -1186,9 +1186,6 @@ void Creature::StartAction(ActionType_e action_type,
if (HasBuffEffect(kBET_Camouflage)) {
RemoveBuffByEffectId(kBET_Camouflage);
}
if (action_type == AT_Rescue) {
TryAddBuff(this, kRescueBuffId);
}
}
void Creature::CancelAction()

View File

@ -781,6 +781,7 @@ void Player::HumanInteraction(Human* hum)
if (hum->GetActionType() == AT_Rescue) {
return;
}
hum->TryAddBuff(this, kRescueBuffId);
int downed_relive_time = MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000;
downed_relive_time -= GetAbility()->GetAttrAbs(kHAT_RescueTime);
downed_relive_time = std::max(1000, downed_relive_time);

View File

@ -213,12 +213,17 @@ void Trigger::TraverseCondBuffs(int cond, std::function<void (Buff*, bool&)> fun
void Trigger::TriggeCondBuffAll(int cond)
{
std::shared_ptr<Ability> old_context_ability = owner_->context_ability;
a8::Vec2 old_context_pos = owner_->context_pos;
owner_->context_pos = owner_->GetPos();
TraverseCondBuffs
(cond,
[this, cond] (Buff* buff, bool& stop)
{
AddBuffs(cond, buff->meta->param4_int_list);
});
owner_->context_pos = old_context_pos;
owner_->context_ability = old_context_ability;
}
void Trigger::ActiveBuff(MetaData::Buff* buff_meta)