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; return;
} }
Human* hum = (Human*)entity; Human* hum = (Human*)entity;
#if 1
if (hum->action_type == AT_Rescue) { if (hum->action_type == AT_Rescue) {
hum->CancelAction(); hum->CancelAction();
} }
#else if (!dead && downed) {
if (hum->action_type == AT_Rescue) { SetHP(MetaMgr::Instance()->GetSysParamAsFloat("downed_relive_recover_hp") * GetMaxHP());
hum->CancelAction(); downed = false;
return; if (downed_timer) {
} room->xtimer.DeleteTimer(downed_timer);
#endif downed_timer = nullptr;
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;
} }
++hum->stats.rescue_member; ++hum->stats.rescue_member;
if (hum->guild_id != 0 && hum->guild_id == guild_id) { if (hum->guild_id != 0 && hum->guild_id == guild_id) {
++hum->stats.rescue_guild_member; ++hum->stats.rescue_guild_member;
} }
if (hum->GetBuffById(kDownBuffId)) { if (GetBuffById(kDownBuffId)) {
hum->RemoveBuffById(kDownBuffId); RemoveBuffById(kDownBuffId);
} }
} }
hum->SyncAroundPlayers(__FILE__, __LINE__, __func__); SyncAroundPlayers(__FILE__, __LINE__, __func__);
} }
void Human::OnBuffRemove(Buff& buff) 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; int downed_relive_time = MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000;
downed_relive_time -= GetAbility()->GetAttrAbs(kHAT_RescueTime); downed_relive_time -= GetAbility()->GetAttrAbs(kHAT_RescueTime);
downed_relive_time = std::max(0, downed_relive_time); downed_relive_time = std::max(0, downed_relive_time);
hum->StartAction(
AT_Rescue,
downed_relive_time,
room->GetFrameNo(),
GetUniId()
);
StartAction( StartAction(
AT_Relive, AT_Rescue,
downed_relive_time, downed_relive_time,
room->GetFrameNo(), room->GetFrameNo(),
hum->GetUniId() hum->GetUniId()
); );
hum->StartAction(
AT_Relive,
downed_relive_time,
room->GetFrameNo(),
GetUniId()
);
TryAddBuff(this, kRescuerBuffId); TryAddBuff(this, kRescuerBuffId);
hum->TryAddBuff(this, kInRescueBuffId); hum->TryAddBuff(this, kInRescueBuffId);
} }

View File

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