添加眩晕处理

This commit is contained in:
aozhiwei 2020-07-29 17:32:53 +08:00
parent ac15c56895
commit adfbf7e7c3
4 changed files with 19 additions and 3 deletions

View File

@ -131,6 +131,7 @@ enum BuffEffectType_e
kBET_Pull = 12, //拉人(主动方) kBET_Pull = 12, //拉人(主动方)
kBET_Terminator = 13, //终结者模式 kBET_Terminator = 13, //终结者模式
kBET_PlayShotAni = 14, //播放射击动画 kBET_PlayShotAni = 14, //播放射击动画
kBET_Vertigo = 15, //眩晕
kBET_End kBET_End
}; };

View File

@ -127,6 +127,9 @@ void Player::UpdateMove()
SetLastCollisionDoor(nullptr); SetLastCollisionDoor(nullptr);
return; return;
} }
if (HasBuffEffect(kBET_Vertigo)) {
return;
}
if (HasBuffEffect(kBET_Camouflage)) { if (HasBuffEffect(kBET_Camouflage)) {
RemoveBuffByEffectId(kBET_Camouflage); RemoveBuffByEffectId(kBET_Camouflage);
} }
@ -163,6 +166,9 @@ void Player::UpdateShot()
series_shot_frames = 0; series_shot_frames = 0;
return; return;
} }
if (HasBuffEffect(kBET_Vertigo)) {
return;
}
if (shot_start) { if (shot_start) {
shot_start = false; shot_start = false;
Shot(); Shot();
@ -317,6 +323,9 @@ void Player::UpdateGetDown()
void Player::UpdateUseSkill() void Player::UpdateUseSkill()
{ {
if (HasBuffEffect(kBET_Vertigo)) {
return;
}
DoSkill(); DoSkill();
} }

View File

@ -1986,7 +1986,7 @@ long long Room::GetGasInactiveTime()
if (room_mode_ == kZombieMode) { if (room_mode_ == kZombieMode) {
#if DEBUG #if DEBUG
if (f8::IsTestEnv()) { if (f8::IsTestEnv()) {
return MetaMgr::Instance()->zbmode_gas_inactive_time; return MetaMgr::Instance()->zbmode_gas_inactive_time + 10000;
} else { } else {
return 5; return 5;
} }
@ -2661,8 +2661,8 @@ void Room::AddPlayerPostProc(Player* hum)
RandRemoveAndroid(); RandRemoveAndroid();
} }
if (GetRoomMode() == kZombieMode) { if (GetRoomMode() == kZombieMode) {
#if 0 #if 1
hum->ChangeToRace(kZombieRace, 1); hum->ChangeToRace(kZombieRace, 2);
#else #else
hum->ChangeToRace(kHumanRace, 1); hum->ChangeToRace(kHumanRace, 1);
#endif #endif

View File

@ -176,6 +176,9 @@ void ZombieModeAI::UpdateThinking()
void ZombieModeAI::UpdateAttack() void ZombieModeAI::UpdateAttack()
{ {
Human* myself = (Human*)owner; Human* myself = (Human*)owner;
if (hum->HasBuffEffect(kBET_Vertigo)) {
return;
}
if (!node_->target || node_->target->dead) { if (!node_->target || node_->target->dead) {
ChangeToState(ZSE_Thinking); ChangeToState(ZSE_Thinking);
return; return;
@ -263,6 +266,9 @@ void ZombieModeAI::UpdatePursuit()
void ZombieModeAI::DoMove() void ZombieModeAI::DoMove()
{ {
Human* hum = (Human*)owner; Human* hum = (Human*)owner;
if (hum->HasBuffEffect(kBET_Vertigo)) {
return;
}
if (std::abs(hum->move_dir.x) > FLT_EPSILON || if (std::abs(hum->move_dir.x) > FLT_EPSILON ||
std::abs(hum->move_dir.y) > FLT_EPSILON) { std::abs(hum->move_dir.y) > FLT_EPSILON) {
hum->on_move_collision = hum->on_move_collision =