This commit is contained in:
aozhiwei 2022-11-22 16:33:26 +08:00
parent c635ef0720
commit 25b8d8b67e
3 changed files with 21 additions and 23 deletions

View File

@ -3446,32 +3446,25 @@ void Human::ProcReliveAction()
return;
}
Human* hum = (Human*)entity;
#if 1
if (hum->action_type == AT_Rescue) {
hum->CancelAction();
}
#else
if (hum->action_type == AT_Rescue) {
hum->CancelAction();
return;
}
#endif
if (!hum->dead && hum->downed) {
SetHP(MetaMgr::Instance()->GetSysParamAsInt("downed_relive_recover_hp"));
hum->downed = false;
if (hum->downed_timer) {
room->xtimer.DeleteTimer(hum->downed_timer);
hum->downed_timer = nullptr;
if (!dead && downed) {
SetHP(MetaMgr::Instance()->GetSysParamAsFloat("downed_relive_recover_hp") * GetMaxHP());
downed = false;
if (downed_timer) {
room->xtimer.DeleteTimer(downed_timer);
downed_timer = nullptr;
}
++hum->stats.rescue_member;
if (hum->guild_id != 0 && hum->guild_id == guild_id) {
++hum->stats.rescue_guild_member;
}
if (hum->GetBuffById(kDownBuffId)) {
hum->RemoveBuffById(kDownBuffId);
if (GetBuffById(kDownBuffId)) {
RemoveBuffById(kDownBuffId);
}
}
hum->SyncAroundPlayers(__FILE__, __LINE__, __func__);
SyncAroundPlayers(__FILE__, __LINE__, __func__);
}
void Human::OnBuffRemove(Buff& buff)

View File

@ -697,18 +697,18 @@ void Player::HumanInteraction(Human* hum)
int downed_relive_time = MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000;
downed_relive_time -= GetAbility()->GetAttrAbs(kHAT_RescueTime);
downed_relive_time = std::max(0, downed_relive_time);
hum->StartAction(
AT_Rescue,
downed_relive_time,
room->GetFrameNo(),
GetUniId()
);
StartAction(
AT_Relive,
AT_Rescue,
downed_relive_time,
room->GetFrameNo(),
hum->GetUniId()
);
hum->StartAction(
AT_Relive,
downed_relive_time,
room->GetFrameNo(),
GetUniId()
);
TryAddBuff(this, kRescuerBuffId);
hum->TryAddBuff(this, kInRescueBuffId);
}

View File

@ -4104,6 +4104,11 @@ void Room::AddTeam(class MatchTeam* team)
hum->RefreshView();
}
new_team->AddMember(hum);
#ifdef DEBUG1
if (!f8::IsTestEnv()) {
hum->SetHP(50);
}
#endif
} else {
Player* hum = NewPlayer();
hum->proto_version = msg.proto_version();