Пример #1
0
int main(object me, string arg)
{
	string target, mud;
	object obj;

        if(!block_tell(me)) return 1;

	if( !arg || arg=="" )
		return notify_fail("你要回答什么?\n");

	if( !stringp(target = me->query_temp("reply")) )
		return notify_fail("刚才没有人和你说过话。\n");

	if( sscanf(target, "%s@%s", target, mud)==2 ) {
		GTELL->send_gtell(lower_case(mud), lower_case(target), me, arg);
		write("网路讯息已送出,可能要稍候才能得到回应。\n");
		return 1;
	}

	obj = find_player(target);
	if( !obj ) return notify_fail(
	  "刚才和你说话的人现在无法听见你,或者已经离开游戏了。\n");
	  
	if(!living(obj) || !interactive(obj)) 
	  return notify_fail(obj->name(1)+"现在听不见你说的话。\n");
debug(sprintf( YEL "%s(%s)回答%s(%s):%s" NOR,me->name(1),me->query("id"),obj->name(1),obj->query("id"), arg));		  
write(HBBLU "你回答" + obj->name(1) + ":" + arg + "\n" NOR);
	tell_object(obj, sprintf(HBBLU"%s回答你:%s\n"NOR,
		me->name(1), arg ));

	obj->set_temp("reply", me->query("id"));
	return 1;
}
Пример #2
0
Файл: ftell.c Проект: cosin/XYJ
int main(object me, string arg)
{
	string target, msg, mud, filename;
	object obj;

	if( !arg || sscanf(arg, "%s %s", target, filename)!=2 )
	   return help(me);

	msg = "\n";
	msg += read_file(filename);

	if( sscanf(target, "%s@%s", target, mud)==2 ) {
		GTELL->send_gtell(mud, target, me, msg);
		write("网路讯息已送出,可能要稍候才能得到回应。\n");
		return 1;
	}

        if(!block_tell(me)) return 1;

	obj = find_player(target);
	if(!obj || !me->visible(obj)) return notify_fail("没有这个人。\n");

	if( !wizardp(me) && obj->query("env/block_tell") )
	   return notify_fail(obj->name(1) + "眼下不想跟任何人说话。\n");

        if(!living(obj) || !interactive(obj)) 
	  return notify_fail(obj->name(1)+"现在听不见你说的话。\n");
	  
	write(GRN "你告诉" + obj->name(1) + ":" + msg + "\n" NOR);
	tell_object(obj, sprintf( GRN "%s告诉你:%s\n" NOR,
		me->name(1)+"("+me->query("id")+")", msg));

	obj->set_temp("reply", me->query("id"));
	return 1;
}
Пример #3
0
Файл: emote.c Проект: cosin/XYJ
int main(object me, string str)
{
    if(!block_tell(me)) return 1;

    if (!str) {
        write(CYN"你看起来表情丰富。\n"NOR);
        tell_room(environment(me), CYN+(string)me->name()+
		"看起来表情丰富。\n" +NOR, me);
        return 1;
    }
    write(CYN"你"+str+"\n"NOR);
    tell_room(environment(me), CYN+(wizardp(me)? "":"->")+(string)me->name()+
        str+"\n"+NOR, me);
    return 1;
}
Пример #4
0
int main(object me, string arg)
{
   string dest, msg;
   object ob;

        if(!block_tell(me)) return 1;

   if( !arg || sscanf(arg, "%s %s", dest, msg)!=2 )
     return notify_fail("你要对谁耳语些什么?\n");

   ob = present(dest, environment(me));
   if( !ob || !ob->is_character() )
     return notify_fail("你要对谁耳语?\n");

   write( GRN "你在" + ob->name() + "的耳边悄声说道:" + msg + "\n" NOR);
   tell_room( environment(me), me->name() + "在" + ob->name()
     + "耳边小声地说了些话。\n", ({ me, ob }) );
Пример #5
0
Файл: say.c Проект: cosin/XYJ
int main(object me, string arg)
{
        if(!block_tell(me)) return 1;

	if (!arg) {
		write("你自言自语不知道在说些什么。\n");
		tell_room(environment(me), me->name() + "自言自语不知道在说些什么。\n",
	          	  me);
		return 1;
	}
	if( (int)me->query("kee") < (int)me->query("max_kee") / 5 ) {
		arg = replace_string(arg, " ", " ... ") + " ...";
	}

	write( CYN "你说道:" + arg + "\n" NOR);
	tell_room(environment(me), CYN + me->name() + "说道:" +  arg + "\n" NOR,
	          me);

	// The mudlib interface of say
	all_inventory(environment(me))->relay_say(me, arg);

	return 1;
}
Пример #6
0
// command_hook() of F_COMMAND call this as an alternate command processor.
// CHANNEL_D also calls this to get emote message.
varargs mixed do_emote(object me, string verb, string arg, int channel_emote, int rumor_emote, int intermud)

// intermud portion added by mon. 10/1/97
{
	string str, my_gender, target_gender, msg_postfix;
	object target;
	string if_execute;
	string user_emote;
	int i;
	object *list;

	if( !environment(me) ) return 0;

//	if ( !mapp(emote) || undefinedp(emote[verb]) ) return 0;
	if ( !mapp(emote) ) return 0;
	if(undefinedp(emote[verb])) {
		if(!channel_emote)  return 0;
		if(verb[0] < 0x80)  return 0;
		if(rumor_emote)
//       if (random(20)==1)
//       user_emote = me->name() + verb + "\n";
//       else 
		   user_emote = "某人" + verb + "\n";
    else {
         if(!channel_emote || ! intermud)
		       user_emote = me->name() + verb + "\n";
         else
		       user_emote = "$N" + verb + "\n";
                }
	    return user_emote;
	}

	// Determine the pattern to be searched and the target.
	if ( stringp(arg) && arg != "" ) {
		target = present(arg, environment(me));

		if(!objectp(target)) {
			// If not channel emote, only search target in our environment.
			if(!channel_emote) return 0;
			target = find_player(arg);
			if (!objectp(target))
			{
				list = users();
				for(i=0;i<sizeof(list);i++)
				{
					if (list[i]->query("name")==arg)
					{target = list[i];break;}
				}
			}
			if( !objectp(target) || !me->visible(target) ) return 0;
		}

		if( !target->is_character())
			return notify_fail("你要对谁做这个动作?\n"); 

		target_gender = target->query("gender");
		if( target==me ) {
			msg_postfix = "_self";
			target = 0;
		} else msg_postfix = "_target";
	} else msg_postfix = "";

//mon 9/15/97. for emote flooding.
        if(!channel_emote) {
          if(!block_tell(me)) return 1;
	}

	my_gender = me->query("gender");

	if_execute = "";
	if( stringp(str = emote[verb]["myself" + msg_postfix]) ) {
		if_execute = " ";
		if(rumor_emote && random(20)!=1)
		   str = replace_string(str, "$N", "某人");
        else
		   str = replace_string(str, "$N", me->name());
		str = replace_string(str, "$P", gender_self(my_gender));
                str = replace_string(str, "$S", RANK_D->query_self(me));
                str = replace_string(str, "$s", RANK_D->query_self_rude(me));
		if( objectp(target) ) {
                        str = replace_string(str, "$C", RANK_D->query_self_close(me));
                        str = replace_string(str, "$c", RANK_D->query_close(target));
                        str = replace_string(str, "$R", RANK_D->query_respect(target));
                        str = replace_string(str, "$r", RANK_D->query_rude(target));
			str = replace_string(str, "$n", target->name());
			str = replace_string(str, "$p", gender_pronoun(target_gender));
		}
		if( !channel_emote ) message("emote", CYN + str + NOR, me);
	}
  
	if( objectp(target) && stringp(str = emote[verb]["target"]) ) {
		if_execute = " ";
		if(rumor_emote)
		   str = replace_string(str, "$N", "某人");
        else
		   str = replace_string(str, "$N", me->name());
		str = replace_string(str, "$P", gender_pronoun(my_gender));
                str = replace_string(str, "$S", RANK_D->query_self(me));
                str = replace_string(str, "$s", RANK_D->query_self_rude(me));
                str = replace_string(str, "$C", RANK_D->query_self_close(me));
                str = replace_string(str, "$c", RANK_D->query_close(target));
                str = replace_string(str, "$R", RANK_D->query_respect(target));
                str = replace_string(str, "$r", RANK_D->query_rude(target));
		str = replace_string(str, "$n", target->name());
		str = replace_string(str, "$p", gender_self(target_gender));

		if( !channel_emote ) message("emote", CYN + str + NOR, target);
	}

	if( stringp(str = emote[verb]["others"+msg_postfix]) ) {
		if_execute = " ";
		if(rumor_emote)
		   str = replace_string(str, "$N", "某人");
        else if(!channel_emote || !intermud)
		   str = replace_string(str, "$N", me->name());
		str = replace_string(str, "$P", gender_pronoun(my_gender));
                str = replace_string(str, "$S", RANK_D->query_self(me));
                str = replace_string(str, "$s", RANK_D->query_self_rude(me));
		if( objectp(target) ) {
                        str = replace_string(str, "$C", RANK_D->query_self_close(me));
                        str = replace_string(str, "$c", RANK_D->query_close(target));
                        str = replace_string(str, "$R", RANK_D->query_respect(target));
                        str = replace_string(str, "$r", RANK_D->query_rude(target));
			str = replace_string(str, "$n", target->name());
			str = replace_string(str, "$p", gender_pronoun(target_gender));
		}
		if( !channel_emote ) {
			 message("emote", CYN + str + NOR, environment(me), ({me, target}));
			 if (environment(me)->query("broadcast"))
			 	environment(me)->broadcast(CYN + str + NOR);
		} else return str;