#ifndef lint
static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/subs/bsanct.c,v 2.1 1995/07/28 00:57:59 empire Exp $";
#endif

/*
 * bsanct.c
 *
 * from PSL Empire, 1985
 */

#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "nsc.h"
#include "nat.h"
#include "news.h"
#include "path.h"
#include "file.h"
#include "deity.h"

void
bsanct()
{
	register int count;
	struct	sctstr s;
	struct  nstr_sect nstr;

	if (player->god)
		return;
	count = 0;
	snxtsct(&nstr, "*");
	while (nxtsct(&nstr, &s)) {
		if (!player->owner)
			continue;
		if (s.sct_type != SCT_SANCT)
			continue;
		pr("%s is no longer a sanctuary.\n",
			xyas(s.sct_x, s.sct_y, player->cnum));
		if (s.sct_effic == 100) {
			s.sct_type = SCT_CAPIT;
			s.sct_newtype = SCT_CAPIT;
		} else {
			s.sct_type = SCT_HIWAY;
			s.sct_newtype = SCT_HIWAY;
		}
		(void) putsect(&s);
		count++;
	}
	if (count > 0)
		nreport(player->cnum, N_BROKE_SANCT, 0, 1);
}
