添加开始游戏两秒等待
This commit is contained in:
parent
f1997b657a
commit
537cd919f6
@ -90,6 +90,9 @@ void AndroidAI::ChangeToState(AndroidState_e to_state)
|
||||
void AndroidAI::DoMove()
|
||||
{
|
||||
Human* hum = (Human*)owner;
|
||||
if (hum->room->waiting_start) {
|
||||
return;
|
||||
}
|
||||
if (a8::HasBitFlag(hum->status, HS_Fly)) {
|
||||
return;
|
||||
}
|
||||
@ -114,6 +117,9 @@ void AndroidAI::DoMove()
|
||||
void AndroidAI::DoAttack()
|
||||
{
|
||||
Human* hum = (Human*)owner;
|
||||
if (hum->room->waiting_start) {
|
||||
return;
|
||||
}
|
||||
if (a8::HasBitFlag(hum->status, HS_Fly) ||
|
||||
a8::HasBitFlag(hum->status, HS_Jump)) {
|
||||
return;
|
||||
|
@ -101,7 +101,9 @@ void Player::UpdateMove()
|
||||
if (action_type == AT_Relive) {
|
||||
CancelAction();
|
||||
}
|
||||
if (dead || a8::HasBitFlag(status, HS_Fly)) {
|
||||
if (dead ||
|
||||
room->waiting_start ||
|
||||
a8::HasBitFlag(status, HS_Fly)) {
|
||||
moving = false;
|
||||
moved_frames = 0;
|
||||
last_collision_door = nullptr;
|
||||
@ -131,6 +133,7 @@ void Player::UpdateMove()
|
||||
void Player::UpdateShot()
|
||||
{
|
||||
if (dead ||
|
||||
room->waiting_start ||
|
||||
a8::HasBitFlag(status, HS_Fly) ||
|
||||
a8::HasBitFlag(status, HS_Jump) ) {
|
||||
shot_start = false;
|
||||
|
@ -1610,4 +1610,14 @@ void Room::NotifyGameStart()
|
||||
for (auto& pair : accountid_hash_) {
|
||||
pair.second->SendNotifyMsg(msg);
|
||||
}
|
||||
waiting_start = true;
|
||||
xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 2,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
room->waiting_start = false;
|
||||
},
|
||||
&xtimer_attacher.timer_list_);
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
long long pending_request = 0;
|
||||
long long last_debugout_tick = 0;
|
||||
a8::Vec2 last_player_jump_pos;
|
||||
bool waiting_start = false;
|
||||
|
||||
~Room();
|
||||
void Init();
|
||||
|
Loading…
x
Reference in New Issue
Block a user