This commit is contained in:
aozhiwei 2023-11-27 19:05:15 +08:00
parent ab3cc5c643
commit 65802d0bf8
4 changed files with 0 additions and 82 deletions

View File

@ -16,7 +16,6 @@ enum CreatureStatus
CS_PreDieSuspended,
CS_DeadNoDrop,
CS_Reviving,
CS_CrazeMode,
CS_DisableAttackAndroid,
CS_NoDie,
CS_End
@ -132,7 +131,6 @@ class Creature : public MoveableEntity
long long skill_hold_start_frameno = 0;
a8::XTimerWp remove_shot_hold_timer;
a8::XTimerWp craze_mode_timer;
a8::XTimerWp nature_recover_hp_idle_timer;
int side = 0;

View File

@ -168,13 +168,6 @@ void Human::CarShot(const glm::vec3& target_dir)
void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id,
int real_killer_id, const std::string& real_killer_name)
{
#ifdef MYDEBUG
{
if (a8::HasBitFlag(status, CS_CrazeMode)) {
int i = 0;
}
}
#endif
if (!dead && !room->IsGameOver() && !real_dead && !a8::HasBitFlag(status, CS_PreDieSuspended)) {
GetTrigger()->PreDie(killer_id, weapon_id);
#ifdef MYDEBUG

View File

@ -520,7 +520,6 @@ void Incubator::ShowHand()
room->EnableHuman(hum);
hum->MustBeAddBuff(hum, kTraceBuffId);
a8::SetBitFlag(hum->status, CS_CrazeMode);
a8::SetBitFlag(hum->status, CS_DisableAttackAndroid);
}
room->xtimer.SetIntervalEx

View File

@ -2923,78 +2923,6 @@ void Room::OnBattleStart()
}
}
battle_starting_ = false;
if (IsMiniMap() || IsNewerMap()) {
xtimer.SetIntervalEx
(
SERVER_FRAME_RATE * 10,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
int keep_num = 0;
if (IsMiniMap()) {
keep_num = 2;
Player* hum = GetOneAlivePlayer();
if (hum && hum->GetBattleContext()->GetHeroLevel() > 5) {
keep_num = 3;
}
} else if (IsNewerMap()) {
keep_num = 1;
}
std::set<Human*> humans;
for (auto& pair : alive_human_hash_) {
if (keep_num <= 0) {
break;
}
if (a8::HasBitFlag(pair.second->status, CS_CrazeMode)) {
--keep_num;
} else {
humans.insert(pair.second);
}
}
std::map<int, Human*> players = alive_player_hash_;
while (keep_num > 0) {
Human* target = nullptr;
if (!players.empty()) {
for (auto& pair : players) {
target = pair.second;
break;
}
}
Human* craze_hum = nullptr;
if (target) {
for (auto& itr : humans) {
if (itr->IsPlayer() || itr->GetTeam()->HasPlayer()) {
continue;
}
if (!craze_hum) {
craze_hum = itr;
} else {
if (craze_hum->GetPos().ManhattanDistance2D(target->GetPos()) >
itr->GetPos().ManhattanDistance2D(target->GetPos())) {
craze_hum = itr;
}
}
}
players.erase(target->GetUniId());
} else {
for (auto& itr : humans) {
craze_hum = itr;
break;
}
}
if (craze_hum) {
a8::SetBitFlag(craze_hum->status, CS_CrazeMode);
humans.erase(craze_hum);
#ifdef MYDEBUG
a8::XPrintf("craze huamn :%s\n", {craze_hum->name});
#endif
}
--keep_num;
}
}
},
&xtimer_attacher_);
}
}
void Room::AddTeam(class MatchTeam* team)