Exemplo n.º 1
0
Arquivo: practice.c Projeto: cosin/XYJ
int main(object me, string arg)
{
	string skillname;
	int skill, skill_basic;

	seteuid(getuid());

	if( environment(me)->query("no_fight") || 
		environment(me)->query("no_magic") )
		   return notify_fail("这里不是练功的地方。\n");

	if( me->is_fighting() )
		return notify_fail("你已经在战斗中了,学一点实战经验吧。\n");

	if( me->is_busy() )
		return notify_fail("你现在很忙,不能练习。\n");

	if( !arg ) return (__DIR__"enable")->main(me, arg);

	if( !stringp(skillname = me->query_skill_mapped(arg)) )
		return notify_fail("你只能练习用 enable 指定的特殊技能。\n");

	skill_basic = me->query_skill(arg, 1);
	skill = me->query_skill(skillname, 1);

	if( skill < 1 )
		return notify_fail("你好像还没「学会」这项技能吧?最好先去请教别人。\n");
	if( skill_basic < 1 )
		return notify_fail("你对这方面的技能还是一窍不通,最好从先从基本学起。\n");

	if( skill*skill*skill/10 > (int)me->query("combat_exp") )
		return notify_fail("你的武学修为还没到这个境界,练得再多也没用。\n");
	//note, if a magic skill can also be practiced...need change this.

	notify_fail("你现在不能练习这项技能。\n");
	if( !SKILL_D(skillname)->valid_learn(me) ) return 0;

	// mon 10/19/98
	if(MISC_D->random_capture(me,20000,0)) return 1;

	notify_fail("你试着练习" + to_chinese(skillname) + ",但是并没有任何进步。\n");

        //added by mon. 7/24/97
	if(skill_basic <= skill && random(100)==0)
	  write("你的" + to_chinese(skillname)+ 
            "很难提高了,还是向你师父请教请教吧!\n");

	if( SKILL_D(skillname)->practice_skill(me) ) {
		me->improve_skill(skillname, skill_basic/5 +1, skill_basic > skill? 0: 1);
		write( HIY "你的" + to_chinese(skillname) + "进步了!\n" NOR);
		return 1;
	}
	else return 0;
}
Exemplo n.º 2
0
Arquivo: sgate.c Projeto: mudchina/fy4
int valid_leave(object me, string dir)
{
        object *inv;
        object ob;
        int i;
        if( userp(me))
        {
        if( dir == "north" 
        && !random(10) && ob=present("garrison", this_object()))
        {
                inv = all_inventory(me);
                for(i=0; i<sizeof(inv); i++)
           {
                        if((int)(inv[i]->query("weapon_prop")) && (int)(inv[i]->query("equipped")))
                        return notify_fail(ob->name()+"向你喝道:不可手持兵器入风云城!\n");    
                        
                }
        }
        if( dir == "up" && ob=present("garrison", this_object()))
        {
                inv = all_inventory(me);
                for(i=0; i<sizeof(inv); i++)
                {
                        if(((string)(inv[i]->name()) == "风云战甲") && (int)(inv[i]->query("equipped")))
                        return 1; 
                }
                return notify_fail(ob->name()+"向你喝道:闲杂人等不可上登护城墙!\n");
        }
                tell_room("/d/fywall/supgate",
                "城墙下" + me->name() + "往" + to_chinese(dir) + "离开了。\n");
        
         if( me->query("class")== "shenshui"||me->query("class")== "knight"||
            me->query("class")== "bat"||me->query("class")== "wolfmount")
            {
                if( dir == "north" && ob=present("garrison", this_object()))
        {
                inv = all_inventory(me);
                for(i=0; i<sizeof(inv); i++)
                {
                        if(((string)(inv[i]->name()) == "风云战甲") && (int)(inv[i]->query("equipped")))
                        return 1; 
                }
                return notify_fail(ob->name()+"大声喝止:皇上有令,番帮野民,不得入城!\n");
        }
                tell_room("/d/fywall/supgate",
                "城墙下" + me->name() + "往" + to_chinese(dir) + "离开了。\n");
         }
        return 1;
        
        }
                else return 1;
}      
Exemplo n.º 3
0
int main(object me, string arg)
{
   object ob;
   mapping skill;
   int cost, my_skill;
   
    if(environment(me)->query("no_fight") || 
       environment(me)->query("no_magic") )
          return notify_fail("安全区内禁止练功。\n");
                        
   if( me->is_fighting() )
     return notify_fail("你无法在战斗中专心下来研读新知!\n");

        if (me->is_busy() || me->query_temp("pending/exercising"))
                return notify_fail("你现在正忙着呢。\n");

   if(!arg || !objectp(ob = present(arg, me)) )
     return notify_fail("你要读什么?\n");

   if( !mapp(skill = ob->query("skill")) )
     return notify_fail("你无法从这样东西学到任何东西。\n");

   if( !me->query_skill("literate", 1) )
     return notify_fail("你是个文盲,先学学读书识字(literate)吧。\n");

   message("vision", me->name() + "正专心地研读" + ob->name()
     + "。\n", environment(me), me);
  
        my_skill=me->query_skill(skill["name"],1);

   if( (int)me->query("combat_exp") < skill["exp_required"] ||
            ((string)SKILL_D(skill["name"])->type()=="martial"
             && my_skill*my_skill*my_skill/10>(int)me->query("combat_exp"))) {
     write("你的道行不够,再怎么读也没用。\n");
     return 1;
   }

   notify_fail("以你目前的能力,还没有办法学这个技能。\n");
   if( !SKILL_D(skill["name"])->valid_learn(me) ) return 0;

   cost = skill["sen_cost"] + skill["sen_cost"] 
     * (skill["difficulty"] - (int)me->query_int())/20;
   if( (int)me->query("sen") < cost ) {
     write("你现在过于疲倦,无法专心下来研读新知。\n");
     return 1;
   }

   if( me->query_skill(skill["name"], 1) > skill["max_skill"] ) {
     write("你研读了一会儿,但是发现上面所说的对你而言都太浅了,没有学到任何东西。\n");
     return 1;
   }

   me->receive_damage("sen", cost);

   if( !me->query_skill(skill["name"], 1) )
     me->set_skill(skill["name"], 0);
   me->improve_skill(skill["name"], (int)me->query_skill("literate", 1)/5+1);
   write("你研读有关" + to_chinese(skill["name"]) + "的技巧,似乎有点心得。\n");
   return 1;
}
Exemplo n.º 4
0
int main(object me, string arg)
{
	mapping skills, skillmap;
	string *skill;
	int i;
	
	if( !arg || arg=="" ) 
		return notify_fail("你要放弃哪一项技能?\n");

	if( !me->delete_skill(arg) )
		return notify_fail("你并没有学过这项技能。\n");

	write("你决定放弃继续学习" + to_chinese(arg) + "。\n");

	if( arg =="all" ) {
		skills = me->query_skills();
		if( !mapp(skills) || sizeof(skills)==0 ) return 1;

		skill = keys(skills);
		for (i=0; i<sizeof(skill); i++) {
			me->delete_skill(skill[i]);
		}
	} else {		 
		skillmap = me->query_skill_map();
		if( !mapp(skillmap) || sizeof(skillmap)==0 ) return 1;

		skill = keys(skillmap);
		for (i=0; i<sizeof(skill); i++) {
			if( skillmap[skill[i]] == arg ) me->map_skill(skill[i]);
		}
	}
	
	return 1;
}
Exemplo n.º 5
0
int main(object me, string arg)
{
           mapping skill_map,enable_map;
           string *skills,*skill;
           int i,j;

           if( !arg || arg=="" ) return notify_fail("你要放弃哪一项技能?\n");

                 enable_map = me->query_skill_map();
                 skill=keys(enable_map);
                 skill_map=me->query_skills();
                 skills=keys(skill_map);
                for (i=0; i<sizeof(skills); i++)
              {
                if(skills[i] != arg) continue;
                for (j=0; j<sizeof(skill); j++)
                if(enable_map[skill[j]] == skills[i] ||
                   skill[j] == skills[i])
                   {
                         me->map_skill(skill[j]);
                         me->reset_action();
                   }
                         me->delete_skill(arg);
                         write("你成功地删除了"+to_chinese(arg)+"!\n");
                         return 1;
               }
                         write("你没学过这项技能!\n");
                         return 1;
}
Exemplo n.º 6
0
int valid_build(object who)
{
	int n;

	if(!who)
		return 0;

	if( mp && (who->query("family/family_name") != mp) )
	{
		tell_object(who,sprintf("只有本门派弟子才能使用『%s』。\n",
			name ));
		return 0;
	}

	if(who->query_skill(ski_name,1) < master_level)
	{
		tell_object(who,sprintf("你对『%s』的理解不够,无法主持此阵法。\n",
			name ));
		return 0;
	}

	if( !(n = who->query_skill(skill_type,1))
	|| (n < master_skill_level) )
	{
		tell_object(who,sprintf("你的『%s』等级太低,无法主持『%s』。\n",
			to_chinese(skill_type),name));
		return 0;
	}

	return 1;
}
Exemplo n.º 7
0
void do_abandon(string yn, object me, string arg)
{
     if(!me) return;

     if(!yn) {
	 write("什么?\n");
	 return;
     }

     if(yn[0]=='y' || yn[0]=='Y' ) {
	if( !me->delete_skill(arg) ) {
		write("你没有学过这项技能。\n");
		return;
	}

	write("你决定放弃继续学习" + to_chinese(arg) + "。\n");
	
	if(MISC_D->random_capture(me,8000,0)) return;

	return;
     } else {
	 write("你决定保留这项技能。\n");
	 return;
     }
}
Exemplo n.º 8
0
int exert(object me, object target)
{
        int i;
        string force_name;
        mapping conditions;

        if (me->query("neili") < 300)
        {
                write("你的内力不足,无法运满一个周天。\n");
                return 1;
        }

        force_name = to_chinese(me->query_skill_mapped("force"));

        if (me == target)
        {
                message_vision(HIW "$N" HIW "深吸一口气,又缓缓的吐了出来。\n" NOR, me);
                tell_object(me, YEL "你默运" + force_name +
                            ",开始排除身体中的异常症状。\n" NOR);
                 me->add("neili", -100);
        } else
        {
                message_vision(HIW "$N" HIW "深吸一口气,将手掌粘到$n"
                               HIW "的背后。\n" NOR,
                               me, target);
                tell_object(me, YEL "你默运" + force_name + ",开始帮助" +
                            target->name() + "排除身体中的异常症状。\n" NOR);
                tell_object(target, YEL + me->name() +
                            "正在运功帮助你排除身体中的异常症状。\n" NOR);
                me->add("neili", -250);
        }

        conditions = target->query_condition(); 
        if (conditions)
        {
                target->clear_condition();
                
                tell_object(target, YEL + me->name() + "正在运功将你身体中的异常症状尽数排除。\n" NOR);
                if (me == target)
                {
                        tell_object(me, WHT "你调息完毕,将内力收回丹"
                                        "田。\n" NOR);
                        me->start_busy(1 + random(2));
                } else
                {
                        tell_object(me, WHT "你调息完毕,将内力收回"
                                        "丹田。\n" NOR);
                        tell_object(target, WHT "你觉得内息一畅,看来是" +
                                            me->name() + "收功了。\n");
                        me->start_busy(2 + random(3));
                        if (! target->is_busy())
                                target->start_busy(1 + random(2));
                        message_vision(WHT "$N将手掌从$n背后收了回"
                                       "来。\n" NOR, me, target);
                }
        }

        return 1;
}
Exemplo n.º 9
0
int main(object me, string arg)
{
	if( !arg || arg=="" ) return notify_fail("你要放弃哪一项技能?\n");

	if( !me->delete_skill(arg) )
		return notify_fail("你并没有学过这项技能。\n");

	write("你决定放弃继续学习" + to_chinese(arg) + "。\n");
	return 1;
}
Exemplo n.º 10
0
int main(object me, string arg)
{
	string *skill;

	if( !arg || arg=="" ) return notify_fail("你要放弃哪一项技能?\n");

	if(!skill=SKILL_D(arg)->valid_enable());
		return notify_fail("你并没有学过这项技能。\n");
//	if( !me->delete_skill(arg) )
//		return notify_fail("你并没有学过这项技能。\n");

	write("你决定放弃继续学习" + to_chinese(arg) + "。\n");
	return 1;
}
Exemplo n.º 11
0
void  search_dir  (int  count,  string  *dir,  int  i,  string  address,  object  me)
{
    object  ob;
    int  j;
    string  *ppls,  name,  str,  adr,  s1,  s2,  s3,  s4;
    string  info;

    if  (i  ==  sizeof(dir))  {
          tell_object(me,"共有"+to_chinese(count)+"位使用者从这个地址上线。\n");
    }  else  {
        ppls  =  get_dir(DATA_DIR  +  "login/"  +  dir[i]  +  "/");
        for(j=0;  j<sizeof(ppls);  j++)  {
            reset_eval_cost();
            if  (sscanf(ppls[j],  "%s.o",  str)==1)  {
//  What  are  these  for???  Where  was  "name"  assigned?  
//                if  (name  ==  str)
//                    continue;
                ob  =  new(LOGIN_OB);
                ob->set("id",  str);
                if  (!  ob->restore())  {
                    destruct(ob);
                    continue;
                }
                if  (!  ob->query("last_from"))  {
                    destruct(ob);
                    continue;
                }
                adr  =  ob->query("last_from");
                if  (strsrch(adr,  address)==-1)  {
                    destruct(ob);
                    continue;
                }

                info  =  sprintf("%-10s%-14s%-11s%-6s%s\n",  
                                              ob->query("id"),
                                              ob->query("name"),
                                              ctime(ob->query("last_on"))[0..10],
                                              ctime(ob->query("last_on"))[20..24],
                                              ob->query("last_from"));
                tell_object  (me,info);

                destruct(ob);
                count  ++;
            }
        }
        i++;
        call_out  ("search_dir",0,count,dir,i,address,me);
    }
}
Exemplo n.º 12
0
int dispel(object me, object ob, int duration)
{
        int need_lvl;
	int need_neili;
	string cname;

        need_lvl = duration + 60;
	need_neili = duration * 10;
        if (me != ob)
                need_lvl = need_lvl * 3 / 2;
	if (me != ob)
		need_neili = need_neili * 3 / 2;

	cname = to_chinese(this_object()->name());
        if (need_lvl > me->query_skill("force"))
        {
                if (me == ob)
                {
                        tell_object(me, "你的内功火候尚有欠缺,无法驱除" + cname +"。\n");
                        return -1;
                } else
                {
                        tell_object(me, "你的内功火候尚有欠缺,无法帮助" + ob->name() + "驱除" + cname + "。\n");
                        return -1;
                }
        }

	if (me->query("neili") < need_neili)
	{
		tell_object(me, "你的内力现在不足,无法施展以驱除" + cname + "。\n");
		return -1;
	}
	me->add("neili", -need_neili);

        if (me == ob)
        {
                tell_object(me, "调息以后,你舒服多了,感觉" + cname + "被消除了。\n");
        } else
        {
                tell_object(me, "你将内力缓缓的输入到" + ob->name() + "经脉," +
                            ob->name() + "精神一振。\n");
                tell_object(ob, "你觉得" + me->name() +
                            "将内力输入你的奇经八脉,你舒服多了,感觉" + cname + "被消除了。\n");
        }

        ob->clear_condition(this_object()->name());

        return 1;
}
Exemplo n.º 13
0
int main(object me, string arg)
{
        mapping map;
        string *types, *skill, ski, map_to;
        int i, modify;
        string check;

	seteuid(getuid());
	if (arg) 
		sscanf(arg, "-%s %s", check, arg); 
	if (check=="check" && wizardp(me) && arg) {
		me = find_player(arg);
		if (!me) me = LOGIN_D->find_body(arg);
		if (!me) return notify_fail("没有这个人。\n");
		}

	if( !arg || check=="check" ) {
		map = me->query_skill_map();
		if( !mapp(map) || sizeof(map)==0 )
			return notify_fail(HIR"你现在没有使用任何特殊技能。\n"NOR);

		skill = keys(valid_types);
		write( CYN "以下是你目前使用中的特殊技能。\n" NOR );
		for (i=0; i<sizeof(skill); i++) {
			if( undefinedp(valid_types[skill[i]]) ) {
				map_delete(map, skill[i]);
				continue;
                        }
			if( !me->query_skill(skill[i]) ) continue;
			modify = me->query_temp("apply/" + skill[i]);
			printf( HIC "  %-20s "NOR+HIY" :"NOR+WHT" %-30s "NOR+RED"有效等级:%s%4d\n"NOR, 
				valid_types[skill[i]] + "(" + skill[i] + ")",
				undefinedp(map[skill[i]]) ? 
			             "无" : to_chinese(map[skill[i]]),
				(modify==0 ? HIW"+"NOR+YEL"" : (modify>0 ? HIC : HIR)),
				me->query_skill(skill[i]));
                }
                return 1;
        }

        if( arg=="?" ) {
                write(CYN"以下是可以使用特殊技能的种类:\n"NOR);
                skill = sort_array(keys(valid_types), (: strcmp :) );
                for(i=0; i<sizeof(skill); i++) {
                        printf("  %s (%s)\n", valid_types[skill[i]], skill[i] );
                }
                return 1;
        }
Exemplo n.º 14
0
 int climb_cliff(string str)
 {
	string skill;
   if(str!="cliff")
  {
    return 0;
   }
//	if(!stringp(skill = this_player()->query_skill_mapped("move")))
//	{
//	message_vision("$N想爬上这陡峭的山壁,但是因为没练轻功而有心无力,只好放弃\n", this_player());
//	return 1;
//	}
	message_vision("$N使出"+to_chinese(skill)+"身影消失在山壁中\n",this_player());
this_player()->move(__DIR__"hole");
 return 1;
 } 
Exemplo n.º 15
0
int main(object me, string arg)
{
    mapping skills;

	if( !arg || arg=="" ) return notify_fail("你要放弃哪一项技能?\n");

	skills=me->query_skills();
	if( !skills || undefinedp(skills[arg]) )
	    return notify_fail("你并没有学过这项技能。\n");

	if((int)skills[arg]>=10) {
	    write("你确定要放弃"+to_chinese(arg)+
		    "?(y/n)");
	    input_to("do_abandon",me,arg);
	} else
	    do_abandon("yes",me,arg);
	
	return 1;
}
Exemplo n.º 16
0
int main(object me, string arg)
{
	mapping smap, pmap;
	string *skill, basic1, basic2, arg1, arg2, arg3;
	int i, count;

	seteuid(getuid());

	smap = me->query_skill_map();

	if( !mapp(smap) || sizeof(smap)==0 )
		return notify_fail("你现在没有使用任何有效特殊技能。\n");

	pmap = me->query_skill_prepare();
	if (!pmap) pmap = ([]);

	if( !arg ) 
	{
		if( !mapp(pmap) || sizeof(pmap)==0 )
			return notify_fail("你现在没有组合任何特殊拳术技能。\n");

		skill = keys(valid_types);
		write("以下是你目前组合中的特殊拳术技能。\n");
		for (i=0; i<sizeof(skill); i++) {
			if( !me->query_skill(skill[i]) 
			|| !pmap[skill[i]] ) continue;
			write(	valid_types[skill[i]] + " (" + skill[i] + ")" 
				+ "   " + to_chinese(pmap[skill[i]]) + "\n");
		}
		return 1;
	}

	if( arg=="?" ) 
	{
		write("以下是可以使用特殊拳术技能的种类:\n");
		skill = sort_array(keys(valid_types), (: strcmp :) );
		for(i=0; i<sizeof(skill); i++) {
			printf("  %s (%s)\n", valid_types[skill[i]], skill[i] );
		}
		return 1;
	}
Exemplo n.º 17
0
void event_morning()
{
	string *dir, *file, place;
	object yinshi;
	object room;
	int i,j,flag=0;

        thief_yinshi=1;
        yinshi=create_thief();
//选择地点
	dir = get_dir("/d/");
	i = random(sizeof(dir));
	file = get_dir("/d/"+dir[i]+"/");
	j = random(sizeof(file));
	if(  	file[j][<2..<1]!=".c" ||
		dir[i]=="death" ||
		dir[i]=="wizard" ||
		dir[i]=="working" ||
		dir[i]=="binghuo" ||
		dir[i]=="xiakedao" ||
		dir[i]=="npc" )
	     {
		    dir[i]="wuyi";
	    	    file[j]="sangufeng";
		    room = load_object("/d/wuyi/sangufeng");
	      }
   if(!objectp(room) && !( room = find_object("/d/"+dir[i]+"/"+file[j]) ))
		room = load_object("/d/"+dir[i]+"/"+file[j]);
	 if (room->query_max_encumbrance() < 10000000)
	 {
	 	dir[i]="wuyi";
	 	file[j]="sangufeng";
	  room = load_object("/d/wuyi/sangufeng");
	}
	yinshi->move(room);
	CHANNEL_D->do_channel(yinshi, "sys",yinshi->query("name")+"在"+room->query("short")+"(/d/"+dir[i]+"/"+file[j]+")。\n");	        				
        message("channel:snow", HIY"【江湖传闻】"HIC + "听说在"+ to_chinese(dir[i]) + "一带隐居着一位武林前辈,江湖人士纷纷前往寻访!\n"NOR,users() );
//还原标识
	thief_yinshi=3;              
}
Exemplo n.º 18
0
int main(object me, string arg)
{
	mapping map;
	string *types, *skill, ski, map_to;
	int i, modify;

	seteuid(getuid());

	if( !arg ) {
		map = me->query_skill_map();
		if( !mapp(map) || sizeof(map)==0 )
			return notify_fail("你现在没有使用任何特殊技能。\n");

		skill = keys(valid_types);
		write("以下是你目前使用中的特殊技能。\n");
		for (i=0; i<sizeof(skill); i++) {
			if( undefinedp(valid_types[skill[i]]) ) {
				map_delete(map, skill[i]);
				continue;
			}
			if( !me->query_skill(skill[i]) ) continue;
			modify = me->query_temp("apply/" + skill[i]);
			printf("  %-20s: %-20s  有效等级:%s%3d\n" NOR,
				valid_types[skill[i]] + " (" + skill[i] + ")",
				undefinedp(map[skill[i]]) ? "无" : to_chinese(map[skill[i]]),
				(modify==0 ? "" : (modify>0 ? HIC : HIR)),
				me->query_skill(skill[i]));
		}
		return 1;
	}

	if( arg=="?" ) {
		write("以下是可以使用特殊技能的种类:\n");
		skill = sort_array(keys(valid_types), (: strcmp :) );
		for(i=0; i<sizeof(skill); i++) {
			printf("  %s (%s)\n", valid_types[skill[i]], skill[i] );
		}
		return 1;
	}
Exemplo n.º 19
0
int valid_member(object who)
{
	int n;

	if(!who)
		return 0;

	if(mp && (who->query("family/family_name") != mp) )
		return notify_fail(sprintf("只有本门派弟子才能使用『%s』。\n",
			name ));

	if(who->query_skill(ski_name,1) < member_level)
		return notify_fail(sprintf("%s对『%s』的理解不够,无法参加%s。\n",
			who->name(),name,name));

	if( !(n = who->query_skill(skill_type,1))
	|| (n < member_skill_level) )
		return notify_fail(sprintf("%s的『%s』等级太低,无法参加『%s』。\n",
			who->name(),to_chinese(skill_type),name));

	return 1;
}
Exemplo n.º 20
0
int valid_learn(object me)
{
        int level;
        int i;

        if (me->query("character") != "光明磊落" || me->query("character")!="国土无双" )
                return notify_fail("中华傲决正大恢弘,气度俨然,你"
                                   "怎么也学不得神似。\n");

        if ((int)me->query("combat_exp") < 3000000)
                return notify_fail("你觉得中华傲决深奥之极,"
                                   "凭自己的战斗经验一时间难以领会。\n");

        if ((int)me->query_skill("martial-cognize", 1) < 300)
                return notify_fail("你觉得中华傲决过于深奥之极,以"
                                   "自己的武学修养全然无法明白。\n");

        if (me->query("int") < 35)
                return notify_fail("你觉得中华傲决过于艰深,难以理解。\n");

        if (me->query("con") < 31)
                return notify_fail("依照你的根骨无法修炼中华傲决。\n");

        if (me->query("gender") == "无性" &&
            (int)me->query_skill("zhonghua-aojue", 1) > 219)
                return notify_fail("你无根无性,阴阳不调,难以领会高深的中华傲决。\n");

        level = me->query_skill("zhonghua-aojue", 1);

        if ((int)me->query_skill("martial-cognize", 1) < level)
                return notify_fail("你觉得自己的武学修养有限,难以领会更高深的中华傲决。\n");

        for (i = 0; i < sizeof(usage_skills); i++)
                if (me->query_skill(usage_skills[i], 1) < level)
                        return notify_fail("你对" + to_chinese(usage_skills[i]) +
                                           "的理解还不够,无法继续领会更高深的中华傲决。\n");

        return 1;
}
Exemplo n.º 21
0
int main(object me, string arg)
{
	string banghui,someone,something,skl;
	int i,money,exp,level;
	object ob;
	
	if(! arg)	return notify_fail("请使用help tisheng,查看此命令。\n");
	if(sscanf(arg,"%s %s",something,someone)!=2)
		return notify_fail("请使用help tisheng,查看此命令。\n");
	if(something=="-skl")	{
		if(sscanf(someone,"%s %s",skl,someone)!=2)
			return notify_fail("请使用help tisheng,查看此命令。\n");
	}
	if(something!="-skl"&&something!="-exp"&&something!="-zc")
		return notify_fail("请使用help tisheng,查看此命令。\n");
	if(! ob=present(someone,environment(me)))
		return notify_fail("这儿没有这么个人。\n");
	if(! ob->is_character())
		return notify_fail("看清楚,它不是生物。\n");
	if( userp(ob))
		return notify_fail("你只能提升本帮NPC帮众的技能。\n");
	if( !living(ob))
		return notify_fail("你得先把"+ob->query("name")+"弄醒再说。\n");
	if(me->is_fighting()||me->is_busy())
		return notify_fail("你正忙着呢。\n");
	if(ob->is_fighting()||ob->is_busy())
		return notify_fail(ob->query("name")+"正忙着呢。\n");
	if(! stringp(banghui=me->query("banghui")))
		return notify_fail("你没有参加任何帮会,无法提升任何NPC。\n");
	if( banghui!=(string)ob->query("banghui"))
		return notify_fail("你只能提升本帮会内的NPC帮众。\n");
	if(sizeof(children(base_name(ob)+".c"))>2)
		return notify_fail(ob->query("name")+"似乎现在不接受你的提升命令。\n");
	if(! ob->query("zhengzhao"))
		return notify_fail("你无法提升"+ob->name()+"!\n");
	if(something=="-skl")		{
		level=(int)ob->query_skill(skl,1);
		if(! level)
			return notify_fail(ob->query("name")+"并不会这门武功。\n");
		if(level>=200)
			return notify_fail(ob->query("name")+"的这门武功已学到顶了。\n");
		money=level*level*10;
		if((int)me->query("balance")<money)	{
		return notify_fail("你账上的钱不够,"+ob->query("name")+
		"的这门武功提升一级,需要"+MONEY_D->money_str(money)+"!\n");
		}
		ob->set_skill(skl,level+1);
		me->add("balance",-money);
		me->save();
		ob->save();
		write("你花了"+MONEY_D->money_str(money)+",把"+
		ob->query("name")+"的"+to_chinese(skl)+"提升了一级!\n");
	}
	else if(something=="-exp")	{
		if((int)ob->query("combat_exp")>=2000000)
			return notify_fail(ob->query("name")+"的实战经验已经到顶了。\n");
		money=10000;
		if(me->query("balance")<10000)
			return notify_fail("你帐上的钱不够,"+ob->query("name")+
			"的战斗经验提升1000点需要一两黄金!\n");
		me->add("balance",-money);
		me->save();
		ob->add("combat_exp",1000);
		ob->save();
		write("你花了一两黄金,将"+ob->query("name")+
		"的战斗经验提升了一千点!\n");
	}
	else if(something=="-zc")	{
		money=10000;
		if(me->query("balance")<10000)
			return notify_fail("你帐上的钱不够,"+ob->query("name")+
			"的忠诚度提升一点需要一两黄金!\n");
		if((int)ob->query("zhongcheng")>=(int)ob->query("max_zhongcheng"))
			return notify_fail(ob->query("name")+"的忠诚度已经达到最大,不需要进行提升了。\n");
		me->add("balance",-money);
		me->save();
		if((int)ob->query("zhongcheng")+10>=(int)ob->query("max_zhongcheng"))
			ob->set("zhongcheng",(int)ob->query("max_zhongcheng"));
		else	ob->add("zhongcheng",10);
		ob->save();
		write("你花了一两黄金,将"+ob->query("name")+
		"的忠诚度提升了十点!\n");
	}
	return 1;
}
Exemplo n.º 22
0
Arquivo: sea.c Projeto: aricxu/xkx100
int do_practice(string arg)
{
	object *inv, weapon, me = this_player();
	string skillarg, str, multiple, skillname;
	int w, *cost, times, total, skill_special, skill_basic;
	mapping fam, skills, learned;

	skills = me->query_skills();
	learned = me->query_learned();
	skill_basic = me->query_skill(arg, 1);
	if( !stringp(skillname = me->query_skill_mapped(arg)) )
	{
		tell_object(me,"你必须有特殊武功方能与基本武技参照领悟!\n");
		return 1;
	}
	skill_special = me->query_skill(skillname, 1);

	if( skill_special < 1 )
	{
		tell_object(me,"你对这方面的技能还是一窍不通,最好从先从基本学起。\n");
		return 1;
	}	
	if( skill_basic > skill_special )
	{
		tell_object(me,"你" + to_chinese(skillname) + "功力不够,无法继续领悟" + to_chinese(arg) + "!\n");
		return 1;
	}
	skill_special = skill_special * me->query("max_jing") * 2 / (1000 + me->query("max_jing"));

	if( me->is_busy() )
	{
		tell_object(me, "你现在正忙着呢。\n");
		return 1;
	}
	if( me->is_fighting() )
	{
		tell_object(me, "你已经在战斗中了,学一点实战经验吧。\n");
		return 1;
	}
	if( !arg ) return ("/cmds/skill/enable")->main(me, arg);
	if(sscanf(arg, "%s %d", skillarg, times) != 2 )
		skillarg = arg;
	if( (w = member_array(skillarg, practice_types)) == -1 )
	{
		tell_object(me, "这项技能不能在这儿练习。\n");
		return 1;
	}
	if( w < 6 )
	{
		if( !objectp(weapon = me->query_temp("weapon")) )
		{
			tell_object(me, "你没有拿武器怎么练习?\n");
			return 1;
		}
		else
			if( weapon->query("skill_type") != skillarg )
			{
				tell_object(me, "你手中的武器不适合练你想练习的技能。\n");
				return 1;
			}
	}
	if( (int)me->query_skill(skillarg, 1) < 30 )
	{
		tell_object(me, "你还是先去跟师父多学习。\n");
		return 1;
	}
	if(!times || times == 0)
	{
		times = 1;
		multiple="";
	}
	else multiple="反复";
	switch(skillarg) {
		case "blade" :
		case "club"  :
		case "staff" :
		case "stick" :
		case "sword" : 
		case "whip"  : str = "挥舞" + weapon->name(); break;
		case "cuff"  : str = "挥舞双拳"; break;
		case "strike": str = "挥舞双掌"; break;
		case "parry" : str = "奋力拚博"; break;
		case "dodge" : str = "纵闪跳跃"; break;
	}		
	message_vision("$N在海浪中" + str + multiple + "练习着" + to_chinese(skillarg) + "。\n", me);

	for(times; times > 0; times--)
	{
		cost = cost(me, skillarg);
		if( (int)me->query("jing") < cost[0] ||
			 (int)me->query("qi") < cost[1] )
		{
			tell_object(me, "依你当前的状况来看你不能如此练习。\n");
			return 1;
		}
		me->receive_damage("qi", cost[1]);
		me->receive_damage("jing", random(skill_basic)/2,"冥思苦想把脑袋给想破了,白白的脑浆流了一地");
		me->improve_skill(skillarg, skill_special/8 + random(skill_special/4));

		total = (int)me->query("jing") + (int)me->query("qi");
		if( total < 500 && random(total) < 20 )
		{
			message_vision("突然一个巨浪打来,$N陷入旋涡中,立即被海水吞没了。\n", me);
			for(int i = 0; i < sizeof(inv); i++)
			{
				if( userp(inv[i]) )
					inv[i]->receive_wound("qi", 50 + inv[i]->query("max_qi"), "掉进海里淹死了");
				else destruct(inv[i]);
			}

			me->unconcious();
			me->move("/d/shenlong/beach");
			message("vision","你发现一个浑身水淋淋的家伙被海水冲上岸来,不由得走近一看,原来是"+me->name()+"\241\243\n", environment(me), ({me}));
			return 1;
		}
Exemplo n.º 23
0
int do_learn(string arg)
{
   string skill, teacher, master;
   object me= this_player(), ob;
   int master_skill, my_skill, sen_cost;

   if(!arg || sscanf(arg, "%s from %s", skill, teacher)!=2 )
     return notify_fail("指令格式:xuexi <技能> from <某人>\n");

   if( me->is_fighting() )
     return notify_fail("临阵磨枪?来不及啦。\n");

   if( !(ob = present(teacher, environment(me))) || !ob->is_character())
     return notify_fail("你要向谁求教?\n");

   if( !living(ob) )
     return notify_fail("嗯...你得先把" + ob->name() + "弄醒再说。\n");

   if( !master_skill = ob->query_skill(skill, 1) )
     return notify_fail("这项技能你恐怕必须找别人学了。\n");

   if (skill != "unarmed" || !me->query_temp("temp/learn") ) 
     return notify_fail( ob ->name() + reject_msg[random(sizeof(reject_msg))] );

   notify_fail(ob->name() + "不愿意教你这项技能。\n");
   if( ob->prevent_learn(me, skill) )
     return 0;

   my_skill = me->query_skill(skill, 1);
   if( my_skill >= master_skill )
     return notify_fail("这项技能你的程度已经不输你师父了。\n");

   notify_fail("依你目前的能力,没有办法学习这种技能。\n");
   if( !SKILL_D(skill)->valid_learn(me) ) return 0;

   sen_cost = 250 / (int)me->query_int();

   if( !my_skill ) {
     sen_cost *= 2;
     me->set_skill(skill,0);
   }

   if( (int)me->query("learned_points") >= (int)me->query("potential") )
     return notify_fail("你的潜能已经发挥到极限了,没有办法再成长了。\n");
   printf("你向%s请教有关「%s」的疑问。\n", ob->name(),
     to_chinese(skill));

   if( ob->query("env/no_teach") )
     return notify_fail("但是" + ob->name() + "现在并不准备回答你的问题。\n");

   tell_object(ob, sprintf("%s向你请教有关「%s」的问题。\n",
     me->name(), to_chinese(skill)));

   if( (int)ob->query("sen") > sen_cost/5 + 1 ) {
     if( userp(ob) ) ob->receive_damage("sen", sen_cost/5 + 1);
   } else {
     write("但是" + ob->name() + "显然太累了,没有办法教你什么。\n");
     tell_object(ob, "但是你太累了,没有办法教" + me->name() + "。\n");
     return 1;
   }
     

   if( (int)me->query("sen") > sen_cost ) {
     if( (string)SKILL_D(skill)->type()=="martial"
     &&   my_skill * my_skill * my_skill / 10 > (int)me->query("combat_exp") ) {
        printf("也许是道行不够,你对%s的回答总是无法领会。\n", ob->name() );
     } else {
        printf("你听了%s的指导,似乎有些心得。\n", ob->name());
        me->add("learned_points", 1);
        me->improve_skill(skill, random(me->query_int()));
     }
   } else {
     sen_cost = me->query("sen");
     write("你今天太累了,结果什么也没有学到。\n");
   }

   me->receive_damage("sen", sen_cost );

   return 1;
}
Exemplo n.º 24
0
int play(object me, object ob, string arg)
{
        int lvl;
        //int i;
        string m_name;

        if (! arg)
                return notify_fail("你要吹什么曲子?\n");

        if (! (lvl = me->query_skill(arg, 1)))
                return notify_fail("你不会吹这首曲子。\n");

        if (! SKILL_D(arg)->valid_enable("chuixiao-jifa"))
                return notify_fail("这也能当箫曲吹么?\n");

        lvl += me->query_skill("chuixiao-jifa", 1) / 2;
        m_name = to_chinese(arg);

        if (me->is_busy())
                return notify_fail("你现在正忙,等会儿再吹箫吧。\n");

        if (lvl < 15)
        {
                message_vision(WHT "\n$N" WHT "鼓足气吹了一下$n" WHT ",结果只"
                               "是发出几下刺耳的呜呜声。\n" NOR, me, ob);
        } else
        if (lvl < 30)
        {
                message_vision(WHT "\n$N" WHT "鼓足气吹了一下$n" WHT ",发出几"
                               "声怪响,难听的一塌糊涂。\n" NOR, me, ob);
        } else
        if (lvl < 60)
        {
                message_vision(WHT "\n$N" WHT "拿起$n" WHT "轻轻吹了几声,声音"
                               "还算马马虎虎,不太难听。\n" NOR, me, ob);
        } else
        if (lvl < 90)
        {
                message_vision(HIW "\n$N" HIW "拿起$n" HIW "吹了一首" + m_name +
                               HIW ",韵律洋洋洒洒,颇为不错。\n" NOR, me, ob);
        } else
        if (lvl < 150)
        {
                message_vision(HIW "\n$N" HIW "拿起$n" HIW "吹了一首" + m_name +
                               HIW ",颇为动人,引人入胜。\n" NOR, me, ob);
        } else
        if (lvl < 225)
        {
                message_vision(HIW "\n$N" HIW "拿起$n" HIW "吹了一首" + m_name +
                               HIW ",听得众人感慨万千,甚是投入。\n" NOR, me,
                               ob);
        } else
        if (lvl < 300)
        {
                message_vision(HIC "\n$N" HIC "拿起$n" HIC "吹了一首" + m_name +
                               HIC ",箫音如梦如幻,似乎有一股清香直沁心脾。\n"
                               NOR, me, ob);
        } else
        {
                message_vision(HIG "\n$N" HIG "拿起$n" HIG "吹了一首" + m_name +
                               HIG ",若哀若思,犹如身临其境,忽悲忽喜,又如乘"
                               "风而行,不知踪影。\n" NOR, me, ob);
        }
        me->start_busy(3 + random(3));

        SKILL_D(arg)->do_effect(me);
        return 1;
}
Exemplo n.º 25
0
Arquivo: help.c Projeto: aricxu/xkx100
int main(object me, string arg)
{
	int i, j = 0, k, w, templen;
	string file, *search, exert, str, *skfile, here, here1;
	object sk;
	mapping lrn;
	mixed *cmds;

// 不带参数,则显示帮助主菜单
	if( !arg )
	{
//		cat(HELP_DIR + "help/topics");
		me->start_more(read_file(HELP_DIR + "help/topics"));
		return 1;
	}
// 参数为here,显示本地所在地址的帮助
	if( arg == "here")
	{
		file = file_name(environment(me));
		if( sscanf(file, "/d/%s/%s", here, here1) != 2)
			return notify_fail("这个地方没有帮助说明。\n");
		else
		{
// 扬州目录为city,特别列出
			if( here == "city") arg = "yangzhou";
			else arg = here;
		}
	}
// 命令帮助,则取 /cmds/目录下的命令文件的自带帮助
	if( arg == "cmds")
	{
		cmds = get_dir("/cmds/usr/");
		write(HIC"〖用户系统命令〗\n"NOR);
		w = 0;
		for ( i = 0; i < sizeof(cmds); i++)
		{
			file = cmds[i];
		  if ( file[strlen(file)-2..strlen(file)-1]==".c" &&
//			if(strsrch(file,".c") >= 0 &&
				strsrch(file,".bak") < 0 &&
				strsrch(file,".swp") < 0)
			{
				file = replace_string(file, ".c", " ");
				write(file);
				k = strlen(file);
				k = 12-k;
				while(k--) write(" ");
				w++;
				if(!(w % 6)) write("\n");
			}
		}
		write("\n");
		cmds = get_dir("/cmds/std/");
		write(HIC"〖交流探险命令〗\n"NOR);
		w = 0;
		for ( i = 0; i < sizeof(cmds); i++)
		{
			file = cmds[i];
//			if(strsrch(file,".c") >= 0 &&
		  if ( file[strlen(file)-2..strlen(file)-1]==".c" &&
				strsrch(file,".bak") < 0 &&
				strsrch(file,".swp") < 0)
			{
				file = replace_string(file, ".c", " ");
				write(file);
				k = strlen(file);
				k = 12-k;
				while(k--) write(" ");
				w++;
				if(!(w % 6)) write("\n");
			}
		}
		write("\n");
		cmds = get_dir("/cmds/skill/");
		write(HIC"〖武功技能命令〗\n"NOR);
		w = 0;
		for ( i = 0; i < sizeof(cmds); i++)
		{
			file = cmds[i];
//			if(strsrch(file,".c") >= 0 &&
		  if ( file[strlen(file)-2..strlen(file)-1]==".c" &&
				strsrch(file,".bak") < 0 &&
				strsrch(file,".swp") < 0)
			{
				file = replace_string(file, ".c", " ");
				write(file);
				k = strlen(file);
				k = 12-k;
				while(k--) write(" ");
				w++;
				if(!(w % 6)) write("\n");
			}
		}
		write("\n");
		write(HIY"请用help <命令名> 查看详细说明。\n"NOR);
		return 1;
	}
// Else, try if a command name is specified.
	seteuid(getuid());
	if( stringp(file = me->find_command(arg)) )
	{
		notify_fail("有这个指令存在,但是并没有详细的说明文件。\n");
		return file->help(me);
	}

// 查找帮助文件的路径
	if( pointerp(search = me->query("help_search_path")) )
	{
		i = sizeof(search);
		while(i--) if( file_size(search[i] + arg)>0 )
		{
			me->start_more( read_file(search[i] + arg) );
			return 1;
		}
	}

// Support efun/lfun help with same name as other topics such as
// ed() and ed command.
	sscanf(arg, "%s()", arg);

// Finally, search the default search paths.
	if( pointerp(default_search) )
	{
		i = sizeof(default_search);
		while(i--) if( file_size(default_search[i] + arg)>0 )
		{
			me->start_more( read_file(default_search[i] + arg) );
			return 1;
		}
	}
// 武功帮助文件
	sscanf(arg, "%s.%s", arg, str);
	if(file_size(SKILL_D(arg)+".c") < 1)
		return notify_fail("没有针对这项主题的说明文件。\n");
	
// 武功绝招帮助文件
	if( stringp(str) )
	{
		if( stringp(exert = SKILL_D(arg)->exert_function_file("")) &&
			file_size(exert + str +".c") > 0)
		{
			notify_fail("对不起,"+to_chinese(arg)+"内功方面的「"+str+"」功能没有详细的说明。\n");
			return (exert + str)->help(me);
		}
		else
		if( stringp(exert = SKILL_D(arg)->perform_action_file("")) &&
			file_size(exert + str +".c") > 0)
		{
			notify_fail("对不起,"+to_chinese(arg)+"外功方面的「"+str+"」功能没有详细的说明。\n");
			return (exert + str)->help(me);
		}
		return notify_fail("对不起,"+to_chinese(arg)+"没有「"+str+"」这项功能。\n");
	}
	if(!SKILL_D(arg)->help(me))
	{
		write(HIY"\n指定武技没有详细帮助说明。\n"NOR);
	}

	lrn = me->query_learned();
	if( !mapp(lrn) ) lrn = ([]);

	str = sprintf("\n┌────%s",HIW"【"YEL+to_chinese(arg)+HIW"    功能表】"NOR);
	str += sprintf("───────────");
	for (k=18-strlen(to_chinese(arg)); k>0; k--)
	{
		str += sprintf("─");
		k--;
	}
	str += sprintf("┐\n");

	str = replace_string(str, "  ", "─");
//	str += sprintf("│"HIY"目前等级"NOR":     %3d/%6d              "HIY "武功类别"NOR":  %-4s%9s\n", me->query_skill(arg, 1), (int)lrn[arg], SKILL_D(arg)->type()=="knowledge" ? "知识":"武技", "│");
	str += sprintf("│"HIY"目前等级"NOR":     %3d/%6d              "HIY "武功类别"NOR":  %-4s%9s\n", me->query_skill(arg, 1), (int)lrn[arg], SKILL_D(arg)->type()=="knowledge" ? "知识" : SKILL_D(arg)->martialtype()=="skill" ? "武技" : SKILL_D(arg)->martialtype()=="dodge" ? "轻功" : "内功" , "│");

	if(SKILL_D(arg)->type() != "martial" ||
		member_array(arg, keys(valid_type))!=-1) 
		return notify_fail(str+"└───────────────────────────────┘\n");
	str+="│                                                              │\n";
	sk = load_object(SKILL_D(arg));

	exert = skill_enables(sk);
	if(exert != "")
	{
		str += exert;
		i++;
	}

	if( stringp(exert = SKILL_D(arg)->exert_function_file("")) )
	{
		skfile = get_dir(exert);
		if( sizeof(skfile) > 0)
		{
			skfile = filter_array(skfile, (: sort_skill :) );
			j = sizeof(skfile);
		}
	}
Exemplo n.º 26
0
int main(object me, string arg)
{
	string skill, teacher, master, skill_name;
	object ob;
	int master_skill, my_skill, jing_cost, times, pertimes;
	int improve_points;

        if (me->is_busy())
                return notify_fail("你现在正忙着呢。\n");

	if(!arg || (sscanf(arg, "%s %s %d", teacher, skill, times)!=3 ))
		return notify_fail("指令格式:learn|xue <某人> <技能> <次数>\n");

	if (times < 1 || times > 100)
		return notify_fail("学习次数最少一次,最多也不能超过一百次。\n");

	if( me->is_fighting() )
		return notify_fail("临阵磨枪?来不及啦。\n");

	if( !(ob = present(teacher, environment(me))) || !ob->is_character())
		return notify_fail("你要向谁求教?\n");

	if( !living(ob) )
		return notify_fail("嗯....你得先把" + ob->name() + "弄醒再说。\n");

	if( !me->is_apprentice_of(ob) && !(ob->recognize_apprentice(me)) ) {
		return	notify_fail( ob ->name() + reject_msg[random(sizeof(reject_msg))] );
	}

	if( !master_skill = ob->query_skill(skill, 1) )
		return notify_fail("这项技能你恐怕必须找别人学了。\n");

	notify_fail(ob->name() + "不愿意教你这项技能。\n");
	if( ob->prevent_learn(me, skill) )
		return 0;

	my_skill = me->query_skill(skill, 1);
	if( my_skill >= master_skill )
		return notify_fail("这项技能你的程度已经不输你师父了。\n");

	if( my_skill >= (int)(master_skill - me->query("betrayer")*2))
		return notify_fail(ob->name() + "皱了皱眉头,不禁想起你过去的叛师经历。\n");

	notify_fail("依你目前的能力,没有办法学习这种技能。\n");
	if( !SKILL_D(skill)->valid_learn(me) ) return 0;

	jing_cost = 150 / (int)me->query("int");
	if( !my_skill ) {
		jing_cost *= 2;
		me->set_skill(skill,0);
	}

	if( (me->query("potential") - me->query("learned_points")) < times )
		return notify_fail("你的潜能不够学习这么多次了。\n");
	printf(HIC"你向%s请教了"+chinese_number(times)+"句有关「%s」的疑问。\n"NOR, ob->name(), to_chinese(skill));

	if( ob->query("env/no_teach") )
		return notify_fail("但是" + ob->name() + "现在并不准备回答你的问题。\n");

	tell_object(ob, sprintf("%s向你请教有关「%s」的问题。\n",
		me->name(), to_chinese(skill)));

	if( (int)ob->query("jing") > jing_cost*times/5 + 1 )
	{
		if( userp(ob) ) ob->receive_damage("jing", jing_cost/5 + 1);
	} else
	{
		write("但是" + ob->name() + "显然太累了,没有办法教你什麽。\n");
		tell_object(ob, "但是你太累了,没有办法教" + me->name() + "。\n");
		return 1;
	}

	if( (int)me->query("jing") > jing_cost * times )
	{
		if( (string)SKILL_D(skill)->type()=="martial"
		&& my_skill * my_skill * my_skill / 10 > (int)me->query("combat_exp") )
		{
			return notify_fail("也许是缺乏实战经验,你对"+ob->name()+"的回答总是无法领会。\n");
		} else
		{
			if(skill_name = SKILL_D(skill)->query_skill_name(my_skill))
	 			printf("你听了%s的指导,对「%s」这一招似乎有些心得。\n", ob->name(),
					skill_name);
			else
				printf("你听了%s的指导,似乎有些心得。\n", ob->name());
			for (pertimes = 1; pertimes <= times ; pertimes ++)
			{
				me->add("learned_points", 1);

				// 调整向师父学习技能的速度,加重对叛师的惩罚。
				// Added by Constant Jan 11 2001
				improve_points = me->query_int() + me->query("int") / 2;
				improve_points = improve_points / (me->query("betrayer") + 1);
				if (improve_points < 15)
					improve_points = 15;
				improve_points = random(improve_points);

				me->improve_skill(skill, improve_points);
			}
		}
	} else
	{
		if (jing_cost > me->query("jing"))
			jing_cost = me->query("jing");
		return notify_fail("你今天太累了,结果什么也没有学到。\n");
	}
	me->receive_damage("jing", jing_cost * times );
	return 1;
}
Exemplo n.º 27
0
int perform(object me, object target)
{
        object weapon;
        string msg;
        int ap, dp;
        int damage;
        int attack;

        if (! me->query("can_perform/" + "daojian-guizhen" + "/" + "feidao"))
                return notify_fail("你还没有受到高手指点,还不会运用" PFM "。\n");

        if (! target)
        {
                me->clean_up_enemy();
                target = me->select_opponent();
        }

        if (! target || ! me->is_fighting(target))
                return notify_fail(PFM "只能对战斗中的对手使用。\n");

        if (member_array("blade", weapon_sk) != -1)
        {
                attack = WEAPON_ATTACK;
                if (! objectp(weapon = me->query_temp("weapon"))
                   || (string)weapon->query("skill_type") != "blade")
                        return notify_fail("你所使用的武器不对,难以施展" PFM "。\n");
        } else
        {
                attack = UNARMED_ATTACK;
                if (me->query_temp("weapon") || me->query_temp("secondary_weapon"))
                        return notify_fail(PFM "只能空手使用。\n");             
        }
        
        if ((int)me->query_skill("daojian-guizhen", 1) < 400)
                return notify_fail("你" + to_chinese("daojian-guizhen") + "不够娴熟,难以施展" PFM "。\n");

        if (member_array("blade", weapon_sk) == -1)
        {
                if (me->query_skill_prepared("blade") != "daojian-guizhen")
                        return notify_fail("你没有准备" + to_chinese("daojian-guizhen") + ",难以施展" PFM "。\n");
        }
        
        if (me->query("neili") < 300)
                return notify_fail("你现在的真气不够,难以施展" PFM "。\n");

        if (! living(target))
                return notify_fail("对方都已经这样了,用不着这么费力吧?\n");

        msg = HIW "$N对着$n一声大吼:“看我的绝招,「小李老母的飞刀」!”,说完,抡起手中的武器向$n砸了过去,看似毫无章法,却是暗含刀道的至境!" + "\n" + NOR;

        ap = ap_power(me, "blade");
        dp = dp_power(target, "parry");
         
        if (ap * 2 / 3 + random(ap * 2) > dp)
        {
                damage = da_power(me, "blade") * 3;
                msg += COMBAT_D->do_damage(me, target, attack, damage, 100, HIM "$n闯荡江湖多年,哪见过如此奥妙的招式,一时间无法破解,被刺个通体透凉!" + "\n" NOR);
                me->add("neili", -200);
                me->start_busy(1);
                if (! target->is_busy())
                        target->start_busy(2);
        } else
        {
                msg += NOR + CYN "$p白了$P一眼:“雕虫小技,看我的”,整个人忽地施展出狗趴式,躲过了这至命一击。" + "\n" NOR;
                me->add("neili", -100);
                me->start_busy(2);
        }
                
        message_sort(msg, me, target);
        return 1;
}
Exemplo n.º 28
0
int main(object me, string arg)
{
        object ob;
        mapping skill;
        int cost, intt, literate,repeat,i;
        string name;

        repeat=0;
        if( me->is_fighting() )
                return notify_fail("你无法在战斗中专心下来研读新知!\n");
        if(!arg)
                return notify_fail("你要读什么?\n");

        if(sscanf(arg,"%d %s",repeat,name)==2)
                arg=name;

        if(!repeat) repeat=1;

        if(!arg || !objectp(ob = present(arg, me)) )
                return notify_fail("你要读什么?\n");

        if( !mapp(skill = ob->query("skill")) )
          return notify_fail("这东西并不是武术秘籍, 你无法从它学到东西。\n");

        if( !(literate=me->query_skill("literate", 1)) )
                return notify_fail("你是个文盲,先学学读书识字(literate)吧。\n");

        if ( (int)me->query("combat_exp") < skill["exp_required"] )
          return notify_fail ("你的实战经验不足,再怎么读也没用。\n");

        if( !SKILL_D(skill["name"])->valid_learn(me) )
          return 0;
          //notify_fail("以你目前的能力,还没有办法学这个技能。\n");
// fix by Onion.
// skill 里的 valid_learn() 都有写 notify_fail(), 应以 skill 的叙述就好。
        if (ob->valid_learn(me)<0)
          return notify_fail ("据说你还不够格读此书哩!\n");

        cost = skill["difficulty"] - (intt=(int)me->query("int"));
        if (cost < 0) cost = 0;
        cost = -literate/10+skill["sen_cost"] + skill["sen_cost"]  * cost/20;
        if( cost < 0 ) cost = skill["sen_cost"];
        if(me->query("class")=="scholar")
                cost=cost*2/3;
        for(i=0;i<repeat;i++)
        {
        if( (int)me->query("sen") < cost ) {
                write("你现在过于疲倦,无法专心下来研读新知。\n");
                return 1;
        }

        if( me->query_skill(skill["name"], 1) > skill["max_skill"] )
          return notify_fail ("你发现上面所说的对你而言都太浅了。\n");

        me->receive_damage("sen", cost);

        if( !me->query_skill(skill["name"], 1) )
                me->set_skill(skill["name"], 1);
        else {
          // Modify By chun 95/10/27
          // 由literate的影响改为受int的影响
          // wade fix in 1/4/1996, 改为混合 literate 与 悟性 两者
          intt = intt/2;
          me->improve_skill(skill["name"], literate/10+random(intt)+5);
          if(me->query("class")=="scholar")
                me->improve_skill(skill["name"], literate/10+random(intt)+5);
        }

        message("vision", me->name() + "正专心地研读" + ob->name()
                + "。\n", environment(me), me);

        write("你研读有关" + to_chinese(skill["name"]) + "的技巧,似乎有点心得。\n");
        }
        return 1;
}
Exemplo n.º 29
0
int do_mianbi(string arg)
{
   object ob;

   ob = this_player();
   if ( !arg )
   {
      message_vision("$N面对着石柱趺坐静思良久,白忙一场,一无所获。\n",ob);
      return 1;
   }
   if ((int)ob->query_skill("taoism", 1) <100)
   {
      message_vision("$N面对着石柱上满面蝌蚪文,没一个字认识。\n",ob);
      return 1;
   }
   if ((int)ob->query_skill("literate", 1) <100)
   {
      message_vision("$N对石柱上每一个字都认识,就是不知道说的是什么。\n",ob);
      return 1;
   }
   if (((int)ob->query_skill("huagong-dafa", 1) >0)||
       ((int)ob->query_skill("huntian-qigong", 1) >0)||
       ((int)ob->query_skill("hunyuan-yiqi", 1) >0)||
       ((int)ob->query_skill("linji-zhuang", 1) >0)||
       ((int)ob->query_skill("xuantian-force", 1) >0)||
       ((int)ob->query_skill("zixia-shengong", 1) >0))
   {
      message_vision("$N旁门杂学太多了,实在静不下心来面壁。\n",ob);
      return 1;
   }    
   if (
      arg == "liangyi-jian" ||
      arg == "tiyunzong")
   {
      if ((int)ob->query_skill(arg, 1) <100)
      {
         message_vision("$N的" + to_chinese(arg) + "显然太低,无法领悟石柱内容。\n",ob);
         return 1;
      }
      if ((int)ob->query_skill(arg, 1) > 180)
      {
         message_vision("$N的" + to_chinese(arg) + "已经没必要读石柱内容了。\n",
ob);
         return 1;
      }
      if(((ob->query_skill(arg,1)
        *ob->query_skill(arg,1)
        *ob->query_skill(arg,1)/10)> (int)ob->query("combat_exp"))
        && arg != "literate")
      {
         message_vision("$N的实战经验不足,无法领悟石柱内容。\n",ob);
         return 1;
      }
      if (ob->query("jing")<20)
      {
         message_vision("$N太累了,现在无法领悟石柱内容。\n",ob);
         return 1;
      }
      message_vision("$N面对着石柱趺坐静思,良久,对" + to_chinese(arg) + "似有所悟。\n",ob);
      ob->improve_skill(arg, random(10*ob->query("int")));
      ob->add("jing",-5);
      return 1;
   }
   message_vision("$N面对着石柱趺坐静思,良久,似有所悟。\n",ob);
   ob->add("jing",-5);
   return 1;
}
Exemplo n.º 30
0
int main(object me, string arg)
{
        object where = environment(me);
        string skillname;
        string base_skname;
        int skill, skill_basic, times, i;
        int c, r;
        int diff, improve;
        int t = time();

        if (! where) return notify_fail("你目前的位置有问题,还是先找巫师解决吧!\n"); 

        if (where->query("pigging"))
                return notify_fail("你还是专心拱猪吧!\n");

        if (me->is_busy())
                return notify_fail("你现在正忙着呢。\n");

        if (t == me->query_temp("time/practice"))
                return notify_fail("你刚刚才练习过(如果你要连续练习,可以指明练习的次数)。\n");

        if (me->is_fighting())
                return notify_fail("你已经在战斗中了,学一点实战经验吧。\n");

        if (environment(me)->query("no_fight") &&
            // (me->query("doing") != "scheme" || this_player(1)))
            me->query("doing") != "scheme")
                return notify_fail("你无法在这个地方安心练习。\n");

        if (! arg) return (__DIR__"enable")->main(me, arg);

        if ((sscanf(arg, "%s %d", base_skname, times) != 2))
        {
                times = 1;
                base_skname = arg;
        }
            
        c = 200 + me->query_temp("apply/practice_times");
        if (present("practice emblem", me)) 
                c += 300;
        if (times < 1 || times > c)
                return notify_fail("练习次数必须大于一次,但不能超过" + chinese_number(c) + "次。\n");

        if (! stringp(skillname = me->query_skill_mapped(base_skname)))
                return notify_fail("你只能练习用 enable 指定的特殊技能。\n");

        skill_basic = me->query_skill(base_skname, 1);
        skill = me->query_skill(skillname, 1);
        if (skill < 1)
                return notify_fail("你好像还没有学过这项技能吧?最好先去请教别人。\n");

        if (skill_basic < 1)
                return notify_fail("你对这方面的技能还是一窍不通,最好从先从基本学起。\n");

        if (skill_basic <= skill)
                return notify_fail("你的" + to_chinese(base_skname) +
                                   "火候不够,难以继续提升你" +
                                   to_chinese(skillname) + "的水平。\n");

        notify_fail("你现在不能练习这项技能。\n");
        if (! SKILL_D(skillname)->valid_learn(me)) return 0;

        if (! XUE_CMD->can_learn(me, skillname))
                return 0;

        notify_fail("你试着练习" + to_chinese(skillname) + ",但是并没有任何进步。\n");
        if (! me->can_improve_skill(skillname))
                return notify_fail("也许是缺乏实战经验,你的练习总没法进步。\n");

        me->set_temp("time/practice", t);

        if (skill >= 2000)
                improve = skill_basic / 4;
        else
        if (skill >= 1000)
                improve = skill_basic / 2;
        else
                improve = skill_basic;

        if (intp(r = me->query_temp("apply/practice_effect")))
                improve += improve * r / 100;

        diff = SKILLS_D->query_skill_difficult(skillname);

        if (! diff) diff = SKILL_D(skillname)->difficult_level();
        improve = improve / (diff / 100 + 5) + 1;

        for (i = 0; i < times; i++)
        {
                reset_eval_cost();
                if (SKILL_D(skillname)->practice_skill(me))
                        me->improve_skill(skillname, improve,
                                          skill_basic > skill? 0: 1);
                else break;
        }
        if (i > 0)
                write(HIC "你试着把" + to_chinese(skillname) +
                      "练了" + chinese_number(i)+"趟。\n" NOR);

        if (i >= times)
                return 1;

        return 0;
}