⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 place.c

📁 C实现的MUD,对大家基本入门网络游戏很有帮助!
💻 C
📖 第 1 页 / 共 2 页
字号:
	} else str += "                      ";

	describe = env->query("short")+"";
	j = 7-(strlen(describe)-color_len(describe))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"";
	for(i=0;i<j;i++) str += " ";

       if( env->query("exits/east") && !(int)env->query_door("east", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/east"))) room = load_object(env->query("exits/east"));
	describe = room->query("short")+"(E)";
	str += " ━━━ ";
	str += describe+"\n";
	} else str += "\n";

// 中间部分制作完成。

       if( env->query("exits/westdown") && !(int)env->query_door("westdown", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/westdown"))) room = load_object(env->query("exits/westdown"));
	describe = room->query("short")+"(Wd)";
	j = 10-(strlen(describe)-color_len(describe))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"";
	for(i=0;i<j;i++) str += " ";
	} else str += "                    ";

	if( (env->query("exits/southwest")&&!(int)env->query_door("southwest", "status") & DOOR_CLOSED) )
	str += "/"; else str += "  ";

       if( env->query("exits/down") && !(int)env->query_door("down", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/down"))) room = load_object(env->query("exits/down"));
	describe = room->query("short")+"(D)";
	j = (14-(strlen(describe)-color_len(describe)-1))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"";
	for(i=0;i<j;i++) str += " ";
	} else str += "              ";

	if( (env->query("exits/southeast")&&!(int)env->query_door("southeast", "status") & DOOR_CLOSED) )
	str += "\"; else str += "  ";

       if( env->query("exits/eastdown") && !(int)env->query_door("eastdown", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/eastdown"))) room = load_object(env->query("exits/eastdown"));
	describe = room->query("short")+"(Ed)";
	j = 10-(strlen(describe)-color_len(describe))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"\n";
	} else str += "\n";

	if( (env->query("exits/southup")&&!(int)env->query_door("southup", "status") & DOOR_CLOSED)
	|| (env->query("exits/southdown")&&!(int)env->query_door("southdown", "status") & DOOR_CLOSED)
	|| (env->query("exits/southwest")&&!(int)env->query_door("southwest", "status") & DOOR_CLOSED)
	|| (env->query("exits/south")&&!(int)env->query_door("south", "status") & DOOR_CLOSED)
	|| (env->query("exits/southeast")&&!(int)env->query_door("southeast", "status") & DOOR_CLOSED) )
{
	if( (env->query("exits/southwest")&&!(int)env->query_door("southwest", "status") & DOOR_CLOSED) )
	str += "                  /"; else str += "                    ";

	if( (env->query("exits/southup")&&!(int)env->query_door("southup", "status") & DOOR_CLOSED)
	|| (env->query("exits/southdown")&&!(int)env->query_door("southdown", "status") & DOOR_CLOSED)
	|| (env->query("exits/south")&&!(int)env->query_door("south", "status") & DOOR_CLOSED) )
	str += "        ┃        "; else str += "                  ";

	if( (env->query("exits/southeast")&&!(int)env->query_door("southeast", "status") & DOOR_CLOSED) )
	str += "\\n"; else str += "\n";

	if( (env->query("exits/southwest")&&!(int)env->query_door("southwest", "status") & DOOR_CLOSED) )
	str += "                /"; else str += "                  ";

	if( (env->query("exits/southup")&&!(int)env->query_door("southup", "status") & DOOR_CLOSED)
	|| (env->query("exits/southdown")&&!(int)env->query_door("southdown", "status") & DOOR_CLOSED)
	|| (env->query("exits/south")&&!(int)env->query_door("south", "status") & DOOR_CLOSED) )
	str += "          ┃          "; else  str += "                      ";

	if( (env->query("exits/southeast")&&!(int)env->query_door("southeast", "status") & DOOR_CLOSED) )
	str += "\\n"; else str += "\n";

	str += "\n";
}

       if( env->query("exits/southwest") && !(int)env->query_door("southwest", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/southwest"))) room = load_object(env->query("exits/southwest"));
	describe = room->query("short")+"(Sw)";
	str += sprintf("%"+(18+color_len(describe))+"s",describe);
	} else if( (env->query("exits/southup")&&!(int)env->query_door("southup", "status") & DOOR_CLOSED)
	|| (env->query("exits/southdown")&&!(int)env->query_door("southdown", "status") & DOOR_CLOSED)
	|| (env->query("exits/south")&&!(int)env->query_door("south", "status") & DOOR_CLOSED)
	|| (env->query("exits/southeast")&&!(int)env->query_door("southeast", "status") & DOOR_CLOSED) )
	str += "                  ";

       if( env->query("exits/south") && !(int)env->query_door("south", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/south"))) room = load_object(env->query("exits/south"));
	describe = room->query("short")+"(S)";
	j = (24-(strlen(describe)-color_len(describe)))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"";
	for(i=0;i<j;i++) str += " ";
	} else if( (env->query("exits/southup")&&!(int)env->query_door("southup", "status") & DOOR_CLOSED)
	|| (env->query("exits/southdown")&&!(int)env->query_door("southdown", "status") & DOOR_CLOSED)
	|| (env->query("exits/southeast")&&!(int)env->query_door("southeast", "status") & DOOR_CLOSED) )
	str += "                       ";

       if( env->query("exits/southeast") && !(int)env->query_door("southeast", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/southeast"))) room = load_object(env->query("exits/southeast"));
	describe = room->query("short")+"(Se)";
	str += describe+"\n";
	}
	else if( (env->query("exits/southup")&&!(int)env->query_door("southup", "status") & DOOR_CLOSED)
	|| (env->query("exits/southdown")&&!(int)env->query_door("southdown", "status") & DOOR_CLOSED)
	|| (env->query("exits/southwest")&&!(int)env->query_door("southwest", "status") & DOOR_CLOSED)
	|| (env->query("exits/south")&&!(int)env->query_door("south", "status") & DOOR_CLOSED) )
	str += "\n";

       if( env->query("exits/southup") && !(int)env->query_door("southup", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/southup"))) room = load_object(env->query("exits/southup"));
	describe = room->query("short")+"(Su)";
	j = 29-(strlen(describe)-color_len(describe))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"\n";
	}

       if( env->query("exits/southdown") && !(int)env->query_door("southdown", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/southdown"))) room = load_object(env->query("exits/southdown"));
	describe = room->query("short")+"(Sd)";
	j = 29-(strlen(describe)-color_len(describe))/2;
	for(i=0;i<j;i++) str += " ";
	str += describe+"\n";
	}

// 下体部分完成,下面是特殊部分。

	str += "\n";

       if( env->query("exits/enter") && !(int)env->query_door("enter", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/enter"))) room = load_object(env->query("exits/enter"));
	describe = room->query("short")+"(Enter)";
	str += "里面:"+describe+"\n";
	}
       if( env->query("exits/out") && !(int)env->query_door("out", "status") & DOOR_CLOSED ) {
       if( !room = find_object(env->query("exits/out"))) room = load_object(env->query("exits/out"));
	describe = room->query("short")+"(Out)";
	str += "外面:"+describe+"\n";
	}

// 下面是最特殊部分。

	if( mapp(exits = env->query("exits")) ) {
		dirs = sort_array(keys(exits), 1);
		for(i=0; i<sizeof(dirs); i++)
	if( dirs[i] != "northup" && dirs[i] != "northdown" && dirs[i] != "northwest"
	&& dirs[i] != "north" && dirs[i] != "northeast" && dirs[i] != "westup"
	&& dirs[i] != "up" && dirs[i] != "eastup" && dirs[i] != "west" && dirs[i] != "east"
	&& dirs[i] != "westdown" && dirs[i] != "down" && dirs[i] != "eastdown"
	&& dirs[i] != "southwest" && dirs[i] != "south" && dirs[i] != "southeast"
	&& dirs[i] != "southup" && dirs[i] != "southdown" && dirs[i] != "enter"
	&& dirs[i] != "out" ) {
       if( !room = find_object(env->query("exits/"+dirs[i]))) room = load_object(env->query("exits/"+dirs[i]));
	describe = room->query("short")+"("+capitalize(dirs[i])+")";
	str += "出口:"+describe+"\n";}
	}


	str += "━━━━━━━━━━━━━━━━━━━━━━━━━━ "HIW"HY2 "NOR"━━\n";
	write(str);
	return 1;
}

int help(object me)
{
	write(@HELP
指令格式 : place

帮助你了解四周的地理。
HELP
	);
	return 1;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -