示例#1
0
void
Redraw_Objects( void )
{
   OBJECT *tree = ( OBJECT *)rs_trindex[ PRINTER ];
   PRT oldnums;
   
   oldnums = cur_value;
   
   Get_Printer( &cur_value );
   set_objects();
   
   if( oldnums.cur_type != cur_value.cur_type )
   	do_redraw( tree, PTYPE );
   	
   if( oldnums.cur_color != cur_value.cur_color )
   	do_redraw( tree, COLOR );
   	
   if( oldnums.cur_pixel != cur_value.cur_pixel )
        do_redraw( tree, PIXLINE );
        
   if( oldnums.cur_quality != cur_value.cur_quality )
        do_redraw( tree, QUALITY );
        
   if( oldnums.cur_port != cur_value.cur_port )
   	do_redraw( tree, PORT );

   if( oldnums.cur_paper != cur_value.cur_paper )
   	do_redraw( tree, PAPER );
}
示例#2
0
void setup(void) {
   set_short("%^RED%^Fudge's workroom%^RESET%^");
   set_long("The room is splashed with gore.  Piles of limbs in one corner " +
      "and piles of guts in another corner.  In the middle of the room " +
      "is a desk.  On the desk are some grotesque looking tools.");
   set_exits(([
      "out" : "/domains/required/rooms/start", 
      "east" : "/domains/required/rooms/bug_room",
   ]));

   add_item("desk", "The desk is a huge and made of mahogny. " +
      "It's the central piece of furniture of the room, and it is clear " +
      "that Fudge spends a lot of time behind it.");

   add_item("tools", "They are used by grand master Fudge to dissect " +
      "monsters while trying to figure out how strong they are and where " +
      "to place them.");

   add_item("gore", "Youck!");

   add_item("limbs", "The ankle bone is connected to the leg bone. " +
      "It's disgusting.");

   set_objects(
      "/domains/required/objects/chest",
      "/domains/required/monsters/rat", 
      "/domains/required/objects/short_sword", 
      "/domains/required/objects/helmet"
   );
}
示例#3
0
void setup(void) {
   add_area("2.4.5");

   set_short("Black room");
   set_long("This is the black room.");

   add_exit("east", DIR + "/rooms/sub/door_trap.c");

   set_objects (DIR + "/monsters/rat.c");
}
示例#4
0
文件: maze5.c 项目: bbailey/gurbalib
void setup(void) {
   add_area("2.4.5");

   set_short("End of the maze");
   set_long("Congratulations you have done it.");

   add_exit("south", DIR + "/rooms/maze1/maze4.c");

   set_objects (DIR + "/obj/leather.c");
}
示例#5
0
文件: plain1.c 项目: Lundex/gurbalib
void setup(void) {
   add_area("2.4.5");

   set_short("A large open plain");
   set_long("A large open plain, extending to the north and south.");

   add_exit("north", DIR + "/rooms/plain2.c");
   add_exit("south", DIR + "/rooms/clearing.c");

   set_objects (DIR + "/monsters/wolf.c");
}
示例#6
0
文件: pub2.c 项目: Lundex/gurbalib
void setup(void) {
   add_area("2.4.5");

   set_short("The local pub");
   set_long("You can order drinks here.");

   set_objects(
      DIR + "/monsters/barkeep.c",
      "/domains/required/objects/mer_sign.c"
   );

   add_exit("west", DIR + "/rooms/yard.c");
}
示例#7
0
文件: chest.c 项目: Lundex/gurbalib
void setup(void) {
   set_id("chest");
   set_adj("wooden", "big");
   set_short("A big wooden chest");
   set_long("This thing looks like it weights a ton.  It's massive.");
   set_open_state(0);
   set_internal_max_weight(3000);

   set_objects(
      DIR + "/objects/small_rock", 
      DIR + "/objects/large_rock"
   );
}
示例#8
0
void setup(void) {
   add_area(AREA);
   add_area(FAIRYLAND_AREA);

   set_light(0);

   set_short("Deep inside Darkwood");
   set_long("You are deep inside Darkwood. You wish you had never come here.");

   add_exit("south", FAIRYLAND_ROOMS + "/dw_path5.c");
   add_exit("east", FAIRYLAND_ROOMS + "/darkwood3.c");

   set_objects(DIR + "/monsters/giant_oak.c");
}
示例#9
0
void setup(void) {
   add_area(AREA);
   add_area(FAIRYLAND_AREA);

   set_short("A tunnel in the mountain");
   set_long("You are in a tunnel deep in the mountain. You can see a red glow far away.");

   add_exit("north", FAIRYLAND_ROOMS + "/dragonroom.c");
   add_exit("south", FAIRYLAND_ROOMS + "/mountain.c");

   add_item("glow", "The glow lies to the north, and pulsates rhythmically.");

   set_objects(DIR + "/obj/doors/tunnel.c");
}
示例#10
0
void setup(void) {
   add_area("2.4.5");

   set_short("Giants conference of human bashing");
   set_long("You are at the yearly conference of human bashing, " +
      "organized by the giants.");

   add_exit("east", DIR + "/rooms/giant_lair.c");

  set_objects (
      DIR + "/monsters/fire_giant.c",
      DIR + "/monsters/frost_giant.c",
      DIR + "/monsters/stone_giant.c"
   );

}
示例#11
0
bool Device::init(std::string deviceFile)
{
    if(canopen::atFirstInit)
    {
        canopen::atFirstInit = false;

        if(std::find(canopen::openDeviceFiles.begin(), canopen::openDeviceFiles.end(), deviceFile) == canopen::openDeviceFiles.end())
        {
            CAN_Close(canopen::h);

            if (!canopen::openConnection(deviceFile, canopen::baudRate)) // check if connection was successful
            {
                ROS_ERROR_STREAM("Cannot open CAN device " << deviceFile << "... aborting.");
                exit(EXIT_FAILURE);
            }
            canopen::initListenerThread(canopen::defaultListener);
            canopen::openDeviceFiles.push_back(deviceFile);
        }
        sendNMT(NMT_RESET_COMMUNICATION, true);
    }

    ros::Time start = ros::Time::now();

    while(!nmt_init)
    {
        if((ros::Time::now() - start).toSec() > 5.0)
        {
            ROS_ERROR_STREAM("Node: " << (int)CANid_ << " is not ready for operation. Please check for potential problems.");
            return false;
        }

        ros::Duration(0.01).sleep();
    }

    // Configure PDO channels
    ROS_DEBUG_STREAM("mapping PDOs of device " << name);
    init_pdo();

    ros::Duration(0.01).sleep();
    sendNMT(NMT_START_REMOTE_NODE);
    // std::cout << std::hex << "Initialized the PDO mapping for Node: " << (int)CANid << std::endl;
    initialized = true;

    set_objects();

    return true;
}
示例#12
0
文件: shop.c 项目: Lundex/gurbalib
void setup(void) {
   add_area("2.4.5");

   set_short("The shop");
   set_long("You are in a shop.  You can buy or sell things here.  " +
      "There is an opening to the north and a small room to the west.");

   add_exit("north", DIR + "/rooms/store.c");
   add_exit("south", DIR + "/rooms/vill_road2.c");
   add_exit("west", DIR + "/rooms/storage.c");

  set_objects(
      DIR + "/monsters/shopkeep.c",
      "/domains/required/objects/mer_sign.c",
      DIR + "/obj/field.c"
   );
}
示例#13
0
void setup(void) {
   add_area("2.4.5");

   set_short("Village road");
   set_long("A long road going east through the village.  There are " +
     "stairs going down.  The road continues to the west.  " +
     "To the north is the shop, and to the south is the adventurers " +
     "guild.  The road runs towards the shore to the east.");

   add_exit("north", DIR + "/rooms/shop.c");
   add_exit("south", DIR + "/rooms/adv_guild.c");
   add_exit("east", DIR + "/rooms/vill_shore.c");
   add_exit("west", DIR + "/rooms/vill_road1.c");
   add_exit("down", DIR + "/rooms/station.c");

   set_objects (DIR + "/monsters/harry.c");
}
示例#14
0
void setup(void) {
   add_area("boothill");

   set_short("The general store");
   set_long("This quaint little shop has all of the basic necessities. " +
      "Here in the wild west, if you can't get it at the general store, " +
      "your probably going to have to wait months to get a package.  " +
      "While looking around at the sundry goods, you smell something " +
      "delicious.");

   set_exits(([
      "east" : DIR + "/rooms/infront_store.c", 
   ]));

   set_objects(
      DIR + "/monsters/will",
      "/domains/required/objects/mer_sign"
   );
}
示例#15
0
/* Redraw_Objects()
 *==========================================================================
 * Redraws the modem objects.
 * This is especially important if the values are changed, therefore
 * they must reflect actual reality
 */
void
Redraw_Objects( void )
{
   OBJECT *tree = ( OBJECT *)rs_trindex[ RS232 ];
   MDATA temp;
   int   xport;
   int   i;
   int   temp_port;
   
   store = ( BUFFER *)(*xcpb->Get_Buffer)();
   
   xport = temp_port = Get_Active_Port();
   Set_Number_Of_Ports();
   temp  = Modem.modem[ temp_port ];

   for( i =0;i < Num_Ports;i++ )
   {
       Read_Port( i, store );
       store++;   
   }
   Set_Active_Port( temp_port );
   set_objects( cur_port );
      
   if( xport != cur_port )
       do_redraw( tree, PORT );
          
   if( temp.cur_baud != Modem.modem[ cur_port ].cur_baud )
         do_redraw( tree, BAUD );
         
   if( temp.cur_parity != Modem.modem[ cur_port ].cur_parity )
   	do_redraw( tree, PARITY );
   	
   if( temp.cur_bits != Modem.modem[ cur_port ].cur_bits )
       do_redraw( tree, BITSCHAR );
       
   if( temp.cur_flow != Modem.modem[ cur_port ].cur_flow )
   	do_redraw( tree, FLOW );
   	
   if( temp.cur_stop != Modem.modem[ cur_port ].cur_stop )
   	do_redraw( tree, STOPX );
}
示例#16
0
文件: bank.c 项目: bbailey/gurbalib
void setup(void) {
   add_area("2.4.5");

   set_short("The bank");
   set_long("You are in the bank.  To the east is a low counter.  The " +
      "counter is covered with heavy iron bars.  On the wall beside " +
      "the counter, a door leads further east");

   add_exit("west", DIR + "/rooms/narr_alley.c");
   add_exit("east", "#enter_door");

   add_item("counter","There is a sign on the counter that says\n" +
      "CLOSED FOR RECONSTRUCTION.\n");

   add_item("door", "#look_door");

   set_objects (DIR + "/monsters/bankguard.c");
   door_closed = 1;
   locked = 1;
   key = "gurba bank key";
}
示例#17
0
文件: bank.c 项目: Lundex/gurbalib
void setup(void) {
   set_short("Gurba Bank");
   set_long("This is the main bank branch of Gurba. There are two large " +
      "counters with a clerk behind each.  The floor and " +
      "columns supporting the roof are made of what appears to be marble.");

   set_exits(([
      "south" : DIR + "/rooms/border_south9",
   ]));

   add_item("counter", "counters",
      "Each of the counters are made out of solid oak.");
   add_item("clerk",
      "The clerks do not have any personality to speak of.  " +
      "You wonder if they are in fact cardboard cutouts.");
   add_item("floor", "columns", "column", "The are nicely cut and tiled " +
      "out of what seems to be marble, though upon closer inspection it " +
      "seems to be fake.");

   set_objects("/domains/required/objects/bank_sign.c");
}
示例#18
0
文件: tree.c 项目: bbailey/gurbalib
void setup(void) {
   add_area("newbie");

   set_short("North end of the field");
   set_long("You are in a large open field, next to an old dead tree. " +
      " To the South you see a road leading to a city.  There is an odd " +
      "hole in a hill to the east.");

   set_exits(([
      "south" : STARTING_ROOM,
      "east" : "#enter_hole",
   ]));

   set_objects(
      DIR + "/obj/sign", 
      DIR + "/obj/tree"
   );

   add_item("hole", "A funny hole in the ground.  You might be able to " +
      "squeeze into it.");

   add_action("break_branch", "break");
}
示例#19
0
/* cpx_call()
 *==========================================================================
 * Execute the cpx using Xform_do()
 */
BOOLEAN
cdecl cpx_call( GRECT *rect )
{
     int button;
     int quit = 0;
     OBJECT *tree  = (OBJECT *)rs_trindex[RS232];
     WORD msg[8];
     int  temp;
     int  temp_port;
     long filesize;
     char *a,*b;
     GRECT xrect;
                    
     set_objects( cur_port );

     if( IsSTE() )
     {
        a = port_array[ PORT_C ];
        b = port_array[ PORT_D ];
        strcpy( a, b );
     }
     
     ObX( ROOT ) = rect->g_x;
     ObY( ROOT ) = rect->g_y;
     Objc_draw( tree, ROOT, MAX_DEPTH, NULL );
     do
     {
	button = (*xcpb->Xform_do)( tree, 0, msg );
     	switch( button )
     	{
     				/* if on a TT, we write out structure for 4 ports
     				 * but on an ST/STE/Mega, we write out just ONE!
     				 * And on a MEGA STE, we write out 3
     				 */
     		case SAVE:	if( (*xcpb->XGen_Alert)( SAVE_DEFAULTS ) )
     				{
				    filesize = sizeof( MDEFAULT );
				    (*xcpb->CPX_Save)( &Modem, filesize );			            
			            Select_Ok();
			        }
			        Deselect( SAVE );
			        xrect = ObRect( SAVE );
			        objc_offset( tree, SAVE, &xrect.g_x, &xrect.g_y );
			        xrect.g_x -= 2;
			        xrect.g_y -= 2;
			        xrect.g_w += 4;
			        xrect.g_h += 4;
			        Objc_draw( tree, SAVE, MAX_DEPTH, &xrect );
#if 0			            
     				deselect( tree, SAVE );
#endif     				
     				break;
     				
     		case RS232OK:	quit = RS232OK;
     				Select_Ok();
     				Deselect( RS232OK );
     				break;
     						
     		case RS232CAN:	quit = RS232CAN;
     				pop_data();
     				Deselect( RS232CAN );
     				break;
     						
     		case BAUD:	Pop_Handle( BAUD, baud_array, 16, &Modem.modem[ cur_port ].cur_baud, IBM, 8 );
     				break;
     						
		case FLOW:	Pop_Handle( FLOW, flow_array, 3, &Modem.modem[ cur_port ].cur_flow, IBM, 11 );
				break;

#if FRENCH | ITALY
		case PARITY:    Pop_Handle( PARITY, parity_array, 3, &Modem.modem[ cur_port ].cur_parity, IBM, 10 );
				break;
#endif

#if GERMAN				
		case PARITY:    Pop_Handle( PARITY, parity_array, 3, &Modem.modem[ cur_port ].cur_parity, IBM, 11 );
				break;
#endif
				
#if USA | UK | SPAIN | SWEDEN
		case PARITY:    Pop_Handle( PARITY, parity_array, 3, &Modem.modem[ cur_port ].cur_parity, IBM, 8 );
				break;
#endif
				
		case BITSCHAR:	Pop_Handle( BITSCHAR, bits_array, 4, &Modem.modem[ cur_port ].cur_bits, IBM, 8 );
				break;
				
		case STOPX:	if( !Modem.modem[ cur_port ].cur_stop )
				   Pop_Handle( STOPX, stop_array, 4, &Modem.modem[ cur_port ].cur_stop, IBM, 8 );
				else
				{ 
				   temp = Modem.modem[ cur_port ].cur_stop;
				   temp -= 1;
				   Pop_Handle( STOPX, &stop_array[1], 3, &temp, IBM, 8 );
				   Modem.modem[ cur_port ].cur_stop = temp + 1;
				}   
				break;
				
		case PORT:	if( !IsDisabled( PORT ) )
				{
				   /* Select number of ports based on 
				    * LAN TT and MEGA STE
				    * If on TT the LAN
				    * is ACTIVE AND we are using CHANNEL A,
				    * then set port to ST SERIAL using
				    * Bconmap call.
				    *
				    * For the Popup, we set the number of ports and also
				    * the default 'old_port' which is set by Set_Active_Port()
				    
				    */
				   temp_port = Get_Active_Port();
				   Modem.cur_port = Set_Active_Port( temp_port );
				   
				   Pop_Handle( PORT, port_array, Num_Ports, &old_port, IBM, 11 );
				   if( old_port != cur_port )
				   {
				     cur_port = old_port;
				     Modem.cur_port = Set_Active_Port( cur_port );
				     set_objects( cur_port );
				     Objc_draw( tree, BAUD, 0, NULL );
				     Objc_draw( tree, FLOW, 0, NULL );
				     Objc_draw( tree, PARITY, 0, NULL );
				     Objc_draw( tree, BITSCHAR, 0, NULL );	   
				     Objc_draw( tree, STOPX, 0, NULL );
				   }
				}
				break;
								
     		default:	if( button == -1 )
     				{
     				   switch( msg[0] )
     				   {
     				     case WM_REDRAW: Redraw_Objects();
     				     		     break;

     				     case AC_CLOSE:  quit = RS232CAN;
     				     		     pop_data();
						     break;
						     
     				     case WM_CLOSED: quit = RS232OK;
     				     		     Select_Ok();
						     break;
     				     default:
     				     		break;
     				   }
     				}
     				break;
     	}
     }while( !quit);
     
     return( FALSE );
}
示例#20
0
/* cpx_call()
 *==========================================================================
 * Execute the cpx using Xform_do
 */
BOOLEAN
cdecl cpx_call( GRECT *rect )
{
     int button;
     int quit = 0;
     OBJECT *tree  = (OBJECT *)rs_trindex[PRINTER];
     WORD   msg[8];
     GRECT  xrect;
     
     ObX( ROOT ) = rect->g_x;
     ObY( ROOT ) = rect->g_y;
     set_objects();
     Objc_draw( tree, ROOT, MAX_DEPTH, NULL );
     do
     {
	button = (*xcpb->Xform_do)( tree, 0, msg );
     	switch( button )
     	{
     		case PSAVE:	if( (*xcpb->XGen_Alert)( SAVE_DEFAULTS ) )
     				{
     		 		   (*xcpb->CPX_Save)( &cur_value, sizeof( PRT ) );
     		 		   push_data();
     		 		   Set_Printer( &cur_value );
     		 		}
     		 		Deselect( PSAVE );
     		 		xrect = ObRect( PSAVE );
     		 		objc_offset( tree, PSAVE, &xrect.g_x, &xrect.g_y );
     		 		xrect.g_x -= 2;
     		 		xrect.g_y -= 2;
     		 		xrect.g_w += 4;
     		 		xrect.g_h += 4;
     		 		Objc_draw( tree, PSAVE, MAX_DEPTH, &xrect );
#if 0     		 		   
     				deselect( tree, PSAVE );
#endif     				
     				break;
     				
     		case POK:	quit = POK;
     				Set_Printer( &cur_value );
     				Deselect( POK );
     				break;
     						
     		case PCANCEL:	quit = PCANCEL;
     				pop_data();
     				Deselect( PCANCEL );
     				break;




#if GERMAN
		case PTYPE:	Pop_Handle( PTYPE, type_array, 2, &cur_value.cur_type, IBM, 11 );
				break;
#endif

#if FRENCH | SPAIN | SWEDEN | ITALY
		case PTYPE:	Pop_Handle( PTYPE, type_array, 2, &cur_value.cur_type, IBM, 10 );
				break;
#endif				


#if USA | UK
		case PTYPE:	Pop_Handle( PTYPE, type_array, 2, &cur_value.cur_type, IBM, 8 );
				break;
#endif     






#if FRENCH     				
     		case COLOR:	Pop_Handle( COLOR, color_array, 2, &cur_value.cur_color, IBM, 10 );
     				break;
#endif

#if ITALY
     		case COLOR:	Pop_Handle( COLOR, color_array, 2, &cur_value.cur_color, IBM, 9 );
				break;
#endif				

#if USA | UK | SPAIN | GERMAN | SWEDEN
     		case COLOR:	Pop_Handle( COLOR, color_array, 2, &cur_value.cur_color, IBM, 8 );
     				break;
#endif



		case PIXLINE:	Pop_Handle( PIXLINE, pix_array, 2, &cur_value.cur_pixel, IBM, 8 );
     				break;






#if GERMAN | FRENCH | ITALY
		case QUALITY:	Pop_Handle( QUALITY, quality_array, 2, &cur_value.cur_quality, IBM, 10 );
     				break;
#endif

#if SWEDEN
		case QUALITY:	Pop_Handle( QUALITY, quality_array, 2, &cur_value.cur_quality, IBM, 9 );
				break;
#endif

#if USA | UK | SPAIN
		case QUALITY:	Pop_Handle( QUALITY, quality_array, 2, &cur_value.cur_quality, IBM, 8 );
     				break;
#endif     						


#if ITALY
		case PAPER:	Pop_Handle( PAPER, paper_array, 2, &cur_value.cur_paper, IBM, 10 );
				break;
#endif
				
#if USA | UK | SPAIN | GERMAN | FRENCH
		case PAPER:	Pop_Handle( PAPER, paper_array, 2, &cur_value.cur_paper, IBM, 9 );
     				break;
#endif

#if SWEDEN
		case PAPER:	Pop_Handle( PAPER, paper_array, 2, &cur_value.cur_paper, IBM, 8 );
				break;
#endif




#if ITALY
     		case PORT:	Pop_Handle( PORT, port_array, 2, &cur_value.cur_port, IBM, 9 );
     				break;
#else
     		case PORT:	Pop_Handle( PORT, port_array, 2, &cur_value.cur_port, IBM, 10 );
     				break;
#endif
     		default:	if( button == -1 )
     				{
     				   switch( msg[0] )
     				   {
     				     case WM_REDRAW: Redraw_Objects();
     				     		     break;
     				     		     
     				     case AC_CLOSE:  quit = PCANCEL;
     				     		     pop_data();
     				     		     break;
     				     		     
     				     case WM_CLOSED: quit = POK;
     				     		     Set_Printer( &cur_value );
						     break;
     				     default:
     				     		break;
     				   }
     				}
				break;
     		
     	}
     }while( !quit);
     
     return( FALSE );
}