예제 #1
0
void set_open_state(int state) {
   open_state = state;
   if (state == 1)
      this_object()->simple_action("$N $vopen.");
   else
      this_object()->simple_action("$N $vclose.");

   update_description();
}
예제 #2
0
	/*
	* Returns:
	* 	-1 on failure
	* 	0 if a disease was freed from the memory
	*	1 otherwise
	*/
int change_description(struct p_node *list, char *const name,
		const size_t n, char *const desc) {
	struct p_node *patient = find_patient(list, name);
	struct d_node *d;
	if (patient == NULL || patient->disease_list == NULL ||
			(d = find_description(patient->disease_list, n)) == NULL) {
		return -1;
	} else {
		//struct d_node *it = find_description(patient->disease_list, n);  
		return update_description(d, desc);
	}
}
예제 #3
0
int do_open(object who) {
   if (open_state == 1) {
      write("It's already open.");
      return (0);
   }
   open_state = 1;
   update_description();
   if (who) {
      who->targeted_action(query_open_message(), nil, this_object());
   } else {
      this_object()->simple_action("$N $vopen.");
   }
}
예제 #4
0
int do_close(object who) {
   if (!open_state) {
      write("It's already closed.");
      return (0);
   }
   open_state = 0;
   update_description();
   if (who) {
      who->targeted_action(query_close_message(), nil, this_object());
   } else {
      this_object()->simple_action("$N $vclose.");
   }
}
예제 #5
0
void mudlib_setup(mixed * args) {

   if (sizeof(args) != 2) {
      return;
   }

   add_adj(args[0]);

   our_exit = args[0];
   our_identity = args[1];
   update_sibling();
   add_block(our_exit);
   set_open_description(query_open_description() + " %^CYAN%^[" + our_exit +
      "]%^RESET%^");
   set_closed_description(query_closed_description() + " %^CYAN%^[" + our_exit +
      "]%^RESET%^");
   update_description();
}