void playsingle_controller::after_human_turn()
{
	team& current_team = teams_[player_number_ - 1];

	// add cards if in card mode
	if (card_mode_) {
		execute_card_bh(turn(), player_number_);
	}
	do_commoner(current_team);

	// clear access troops
	gui_->refresh_access_troops(player_number_ - 1, game_display::REFRESH_CLEAR);
	gui_->refresh_access_heros(player_number_ - 1, game_display::REFRESH_CLEAR);
	// hide context-menu
	gui_->hide_context_menu(NULL, true);

	// Mark the turn as done.
	browse_ = true;
	end_turn_record();
	end_turn_record_unlock();
	menu_handler_.clear_undo_stack(player_number_);

	if (current_team.uses_fog()) {
		// needed because currently fog is only recalculated when a hex is /un/covered
		recalculate_fog(player_number_);
	}

	// Clear moves from the GUI.
	gui_->set_route(NULL);
	gui_->unhighlight_reach();
}
示例#2
0
void playmp_controller::after_human_turn(){
	if ( gamestate_.mp_settings().mp_countdown ){
		const int action_increment = gamestate_.mp_settings().mp_countdown_action_bonus;
		const int maxtime = gamestate_.mp_settings().mp_countdown_reservoir_time;
		int secs = (current_team().countdown_time() / 1000) + gamestate_.mp_settings().mp_countdown_turn_bonus;
		secs += action_increment  * current_team().action_bonus_count();
		current_team().set_action_bonus_count(0);
		secs = (secs > maxtime) ? maxtime : secs;
		current_team().set_countdown_time(1000 * secs);
		recorder.add_countdown_update(current_team().countdown_time(),player_number_);
	}
	LOG_NG << "playmp::after_human_turn...\n";
	end_turn_record();

	//ensure that turn_data_ is constructed before it is used.
	if (turn_data_ == NULL) init_turn_data();

	//send one more time to make sure network is up-to-date.
	playsingle_controller::after_human_turn();
	turn_data_->send_data();
	if (turn_data_ != NULL){
		turn_data_->host_transfer().detach_handler(this);
		delete turn_data_;
		turn_data_ = NULL;
	}

}
示例#3
0
void playsingle_controller::after_human_turn()
{
	// Mark the turn as done.
	browse_ = true;
	end_turn_record();
	end_turn_record_unlock();

	// Clear moves from the GUI.
	gui_->set_route(NULL);
	gui_->unhighlight_reach();
}
void playsingle_controller::after_human_turn(){
	browse_ = true;
	end_turn_record();
	end_turn_record_unlock();
	menu_handler_.clear_undo_stack(player_number_);

	if(teams_[player_number_-1].uses_fog()) {
		// needed because currently fog is only recalculated when a hex is /un/covered
		recalculate_fog(player_number_);
	}

	gui_->set_route(NULL);
	gui_->unhighlight_reach();
}