Exemplo n.º 1
0
static int Leave_DS_Bay(MAP * map, MECH * ds, MECH * mech, dbref frombay)
{
	MECH *car = NULL;

	StopBSuitSwarmers(FindObjectsData(mech->mapindex), mech, 1);
	MechLOSBroadcast(mech, "has left the bay.");
	/* We escape confines of the bay to open air/land! */
	mech_Rsetmapindex(GOD, (void *) mech, tprintf("%d", ds->mapindex));
	if(MechCarrying(mech) > 0)
		car = getMech(MechCarrying(mech));
	if(car)
		mech_Rsetmapindex(GOD, (void *) car, tprintf("%d", ds->mapindex));
	DOCHECKMA0(mech->mapindex == map->mynum,
			   "Fatal error: Unable to find the map 'ship is on.");
	loud_teleport(mech->mynum, mech->mapindex);
	if(car)
		loud_teleport(car->mynum, mech->mapindex);
	mech_notify(mech, MECHALL, "You have left the bay.");
	DS_Place(ds, mech, frombay);
	if(car)
		MirrorPosition(mech, car, 0);
	MechLOSBroadcasti(mech, ds, "has left %s's bay.");
	mech_notify(ds, MECHALL, tprintf("%s has left the bay.",
									 GetMechID(mech)));
	ContinueFlying(mech);
	if(In_Character(mech->mynum) && Location(MechPilot(mech)) != mech->mynum) {
		mech_notify(mech, MECHALL,
					"%ch%cr%cf%ciINTRUDER ALERT! INTRUDER ALERT!%c");
		mech_notify(mech, MECHALL,
					"%ch%cr%cfAutomatic self-destruct sequence initiated.%c");
		mech_shutdown(GOD, (void *) mech, "");
	}
	return 1;
}
Exemplo n.º 2
0
void prerun_event(EVENT * e)
{
#if 1
    static char buf[LBUF_SIZE];
    MECH *mech = (MECH *) e->data;

    /* Magic 2-hour uptime means that we are 'supposedly' stable
       [ read: crashy as hell, but.. :> you never know ] */
    if (event_tick <= 7200) {
	if (event_mech_event[(int) e->type])
	    sprintf(buf, "< %s event for #%d[%s] driven by #%d[%s] >",
		event_names[(int) e->type], mech->mynum, GetMechID(mech),
		MechPilot(mech),
		Good_obj(MechPilot(mech)) ? Name(MechPilot(mech)) :
		"Nobody");
	else
	    sprintf(buf, "< %s event >", event_names[(int) e->type]);
	mudstate.debug_cmd = buf;
    }
#endif
}