Beispiel #1
0
void checkup(void)
{
    struct ship *sp, *sq;
    char explode, sink;

    foreachship(sp) {
	if (sp->file->dir == 0)
	    continue;
	explode = sp->file->explode;
	sink = sp->file->sink;
	if (explode != 1 && sink != 1)
	    continue;
	if (dieroll() < 5)
	    continue;
	Write(sink == 1 ? W_SINK : W_EXPLODE, sp, 2, 0, 0, 0);
	Write(W_DIR, sp, 0, 0, 0, 0);
	if (snagged(sp))
	    foreachship(sq)
		cleansnag(sp, sq, 1);
	if (sink != 1) {
	    makemsg(sp, "exploding!");
	    foreachship(sq) {
		if (sp != sq && sq->file->dir && range(sp, sq) < 4)
		    table(sp, sq, RIGGING, L_EXPLODE, sp->specs->guns / 13, 6);
	    }
	} else
Beispiel #2
0
void
grap(struct ship *from, struct ship *to)
{
	if (capship(from)->nationality != capship(to)->nationality && dieroll() > 2)
		return;
	Write(W_GRAP, from, to->file->index, 0, 0, 0);
	Write(W_GRAP, to, from->file->index, 0, 0, 0);
	makesignal(from, "grappled with $$", to);
}
Beispiel #3
0
/*
 * Get the racial history, and social class, using the "history charts".
 */
static void get_history_aux(void)
{
	int i, chart, roll;

	/* Clear the previous history strings */
	p_ptr->history[0] = '\0';

	/* Starting place */
	chart = rp_ptr->hist;

	/* Process the history */
	while (chart)
	{
		/* Start over */
		i = 0;

		/* Roll for nobility */
		roll = dieroll(100);

		/* Get the proper entry in the table */
		while ((chart != h_info[i].chart))  i++;
		
		if (h_info[i].house)
		{
			while ((p_ptr->phouse != h_info[i].house) && h_info[i].house) i++;
		}

		while (roll > h_info[i].roll) i++;

		/* Get the textual history */
		my_strcat(p_ptr->history, (h_text + h_info[i].text), sizeof(p_ptr->history));

		/* Add a space */
		my_strcat(p_ptr->history, " ", sizeof(p_ptr->history));

		/* Enter the next chart */
		chart = h_info[i].next;
	}

	/* Save the social class */
	p_ptr->sc = 1;
}