Esempio n. 1
0
/*
 * Handle character death
 */
void death_screen(void)
{
	bool done = FALSE;
	const region area = { 51, 2, 0, N_ELEMENTS(death_actions) };

	/* Retire in the town in a good state */
	if (p_ptr->total_winner)
	{
		p_ptr->depth = 0;
		my_strcpy(p_ptr->died_from, "Ripe Old Age", sizeof(p_ptr->died_from));
		p_ptr->exp = p_ptr->max_exp;
		p_ptr->lev = p_ptr->max_lev;
		p_ptr->au += 10000000L;

		display_winner();
	}

	/* Get time of death */
	(void)time(&death_time);
	print_tomb();
	death_knowledge();
	enter_score(&death_time);

	/* Flush all input and output */
	flush();
	message_flush();

	/* Display and use the death menu */
	if (!death_menu)
	{
		death_menu = menu_new_action(death_actions,
				N_ELEMENTS(death_actions));

		death_menu->flags = MN_CASELESS_TAGS;
	}

	menu_layout(death_menu, &area);

	while (!done)
	{
		ui_event e = menu_select(death_menu, EVT_KBRD);
		if (e.type == EVT_KBRD)
		{
			if (e.key.code == KTRL('X')) break;
		}
		else if (e.type == EVT_SELECT)
		{
			done = get_check("Do you want to quit? ");
		}
	}

	/* Save dead player */
	if (!savefile_save(savefile))
	{
		msg("death save failed!");
		message_flush();
	}
}
Esempio n. 2
0
/**
 * Handle character death
 */
void death_screen(void)
{
    const region area = { 51, 2, 0, N_ELEMENTS(death_actions) };

    /* Dump bones file */
    make_bones();

    /* Handle retirement */
    if (p_ptr->total_winner)
	kingly();

    /* Save dead player */
    if (!old_save())
    {
	msg_print("death save failed!");
	message_flush();
    }

    /* Get time of death */
#ifdef _WIN32_WCE
    {
	unsigned long fake_time(unsigned long *fake_time_t);
	fake_time(&death_time);
    }
#else
    (void) time(&death_time);
#endif

    /* You are dead */
    print_tomb();

    /* Hack - Know everything upon death */
    death_knowledge();

    /* Enter player in high score list */
    enter_score(&death_time);

    /* Flush all input keys */
    flush();

    /* Flush messages */
    msg_print(NULL);

    if (!death_menu)
    {
	death_menu = menu_new_action(death_actions,
				     N_ELEMENTS(death_actions));

	death_menu->flags = MN_CASELESS_TAGS;
    }

    menu_layout(death_menu, &area);

    do
    {
	menu_select(death_menu, 0);
    } while (!get_check("Do you want to quit? "));
}
Esempio n. 3
0
/*
 * Handle character death
 */
void death_screen(void)
{
	const region area = { 51, 2, 0, N_ELEMENTS(death_actions) };

	/* Retire in the town in a good state */
	if (p_ptr->total_winner)
	{
		p_ptr->depth = 0;
		my_strcpy(p_ptr->died_from, "Ripe Old Age", sizeof(p_ptr->died_from));
		p_ptr->exp = p_ptr->max_exp;
		p_ptr->lev = p_ptr->max_lev;
		p_ptr->au += 10000000L;

		display_winner();
	}

	/* Save dead player */
	if (!savefile_save(savefile))
	{
		msg("death save failed!");
		message_flush();
	}

	/* Get time of death */
	(void)time(&death_time);
	print_tomb();
	death_knowledge();
	enter_score(&death_time);

	/* Flush all input and output */
	flush();
	message_flush();



	if (!death_menu)
	{
		death_menu = menu_new_action(death_actions,
				N_ELEMENTS(death_actions));

		death_menu->flags = MN_CASELESS_TAGS;
	}

	menu_layout(death_menu, &area);

	do
	{
		menu_select(death_menu, 0);
	} while (!get_check("Do you want to quit? "));
}
Esempio n. 4
0
void player_death(void)
{
    /* Try to make a player ghost template */
    add_player_ghost_entry();

    /* Retire in the town in a good state */
    if (p_ptr->total_winner)
    {
        p_ptr->depth = 0;
        p_ptr->died_from = "Ripe Old Age";
        p_ptr->exp = p_ptr->max_exp;
        p_ptr->lev = p_ptr->max_lev;
        p_ptr->au += 10000000L;

        display_winner();
    }

    QDate today = QDate::currentDate();
    QTime right_now = QTime::currentTime();
    QString long_day = QString("%1 at %2") .arg(today.toString()) .arg(right_now.toString());

    write_death_note(long_day);

    print_tomb();
    death_knowledge();
    enter_score(long_day);

    /* Save dead player */
    if (!save_player())
    {
        message(QString("death save failed!"));
    }

    // Hack - update everything onscreen
    ui_redraw_all();

    // Automatic character dump
    if (death_char_dump)
    {
        save_character_file();
        save_screenshot(FALSE);
    }

    p_ptr->in_death_menu = TRUE;
    PlayerDeathDialog();
    p_ptr->in_death_menu = FALSE;
}
Esempio n. 5
0
/**
 * Handle character death
 */
void death_screen(void)
{
	struct menu *death_menu;
	bool done = false;
	const region area = { 51, 2, 0, N_ELEMENTS(death_actions) };

	/* Winner */
	if (player->total_winner)
	{
		display_winner();
	}

	/* Tombstone */
	print_tomb();

	/* Flush all input and output */
	event_signal(EVENT_INPUT_FLUSH);
	event_signal(EVENT_MESSAGE_FLUSH);

	/* Display and use the death menu */
	death_menu = menu_new_action(death_actions,
			N_ELEMENTS(death_actions));

	death_menu->flags = MN_CASELESS_TAGS;

	menu_layout(death_menu, &area);

	while (!done)
	{
		ui_event e = menu_select(death_menu, EVT_KBRD, false);
		if (e.type == EVT_KBRD)
		{
			if (e.key.code == KTRL('X')) break;
		}
		else if (e.type == EVT_SELECT)
		{
			done = get_check("Do you want to quit? ");
		}
	}

	menu_free(death_menu);
}