Beispiel #1
0
void addNewNebula(dbref executor, int index, const char* name, double radius, double x, double y, double z, char *buff, char **bp)
{
	aspace_borders* newNebula;
	newNebula = im_find(nebula_map, index);
	
	if (newNebula != NULL) {
		safe_str("#-1 NEBULA # ALREADY IN USE", buff, bp);
		return;
	}
		
	newNebula = mush_malloc(sizeof(aspace_borders), "nebula_info");
	
	newNebula->name = mush_strdup(name, "spacenebula_name");
	newNebula->empire_id = 0;
	newNebula->radius = radius;
	newNebula->x = x;
	newNebula->y = y;
	newNebula->z = z;
	
	if( im_insert(nebula_map, index, newNebula )) {
		safe_str("New nebula Created.", buff, bp);
		write_spacelog(executor, executor, tprintf("Nebula Created: %s", newNebula->name));
	} else
		safe_str("#-1 NEBULA NOT CREATED.", buff, bp);
}
Beispiel #2
0
void deleteBorder(dbref executor, int border, char *buff, char **bp)
{
	aspace_borders *theBorder;

	if (!border) {
		safe_str("#-1 BORDER NOT SUPPLIED", buff, bp);
		return;
	}
	
	theBorder = im_find(border_map, border);
	if (theBorder !=NULL) {
		write_spacelog(executor, executor, tprintf("Border deleted: %s", theBorder->name));
		free_borderinfo(theBorder);
		im_delete(border_map, border);
	} else {
		safe_str("#-1 BORDER NOT FOUND", buff, bp);
		return;
	}
}
Beispiel #3
0
void deleteNebula(dbref executor, int index, char *buff, char **bp)
{
	aspace_borders *nebula;

	if (!index) {
		safe_str("#-1 NEBULA NOT SUPPLIED", buff, bp);
		return;
	}
	if (aspace_config.nebula < 1) {
		safe_str("#-1 DISABLED IN CONFIG", buff, bp);
		return;
	}
	
	nebula = im_find(nebula_map, index);
	if (nebula !=NULL) {
		write_spacelog(executor, executor, tprintf("Nebula deleted: %s", nebula->name));
		free_borderinfo(nebula);
		im_delete(nebula_map, index);
	} else {
		safe_str("#-1 NEBULA NOT FOUND", buff, bp);
		return;
	}
}
Beispiel #4
0
void addNewBorder(dbref executor, int border_number, const char* name, double radius, double x, double y, double z, char *buff, char **bp)
{
	aspace_borders* newBorder;
	newBorder = im_find(border_map, border_number);
	if (newBorder != NULL) {
		safe_str("#-1 BORDER ALREADY EXISTS", buff, bp);
		return;
	}
		
	newBorder = mush_malloc(sizeof(aspace_borders), "border_info");
	
	newBorder->name = mush_strdup(name, "spaceborder_name");
	newBorder->empire_id = 0;
	newBorder->radius = radius;
	newBorder->x = x;
	newBorder->y = y;
	newBorder->z = z;
	
	if( im_insert(border_map, border_number, newBorder )) {
		safe_str("New Border Created.", buff, bp);
		write_spacelog(executor, executor, tprintf("Border Created: %s", newBorder->name));
	} else
		safe_str("#-1 BORDER NOT CREATED.", buff, bp);
}
Beispiel #5
0
void damage_structure (int x, double damage)
{
	register int i;
	double s = sdb[x].structure.superstructure;

	if (sdb[x].structure.superstructure == -sdb[x].structure.max_structure)
		return;
	sdb[x].structure.superstructure -= damage;
	if (sdb[x].structure.superstructure < -sdb[x].structure.max_structure)
		sdb[x].structure.superstructure = -sdb[x].structure.max_structure;
	do_console_notify(x, console_engineering, console_damage, 0,
	  ansi_alert(tprintf("%s%s%s: %s %s",
	  ANSI_CYAN, system_name[0], ANSI_WHITE,
	  unparse_percent(sdb[x].structure.superstructure / sdb[x].structure.max_structure),
	  unparse_damage(sdb[x].structure.superstructure / sdb[x].structure.max_structure))));
	if ((sdb[x].structure.superstructure <= -sdb[x].structure.max_structure) &&
	  (s > -sdb[x].structure.max_structure)) {
		/* Mordak Aspace v1.0.0p1 - Removed Silly KayBye! */
		do_ship_notify(x, tprintf("%s%s%s%s explodes into white hot vapor.%s%s",
		  ANSI_HILITE, ANSI_INVERSE, ANSI_RED, Name(sdb[x].object), ANSI_WHITE, ANSI_NORMAL));
		/* End Aspace v1.0.0p1*/
		do_space_notify_one(x, console_helm, console_tactical, console_science,
		  "has been destroyed");
		write_spacelog(sdb[x].object, sdb[x].object, tprintf("LOG: Destroyed, Shields %.6f GHz",
		  sdb[x].shield.freq));
		sdb[x].space = -1;
		sdb[x].status.active = 0;
		sdb[x].status.crippled = 2;
		for (i = MIN_SPACE_OBJECTS ; i <= max_space_objects ; ++i)
			if (sdb[i].location == x)
				if (sdb[i].structure.type) {
					do_ship_notify(i, tprintf("%s%s%s%s explodes into white hot vapor. Goodbye!%s%s",
					  ANSI_HILITE, ANSI_INVERSE, ANSI_RED, Name(sdb[i].object), ANSI_WHITE, ANSI_NORMAL));
					write_spacelog(sdb[x].object, sdb[x].object, tprintf("LOG: Destroyed, Shields %.6f GHz",
					  sdb[x].shield.freq));
					sdb[i].space = -1;
					sdb[i].status.active = 0;
					sdb[i].status.crippled = 2;
				}
	} else if ((sdb[x].structure.superstructure <= 0.0) && (s > 0.0)) {
		do_all_console_notify(x, ansi_warn("Excessive damage. All systems shutting down"));
		do_ship_notify(x, tprintf("%s experiences total systems failure.",Name(sdb[x].object)));
		sdb[x].status.crippled = 1;
		do_space_notify_one(x, console_helm, console_tactical, console_science,
			"has been disabled");
		write_spacelog(sdb[x].object, sdb[x].object, tprintf("LOG: Disabled, Shields %.6f GHz",
		  sdb[x].shield.freq));
	}
	if (((sdb[x].structure.superstructure <= 0.0) && (s > 0.0)) ||
	  ((sdb[x].structure.superstructure <= -sdb[x].structure.max_structure) &&
	  (s > -sdb[x].structure.max_structure))) {
	  	if (sdb[x].main.damage > 0.0)
			sdb[x].main.in = 0.0;
	  	if (sdb[x].aux.damage > 0.0)
			sdb[x].aux.in = 0.0;
		for (i = 0; i < MAX_SHIELD_NAME; ++i)
			sdb[x].shield.active[i] = 0;
		sdb[x].beam.in = 0.0;
		sdb[x].beam.out = 0.0;
		for (i = 0; i < sdb[x].beam.banks; ++i) {
			sdb[x].blist.lock[i] = 0;
			sdb[x].blist.active[i] = 0;
		}
		sdb[x].missile.in = 0.0;
		sdb[x].missile.out = 0.0;
		for (i = 0; i < sdb[x].missile.tubes; ++i) {
			sdb[x].mlist.lock[i] = 0;
			sdb[x].mlist.active[i] = 0;
		}
		sdb[x].batt.in = 0.0;
		sdb[x].batt.out = 0.0;
		sdb[x].move.in = 0.0;
		sdb[x].move.out = 0.0;
		sdb[x].move.v = 0.0;
		sdb[x].engine.warp_max = 0.0;
		sdb[x].engine.impulse_max = 0.0;
		sdb[x].power.batt = 0.0;
		sdb[x].sensor.lrs_active = 0;
		sdb[x].sensor.srs_active = 0;
		sdb[x].sensor.ew_active = 0;
		sdb[x].cloak.active = 0;
		sdb[x].trans.active = 0;
		sdb[x].trans.d_lock = 0;
		sdb[x].trans.s_lock = 0;
		sdb[x].tract.active = 0;
		sdb[x].tract.lock = 0;
		if (GoodSDB(sdb[x].status.tractoring)) {
			sdb[sdb[x].status.tractoring].status.tractored = 0;
			sdb[x].status.tractoring = 0;
		}
		up_cochranes();
		up_empire();
		up_quadrant();
		up_vectors();
		up_resolution();
		up_signature(x);
		up_visibility();
		debug_space(x);
	}
	return;
}