コード例 #1
0
// Bugfix by Aragorn 22/1/94
// Cambiado por neverbot, solo puede recibir int.
void set_gender(int arg) 
{
  // Añadido para el genero de los objetos (espero que no
  // se use en mas sitios!!)
  if (arg == 0)
  {
    // if (interactive(this_object())){
    if (living(this_object()))
    {
      write("No se puede hacer eso (género ilegal).\n");
      return;
    }
      
    gender = 0;
    return;
  }

  if (arg < 1)
    gender = 1;
  else if (arg > 2)
    gender = 2;
  else
    gender = arg;
}
コード例 #2
0
ファイル: li1.c プロジェクト: mudchina/fy4
int do_killing(string arg)
{
    object player, victim;
    string id;
    int sen; 
    player = this_player();
    if(!arg || arg == "") return 0;
    victim = present(arg, environment(player));
    if(!objectp(victim))
                return notify_fail("这里没有这个人。\n");
    if(living(victim))
    {
        id= victim->query("id");
        if( id == "li ehua" && player->query("combat_exp")>3400000)
        {
            message_vision(
"$N喝道:强敌来犯,联手御敌,布两仪剑阵!\n", this_object());
            this_object()->kill_ob(player);
            player->kill_ob(this_object());
            return 0;
        }
    }
    return 0;
}  
コード例 #3
0
ファイル: swordboy2.c プロジェクト: huangleon/fy2005
int do_killing(string arg)
{
    object player, victim;
    string id;
    int sen;

    player = this_player();
    if(!arg || arg == "") return 0;
    victim = present(arg, environment(player));
    if(!objectp(victim))
                return notify_fail("这里没有这个人。\n");
    if(living(victim))
    {
        id= victim->query("id");
        if( id == "gold boy" || id == "iron boy" || id == "bronze boy")
        {
            message_vision("$N"+CYN"喝道:下步揽雀尾!\n"NOR, this_object());
            this_object()->kill_ob(player);
            player->kill_ob(this_object());
            return 0;
        }
    }
    return 0;
}
コード例 #4
0
ファイル: roar.c プロジェクト: mudchina/fy3
int exert(object me, object target)
{
	object *ob;
	int i, skill, damage;

        if( ((int)me->query("force") < 600 ) || ( (int)me->query_skill("haoran-force",1) < 50) )
return notify_fail("你鼓足真气\"喵\"的叫了一声, 结果吓走了几只麻雀。\n");

	skill = me->query_skill("force");

	me->add("force", -150);
	me->receive_damage("kee", 10);

	me->start_busy(1);
	message_vision(
                HIG "$N深深地吸一囗气,真气回聚丹田,发出一声清啸,直冲九霄ⅵ\n" NOR
, me);

	ob = all_inventory(environment(me));
	for(i=0; i<sizeof(ob); i++) {
		if( !living(ob[i]) || ob[i]==me ) continue;
		if( skill/2 + random(skill/2) < (int)ob[i]->query("con") * 2 ) continue;
		
		if( !ob[i]->is_killing(me) ) ob[i]->kill_ob(me);
		if( !me->is_killing(ob[i]) ) me->fight_ob(ob[i]);
		damage = skill - ((int)ob[i]->query("max_force") / 10);
		if( damage > 0 ) {
			ob[i]->receive_damage("gin", damage * 2 );
			if( (int)ob[i]->query("force") < skill * 2 )
				ob[i]->receive_wound("gin", damage);
			tell_object(ob[i], "你觉得眼前一阵金星乱冒,耳朵痛得像是要裂开一样ⅵ\n");
		}
	}

	return 1;
}
コード例 #5
0
ファイル: beast.c プロジェクト: gongfuPanada/mhxy2002
int do_train(string arg)
{
	object me, where;
	me=this_player();
	where=environment(me);
/*
	if( where->query("no_fight") )
		return notify_fail("安全区内不能训兽!\n");
*/
	if( !arg )
		return notify_fail("你要驯服什么?\n");
	if( arg != (string)this_object()->query("id") )
		return notify_fail("你要驯服什么?\n");
	if( this_object()->query_temp("rider") )
		return notify_fail("这匹坐骑上已经有人了。\n");
	if( (string)this_object()->query("owner")==(string)me->query("id") )
		return notify_fail("这匹坐骑已经是你的了。\n");
	if( this_object()->is_fighting() )
		return notify_fail("这匹坐骑已经分身不暇了。\n");
	if( !living(this_object()) )
		return notify_fail("现在耍什么威风?\n");
	if( where->query("no_fight") ) {
		random_move();
		return 1;
	}


	message_vision(HIM"$N冲上前去和$n扭打成一团。\n"NOR, me, this_object());

       	this_object()->set_temp("owner",me->query("id"));
	reset_status();
	this_object()->kill_ob(me);
	me->fight_ob(this_object());

	return 1;
}
コード例 #6
0
ファイル: npc.c プロジェクト: aricxu/xkx100
// This function is called by the reset() of the room that creates this
// npc. When this function is called, it means the room demand the npc
// to return its startroom.
int return_home(object home)
{
	// Are we at home already?
	if( !environment()
	||	environment()==home )
		return 1;

	// Are we able to leave?
	if(!living(this_object()) || this_object()->query_temp("noliving") ||
		is_fighting() )
		return 0;
		
	// let me leave ,add by sir
	if( !mapp(environment()->query("exits")) && (int)this_object()->query_temp("let_me_leave")<=5 )
	{
		 this_object()->add_temp("let_me_leave",1);
		 return 0;
	}

	// Leave for home now.
	message("vision", this_object()->name() + "急急忙忙地离开了。\n",
		environment(), this_object());
	return move(home);
}
コード例 #7
0
ファイル: learn.c プロジェクト: aricxu/xkx100
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;
}
コード例 #8
0
ファイル: jinguzhou.c プロジェクト: gongfuPanada/xyj45
int cast(object me, object target)
{
        string msg, name;
        int damage, ap, dp, howlong=0;
   object ob;

        if( !target ) target = offensive_target(me);

   if( !(ob = present("jingu zhou", me))) 
     return notify_fail("你身上没有紧箍咒、金箍咒或禁箍咒,无法施用咒语!\n");
   name="“"+ob->query("name")+"”";

        if( !target
        ||      !target->is_character()
        ||      target->is_corpse()
        ||      target==me)
                return notify_fail("你要对谁念"+name+"?\n");

        if((int)me->query_skill("spells") < 100)
                return notify_fail("你还没学会念"+name+"。\n");

   if((int)me->query("mana") < 25+(int)me->query("mana_factor") )
                return notify_fail("你的法力不够!\n");

        if((int)me->query("sen") < 10 )
                return notify_fail("你无法集中精力,别施用到自己头上!\n");

        me->add("mana", -25-(int)me->query("mana_factor"));
        me->receive_damage("sen", 10);

        if( random(me->query("max_mana")) < 50 ) {
                write("你失败了!\n");
                return 1;
        }

        msg = HIC
"$N默默地将那"+name+"念了几遍。\n" NOR;
 
        ap = me->query_skill("spells");
        ap = ( ap * ap * ap / (4 * 400) ) * (int)me->query("sen");
        ap += (int)me->query("combat_exp");
        dp = target->query("combat_exp");
        if( random(ap + dp) > dp ) {
                damage = (int)me->query("max_mana") / 10 +
random((int)me->query("eff_sen") / 5);
                damage -= (int)target->query("max_mana") / 10 +
random((int)target->query("eff_sen") / 5);         
                damage+=(int)me->query("mana_factor")-random((int)target->query("mana_factor"));
//here we can see if 2 players are at same status, the attacker has higher chance.
                if( damage > 0 ) {
                msg += HIC "把个$n痛得竖蜻蜓,翻筋斗,耳红面赤,眼胀身麻,不由得抓破了自己的头!\n" NOR;
//finally damage also depends on enabled spells level.
                damage +=random((damage*(int)me->query_skill("spells"))/80);
     if (name != "“紧箍咒”") damage /= 2;
                        target->receive_damage("sen", damage, me);
                        target->receive_wound("sen", damage/3, me);
                        target->receive_damage("kee", damage, me);
                        target->receive_wound("kee", damage/4, me);
        target->set_temp("no_move", 1);
                        me->improve_skill("buddhism", 1, 1);
                howlong = 15 + random((me->query_skill("spells") -100));
                if(howlong>60) howlong=60;
     if (name != "“紧箍咒”") howlong /= 2;
//a typical level is 100+100 ->enabled 150, so will "ding" about 1 minute in the best case.

                }
     else msg += "但是什么也没发生。\n";
             } 
        else
                msg += "但是什么也没发生。\n";

        message_vision(msg, me, target);

        if( damage > 0 ) {
     destruct(ob);
     COMBAT_D->report_status(target);
     call_out("free", howlong, target);
   }

        if( !target->is_fighting(me) ) {
                if( living(target) ) {
                        if( userp(target) ) target->fight_ob(me);
                        else
target->kill_ob(me);
                }
                me->fight_ob(target);
        }

        me->start_busy(1+random(2));
        return 3+random(5);
}
コード例 #9
0
ファイル: shiyue.c プロジェクト: cosin/XYJ
int cast(object me, object target)
{
	string msg;
	int success, ap, dp, ap2, ap3, ap4, dp2, dp3, dp4,howlong;
	int dayphase;

	dayphase =NATURE_D->query_current_day_phase();

	if( !target ) target = offensive_target(me);

	if((int)me->query_skill("spells") < 120
	 || (int)me->query_skill("moonshentong",1) < 80)
		return notify_fail("�㻹ûѧ��ʴ���䡣����\n");

	if( !target
	||      !target->is_character()
	||      target->is_corpse()
	||      target==me)
		return notify_fail("�����˭ʩչʴ���䣿\n");  

	if(target->query("mark/moon_poison") == 1)
	return notify_fail(target->query("name")+"�Ѿ���а�ˣ�\n");  

	if((int)me->query("mana") < 300 )
		return notify_fail("��ķ���������\n");

	if((int)me->query("sen") < 10 )
		return notify_fail("���޷����о�����\n");
	//write(dayphase+"\n");
	if (dayphase < 6)
		 return notify_fail("ʴ����ֻ��ҹ�����ʩչ��\n");

	me->add("mana", -300);
	me->receive_damage("sen", 10);

	msg = HIC
"$N��ͷĬĬ�������ģ����н�������һ�Ź���ѩ�׵������ƺ��������͵Ĺ�â��\n" 
NOR;

	success = 1;
	ap = me->query_skill("spells");
	ap = ap * ap * ap /10 ;
	ap += (int)me->query("daoxing")/2;
	dp = target->query("daoxing")/2;
//	if( random(ap + dp) < dp ) success = 0;
//here we compared exp and spells level. 
//note: has nothing to do with target's spells level.

	ap2 = (int)me->query_spi();
	dp2 = (int)target->query_spi();

	ap3 = (int)me->query("mana");
	dp3 = (int)target->query("mana");
//	if( random(ap + dp + 2500*(ap2+dp2)+200*(ap3+dp3)) < (dp+2500*dp2+200*dp3) ) success = 0;
	if( random((ap + dp + 2500*(ap2+dp2)+200*(ap3+dp3))/1000+1) < (dp+2500*dp2+200*dp3)/1000 ) success = 0;

//here we compare current mana. this is important. you need recover to try again.

	if(success == 1 ){
		msg +=  HIR "$n����$N����̬֮���������ɷ������һ����ȴ�����ǹ���һ����ͻȻ����$n��\n" NOR;
		target->set("mark/moon_ice", 1);
		target->apply_condition("moon_poison", ((int)me->query_skill("moonshentong",1)/5));
		me->start_busy(1+random(2)); 
        	if( living(target) ) target->kill_ob(me);

	}	    
	else {
		msg +=  HIR "$N��ɫ�԰ף��ƺ�������֧�����������н�����ȥ����\n" NOR;	
		if((int)me->query("mana") > 300 )
			me->add("mana", -300);
		me->apply_condition("moon_poison", ((int)me->query_skill("moonshentong")/10));
	} 

	message_vision(msg, me, target);
	return 3+random(5);
}
コード例 #10
0
ファイル: xuli.c プロジェクト: heypnus/xkx2001
void checking(object me, object target, object weapon, int skill, int damage)
{
	object cloth = me->query_temp("armor/cloth");

	int xuli,jiali;
	jiali = me->query("jiali");
	
	if( !living(me) || me->is_ghost() )
	{
		remove_effect(me, weapon, damage);
		return ;
	}

	me->add_temp("songshan_xuli", skill/2 + random(skill) + jiali); 
	me->add("neili",-skill/2);
	me->start_busy(2);
	xuli = me->query_temp("songshan_xuli");

                if( wizardp(me) )
                        tell_object(me,"嵩山剑蓄力已有"+xuli+",需要"+skill*5+"。\n");

	if( !me->is_fighting() )
	{
		message_vision("\n$N缓缓垂下了手臂,将附着於"+weapon->name()+"上的内力散去。\n", me);
		remove_effect(me, weapon, damage);
		return ;
	}

	else if( environment(weapon) != me || weapon != me->query_temp("weapon") )
	{
		remove_effect(me, weapon, damage);
		return ;
        }
	else if( me->query_skill_mapped("sword") != "songshan-jian" )
	{
		remove_effect(me, weapon, damage);
		return ;
	}
	else if(  (int)me->query("neili") < skill ||(int)me->query("jingli") < skill )
	{
	if (cloth->query("material") == "cloth")
        message_vision("$N剑上内力一松,右手衣袖垂了下来。\n", me,target);
		return ;
	}

	else if(xuli > skill*5){
		
	//蓄劲完成,攻击
	me->set_temp("s_hit",1);
	me->add_temp("apply/attack", skill);
	COMBAT_D->do_attack(me, target, me->query_temp("weapon"));
	me->add_temp("apply/attack", -skill);
	me->delete_temp("s_hit");

	me->set_temp("songshan_wait", 1); 
	call_out("checking2", skill/30 , me, weapon,damage);
		
	remove_effect(me, weapon, damage);

	return ;
	}
		else call_out("checking", 1, me, target, weapon, skill, damage);
		return;
}
コード例 #11
0
ファイル: char.c プロジェクト: oliverypf/es2-utf8
void heart_beat()
{
	int wimpy_ratio, cnd_flag;
	mapping my;
	object ob;

	my = query_entire_dbase();

	// If we are dying because of mortal wounds?
	if( my["eff_kee"] < 0 || my["eff_sen"] < 0 || my["eff_gin"] < 0) {
		remove_all_enemy();
		die();
		return;
	}

	// If we're dying or falling unconcious?
	if( my["kee"] < 0 || my["sen"] < 0 || my["gin"] < 0) {
		remove_all_enemy();
		if( !living(this_object()) ) die();
		else unconcious();
		return;
	}

	// Do attack if we are fighting.
	if( is_busy() ) {
		continue_action();
		// We don't want heart beat be halt eventually, so return here.
		return;
	} else {
		// Is it time to flee?
		if( is_fighting()
		&&	intp(wimpy_ratio = (int)query("env/wimpy"))
		&&	wimpy_ratio > 0
		&&	(	my["kee"] * 100 / my["max_kee"] <= wimpy_ratio
			||	my["sen"] * 100 / my["max_sen"] <= wimpy_ratio
			||	my["gin"] * 100 / my["max_gin"] <= wimpy_ratio) )
			GO_CMD->do_flee(this_object());
		// Do attack or clean up enemy if we have fleed.
		attack();
	}

	if( !userp(this_object()) ) {
		this_object()->chat();
		// chat() may do anything -- include destruct(this_object())
		if( !this_object() ) return;	
	}

	if( tick--  ) return;
	else tick = 5 + random(10);

	cnd_flag = update_condition();

	// If we are compeletely in peace, turn off heart beat.
	// heal_up() must be called prior to other two to make sure it is called
	// because the && operator is lazy :P
	if( ((cnd_flag & CND_NO_HEAL_UP) || !heal_up())
	&&	!is_fighting() 
	&&	!interactive(this_object())) {
		if( environment() ) {
			ob = first_inventory(environment());
			while(ob && !interactive(ob))
				ob = next_inventory(ob);
		}
		if( !ob ) set_heart_beat(0);
	}

	if( !interactive(this_object()) ) return;

	// Make us a bit older. Only player's update_age is defined.
	// Note: update_age() is no need to be called every heart_beat, it
	//       remember how much time has passed since last call.
	this_object()->update_age();

	if(query_idle(this_object()) > IDLE_TIMEOUT)
		this_object()->user_dump(DUMP_IDLE);
}
コード例 #12
0
ファイル: duanshui.c プロジェクト: gongfuPanada/mhxy2002
int perform(object me, object target)
{
        int ap,dp,damage,chance;
        string msg;
        object weapon;
                
        if( !target ) target = offensive_target(me);

        if( !target
        ||      !target->is_character()
        ||      target->is_corpse()
        ||      target==me)
                return notify_fail("你要对谁施展「断水无痕」?\n");

        if(!me->is_fighting())
                return notify_fail("「断水无痕」只能在战斗中使用!\n");
        
        if(me->query("family/family_name")!="蜀山派")
                return notify_fail("不是蜀山的不能用「断水无痕」!\n");
        
        if(me->query("shushan/duanshui_perform")!=1)
                return notify_fail("你还没领会「断水无痕」!\n");

        if((int)me->query("max_force") < 500 )
                return notify_fail("你的内力不够!\n");

        if((int)me->query("force") < 500 )
                        return notify_fail("你的内力不足!\n");

        if((int)me->query("sen") < 300 )
                return notify_fail("你的精神不足,没法子施用外功!\n");

        if((int)me->query_skill("songhe-sword", 1) < 150)
                return notify_fail("你的松鹤剑法修为还不够,使用这一招会有困难!\n");


        msg = CYN"\n$N手腕晃动如疾风,以砍断三千尺飞流的速度,直逼$n!\n"NOR;
        ap = me->query_skill("sword");
        ap = ap*ap*ap / 20;
        dp = target->query("combat_exp"); 
        chance = (int)(random( ap + dp ) / dp * 100);
        if (target->is_busy()) chance *= 3;
        if( chance > 40 ) {
                damage = me->query_skill("sword") * 2 + me->query("force_factor");
                if (damage > 800) damage = 750+random(75);
                target->receive_damage("kee",damage);
                target->receive_wound("kee",damage/3);
target->start_busy(random(1)+1);
                msg += CYN"结果$n被$N的「断水无痕」拦腰而过!\n"NOR;
        }
        
        else 
                msg += "但是被$n躲开了。\n"NOR;
        message_vision(msg, me, target);
        if( damage > 0 ) COMBAT_D->report_status(target);
   
        if( !target->is_fighting(me) ) {
                if( living(target) ) {
                        if( userp(target) ) target->fight_ob(me);
                        else target->kill_ob(me);
                }
        }
        me->add("force",-200-me->query("force_factor"));
        me->start_busy(3);
        return 1;
}
コード例 #13
0
ファイル: tian.c プロジェクト: mudchina/nitan3
int perform(object me, object target)
{
        string type1, type2, msg;
        object weapon1, weapon2;
        int ap, dp, damage;

        if (me->query_skill("daojian-guizhen", 1) < 200)
                return notify_fail("你所使用的外功中没有这种功能。\n");

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

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

        weapon1 = me->query_temp("weapon");
        weapon2 = me->query_temp("handing");

        if (! objectp(weapon1) || ! objectp(weapon2))
                return notify_fail("你没有同时装备刀剑,难以施展" TIAN "。\n");

        if (weapon2->query("consistence") <= 0)
                return notify_fail("你的" + weapon2->name() + "已经严重"
                                   "损坏,无法继续使用了。\n");

        type1 = weapon1->query("skill_type");
        type2 = weapon2->query("skill_type");

        if ((type1 != "sword" && type1 != "blade")
           || (type2 != "sword" && type2 != "blade"))
                return notify_fail("你所使用的武器不对,难以施展" TIAN "。\n");

        if ((type1 == "sword" && type2 != "blade")
           || (type1 == "blade" && type2 != "sword"))
                return notify_fail("你没有同时装备刀剑,难以施展" TIAN "。\n");

        if (me->query_skill_mapped("sword") != "daojian-guizhen"
           || me->query_skill_mapped("blade") != "daojian-guizhen")
                return notify_fail("你没有激发刀剑归真,难以施展" TIAN "。\n");

        if (me->query_skill("daojian-guizhen", 1) < 250)
                return notify_fail("你的剑归真等级不够,难以施展" TIAN "。\n");

        if (me->query("neili") < 500)
                return notify_fail("你现在的真气不够,难以施展" TIAN "。\n");

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

        ap = me->query_skill("sword") +
             me->query_skill("blade") +
             me->query_skill("daojian-guizhen", 1) * 3 / 2;

        dp = target->query_skill("force") +
             target->query_skill("dodge") +
             target->query_skill("parry", 1);

        damage = da_power(me, "blade");

        msg = HIY "$N" HIY "将" + weapon1->name() + HIY "与" +
              weapon2->name() + HIY "横置于胸前,运转出「"
              HIR "刀剑七重天" HIY "」功力,内劲如海啸般爆发。\n" NOR;

        if (ap * 2 / 3 + random(ap) > dp)
        {
                msg += HIR "$n" HIR "见$N" HIR "杀气大涨,不禁心"
                       "生惧意,招架顿时散乱,全然不成章理。\n" NOR;
                ap += ap / 5;
                damage += damage / 3;
        } else
        {
                msg += HIG "$n" HIG "见$N" HIG "杀气大涨,丝毫不"
                       "敢大意,急忙收敛心神,努力不受干扰。\n" NOR;
        }

        msg += HIW "\n突然间$N" HIW "身形一展,右手" + weapon1->name() +
               HIW "忽地一振,凌空卷出一道半弧,直劈$n" HIW "而去。\n" NOR;

        if (ap * 2 / 3 + random(ap) > dp)
        {
                msg += COMBAT_D->do_damage(me, target, WEAPON_ATTACK, damage, 80,
                                           HIR "$n" HIR "奋力抵挡,却哪里招架得住"
                                           ",被$N" HIR "一招划中要脉,鲜血四处飞"
                                           "溅。\n" NOR);
        } else
        {
                msg += CYN "$n" CYN "心知这一招的凌厉,急忙凝神"
                       "聚气,小心拆招,丝毫无损。\n" NOR;
        }

        msg += HIW "\n接着$N" HIW "又将左手" + weapon2->name() +
               HIW "朝$n" HIW "平平递出,招式看似简单,却蕴藏着"
               "极大的杀着。\n" NOR;

        if (ap * 2 / 3 + random(ap) > dp)
        {
                // 转移武器
                weapon1->move(me, 1);
                weapon2->wield();

                msg += COMBAT_D->do_damage(me, target, WEAPON_ATTACK, damage, 100,
                                           HIR "$n" HIR "只觉眼花缭乱,全然无法洞"
                                           "察先机,$N" HIR "一招命中,射出一柱鲜"
                                           "血。\n" NOR);
                // 转移回初始状态
                weapon2->move(me, 1);
                weapon1->wield();
                me->set_temp("handing", weapon2);
        } else
        {
                msg += CYN "$n" CYN "心知这一招的凌厉,急忙凝神"
                       "聚气,小心拆招,丝毫无损。\n" NOR;
        }
        me->start_busy(3 + random(3));
        me->add("neili", -300);
        message_combatd(msg, me, target);
        return 1;
}
コード例 #14
0
ファイル: gei.c プロジェクト: mudchina/sjsh
int main(object me, string arg)
{
	string target, item;
	object obj, who, *inv, obj2;
	int i, amount, rev_val;
	mixed no_give;

    if(this_player()->is_busy())
	   return notify_fail("什么?\n");
				 
	if(!arg) return notify_fail("什么?\n");

	if( sscanf(arg, "%s to %s", item, target)==2
	|| sscanf(arg, "%s %s", target, item)==2 );
	else return notify_fail("什么?\n");

	if(!objectp(who = present(target, environment(me))) || !living(who))
		return notify_fail("什么?\n");

	if( me == who )  {
		write("Ok.\n");
		return 1;
	}


	if(sscanf(item, "%d %s", amount, item)==2) {
		if( !objectp(obj = present(item, me)) )	
			return notify_fail("什么?\n");
		if( no_give=obj->query("no_give") )
			return notify_fail( stringp(no_give) ? no_give : "这样东西不能随意丢弃。\n");
		if( obj->query("obj_owner"))
		        return notify_fail("什么?\n");
		if( !obj->query_amount() )	
			return notify_fail( obj->name() + "不能被分开给人。\n");
		if( amount < 1 )
			return notify_fail("什么?\n");
		if( amount > obj->query_amount() ) 
			return notify_fail("什么?\n");
		else if( amount == (int)obj->query_amount() )
			return do_give(me, obj, who);
		else {
			obj2 = new(base_name(obj));
			obj2->set_amount(amount);
			rev_val = do_give(me, obj2, who);
			if( rev_val == 2 )
			   obj->set_amount( (int)obj->query_amount() - amount );
		    else
			   destruct(obj2);
			return rev_val; 
		}
	}

	if(arg=="all") {
		inv = all_inventory(me);
		for(i=0; i<sizeof(inv); i++) {
			if (inv[i]->query("no_get")) continue;
			do_give(me, inv[i], who);
		}
		write("Ok.\n");
		return 1;
	}

	if(!objectp(obj = present(item, me)))
		return notify_fail("什么?。\n");
	if( no_give=obj->query("no_give") )
		return notify_fail( stringp(no_give) ? no_give : "什么?\n");
	return do_give(me, obj, who);
}
コード例 #15
0
ファイル: longwang.c プロジェクト: gongfuPanada/xyj45
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;
}
コード例 #16
0
ファイル: die.c プロジェクト: mudchina/nitan3
int perform(object me, object target)
{
        object weapon;
        int ap, dp;
        int i, count;
        string msg;

        if (userp(me) && ! me->query("can_perform/longxiang-gong/die"))
                return notify_fail("你还没有受过高人指点,无法施展" DIE "。\n"); 

        if (! target) target = offensive_target(me);

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

        if (me->query_temp("weapon") || me->query_temp("secondary_weapon"))
                return notify_fail(DIE "只能空手施展。\n");

        if ((int)me->query_skill("longxiang-gong", 1) < 240)
                return notify_fail("你的龙象般若功修为不够,难以施展" DIE "。\n");

        if (me->query("max_neili") < 4000)
                return notify_fail("你的内力修为不足,难以施展" DIE "。\n");

        if (me->query_skill_mapped("unarmed") != "longxiang-gong")
                return notify_fail("你没有激发龙象般若功为拳脚,难以施展" DIE "。\n");

        if (me->query_skill_mapped("force") != "longxiang-gong")
                return notify_fail("你没有激发龙象般若功为内功,难以施展" DIE "。\n");

        if (me->query_skill_prepared("unarmed") != "longxiang-gong")
                return notify_fail("你没有准备使用龙象般若功,难以施展" DIE "。\n");

        if (me->query("neili") < 500)
                return notify_fail("你现在的真气不足,难以施展" DIE "。\n");

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

        msg = HIY "$N" HIY "蓦地收回双掌,施出密宗绝学「" NOR + WHT "象跌势"
              HIY "」,双臂再度横移,猛贯向$n" HIY "!\n" NOR;

        ap = ap_power(me, "unarmed") + me->query("con") * 20; 
        dp = dp_power(target, "parry") + target->query("dex") * 20; 

        if (me->query("max_neili") > target->query("max_neili") * 2)
        {
                msg += HIR "$n" HIR "全然无力阻挡,竟被$N"
                       HIR "一拳击得飞起,重重的跌落在地上。\n" NOR;
                me->add("neili", -50);
                me->start_busy(1);

                message_combatd(msg, me, target);

                target->set("eff_qi", 1);
                target->set("eff_jing", 1);
                target->unconcious();

                return 1;
        } else
        if (ap / 2 + random(ap) > dp)
        {
                count = ap / 10;
                msg += HIR "$n" HIR "见$P" HIR "来势迅猛之极,一时不知该如"
                       "何作出抵挡,竟呆立当场。\n" NOR;
        } else
        {
                msg += HIY "$n" HIY "见$p" HIY "来势迅猛之极,甚难防备,连"
                       "忙振作精神,小心抵挡。\n" NOR;
                count = 0;
        }

        message_combatd(msg, me, target);
        me->add_temp("apply/attack", count);

        me->add("neili", -300);

        for (i = 0; i < 5; i++)
        {
                if (! me->is_fighting(target))
                        break;
                if (random(5) < 2 && ! target->is_busy())
                        target->start_busy(1);

                COMBAT_D->do_attack(me, target, 0, 0);
        }

        me->start_busy(1 + random(5));
        me->add_temp("apply/attack", -count);

        return 1;
}
コード例 #17
0
ファイル: sheqi.c プロジェクト: cosin/XYJ
int exert(object me, object target)
{
	int qi_gain, qi_lost, ap, dp, success;
	string msg;	

	if( !target
	||      !target->is_character()
	||      target->is_corpse()
	||      target==me)
	return notify_fail("你想摄取谁的阳气?\n");
    
	if( target == me ) return notify_fail("你疯了?\n");

	if(target->query_temp("netdead")) return notify_fail("趁火打劫,不太像话吧?\n");

	if( (int)me->query_skill("tonsillit", 1) < 30 )
		return notify_fail("你的摄气诀修为太低,不能摄取阳气。\n");

	if( (string)me->query("family/family_name") != "阎罗地府" )
		return notify_fail("你并非阎罗地府中人,不能摄取阳气。\n");

        if(!me->is_fighting()||!target->is_fighting())
                return notify_fail("只能在战斗中摄取阳气。\n");

	if( (int)me->query("kee")  > 3*(int)me->query("max_kee")/2 )
		return notify_fail("你现在气太过充盈,再吸就要爆炸了。\n");

	qi_lost = target->query("kee") / 5;

	if(qi_lost < 5 )
		return notify_fail("对方马上就要断气,没有什么好榨的了。\n");
	
	msg = HIR
"\n$N面带狞笑,露出白森森的牙齿往$n的鼻孔凑了过去,张嘴就是一吸!\n" 
NOR;

	success = 1;

	ap = me->query_skill("force");
	ap = ap * ap * ap /10 ;
	ap += (int)me->query("combat_exp");
	dp = target->query("combat_exp");
	if( random(ap)+ap/2 < random(dp)+dp/2 ) success = 0;
	//here we compared exp and force level. 
	//note: has nothing to do with target's force level.

	ap = (int)me->query("max_mana");
	dp = (int)target->query("max_mana");
	if( random(ap*2) < dp ) success = 0;
	//here we compared max_mana, 法力高强应该不怕鬼。

	if(success == 1 ){
		msg +=  HIR "结果$n头皮一麻,只觉得体内阳气源源不断地流了出去!\n" NOR;
		qi_lost=qi_lost-random(qi_lost/2);
		target->receive_damage("kee", qi_lost, me);

		qi_gain = qi_lost;
		if( (int)target->query("max_kee") < (int)me->query("max_kee") )
			qi_gain = qi_gain * (int)target->query("max_kee")/(1+(int)me->query("max_kee"));
		//here, the more the max_kee of your target, the more the qi_gain.
		//and always qi_gain <= qi_cost.

		if( (int)target->query("combat_exp") < (int)me->query("combat_exp") )
			qi_gain = qi_gain * (int)target->query("combat_exp")/(1+(int)me->query("combat_exp"));
//here, we decrease the qi_gain futher more according to dao-xing so she-qi from too weak players or NPCs is useless.
		if( qi_gain > 0 ) me->add("kee", qi_gain);

		//here also add some tonsillit point.

		if( qi_gain > 0 
		&& (int)me->query("combat_exp") < (int)target->query("combat_exp") 
		&& (int)me->query_skill("tonsillit",1) <= 200
		&& random(3) < 1 )
		{
			me->improve_skill("tonsillit", qi_gain);
//			tell_object(me, "A\n");
		} else {
//			tell_object(me, "B\n");
			if( qi_gain < 0 ) qi_gain =1;
			me->improve_skill("tonsillit", qi_gain, 1);
		}
	} else {
		msg +=  HIR "结果$n一扭头,避了开去!\n" NOR;	
	} 

	message_vision(msg, me, target);
	if( success == 1 ) COMBAT_D->report_status(target);

//he'll try kill you...
	if( living(target) ) target->kill_ob(me);

	me->start_busy(4);        
	return 1;
}
コード例 #18
0
ファイル: _replace.c プロジェクト: ehershey/pd
int cmd_replace(string str) {
    string who, limb;
    string *missing;
    string *limbs;
    int healing;
    int cost;
    object tp, ob;

    if (!spell())
    {
        write("What?\n");
        return 1;
    }

    tp = this_player();

    if( tp->query_ghost() )
        return notify_fail("You cannot do that in your immaterial state.\n");
    
    if( !str )
        return notify_fail("Replace what?\n");
    
    if( sscanf(str, "%s %s", who, limb) != 2 )
        return notify_fail("Correct syntax: <replace [player] [limb]>\n");
    
    ob = present(who, environment(tp));
    
    if( !ob )
        return notify_fail(capitalize(who) + " is not here.\n");
    
    if( ob->query_ghost() )
        return notify_fail("You cannot help the dead in that way.\n");
    
    if( !living(ob) )
        return notify_fail(ob->query_cap_name()+" is not a living thing!\n");
    
    limbs = (string *)ob->query_limbs();
    missing = (string *)ob->query_severed_limbs();
    
    if( !missing )
    {
        if( ob == tp )
            return notify_fail("You are not missing any limbs!\n");
        else
            return notify_fail(ob->query_cap_name()+" is not missing any limbs.\n");
    }
    
    if( member_array(limb, missing) == -1 || member_array(limb, limbs) != -1)
    {
        if( tp == ob )
            return notify_fail("You are not missing that limb!\n");
        else
            return notify_fail(ob->query_cap_name()+" is not missing that limb!\n");
    }

    this_player()->set_magic_round();
    healing = (int)tp->query_skill("healing")/2;
    healing += tp->query_skill("faith")/3;
    healing += tp->query_skill("belief")/3;
    healing -= random(76);
    
    if( tp == ob )
        cost = 175 + random(76);
    else
        cost = 250 + random(51);
    
    if( (int)tp->query_mp() < cost )
        return notify_fail("Too low on magic power.\n");
    
    tp->add_mp(-cost);
    
    if( healing < 1 )
    {
        message("info", "Your concentration is simply too weak.", tp);
        message("info", tp->query_cap_name() + " loses " +
                tp->query_possessive() + " concentration while in " +
                "prayer.", environment(tp), tp);
        tp->add_skill_points("healing", 10);
        return 1;
    }

    if( !add_limb(ob, limb) )
         return 0;

    if( tp == ob )
    {
        message("info", "Your " + limb + " regenerates through prayer!", tp);
        message("info", tp->query_cap_name() + "'s " + limb + " regenerates " +
                "through prayer!", environment(tp), tp);
        tp->add_skill_points("healing", to_int((healing / 3) + random(healing * 2 / 3)));
        tp->add_exp(to_int((healing / 3) + random(healing * 2 / 3)));
    }
    else
    {
        message("info", "You regenerate " + ob->query_cap_name() + "'s " +
                limb + " through prayer!", tp);
        message("info", tp->query_cap_name() + " regenerates your " + limb +
                " through prayer!", ob);
        message("info", tp->query_cap_name() + " says a prayer that " +
                "regenerates " + ob->query_cap_name() + "'s " + limb + ".",
                environment(tp), ({ tp, ob }) );
        tp->add_skill_points("healing", to_int((healing * 2 / 3) + random(healing / 3)));
        tp->add_exp(to_int((healing * 2 / 3) + random(healing / 3)));
        tp->add_alignment(to_int((healing * 2 / 3) + random(healing / 3)));
    }
コード例 #19
0
ファイル: FREEZE.C プロジェクト: mudchina/sjsh
int cast(object me, object target)
{
        string msg;
        int success, ap, dp, howlong;
   int dayphase;

   dayphase =NATURE_D->query_current_day_phase();

//        if(!me->is_fighting())
//        return notify_fail("寒封术只可以在战斗中施展!\n");
        if( !target ) target = offensive_target(me);
   if((int)me->query_skill("spells") < 100 || (int)me->query_skill("tianjijue",1) < 60)
     return notify_fail("你还没学会寒封术……\n");

        if( !target
        ||      !target->is_character()
        ||      target->is_corpse()
        ||      target==me)
                return notify_fail("你要对谁施展「"HIW"寒封术"NOR"」?\n");

   if( !living(target) )
                return notify_fail("人都晕了你还要冻人家?\n");
        if(target->query_temp("no_move") )
        return notify_fail("有必要吗?"+target->query("name")+"已经不能动了。\n");

        if((int)me->query("mana") < 400 )
                return notify_fail("你的法力不够!\n");

        if((int)me->query("sen") < 50 )
                return notify_fail("你的精神没有办法有效集中!\n");

        me->add("mana", -400);
        me->receive_damage("sen", 50);

        if( random(me->query("max_mana")) < 30 ) {
                write("你失败了!\n");
                return 1;
        }

        msg = HIW "$N双手一聚,形成一团奇冷的寒气,向$n射来!\n\n" ;

   success = 1;
   ap = me->query_skill("tianjijue");
   ap = ap * ap * ap /12 ;
   ap += (int)me->query("combat_exp");
   dp = target->query("combat_exp");
   if (dayphase < 6){
   if( random(ap + dp) < dp ) success = 0;
   } 
   else if( random(ap + dp) < dp / 2) success = 0;

   ap = (int)me->query("max_mana");
   dp = (int)target->query("max_mana");
   if (dayphase < 6){
   if( random(ap + dp) < dp*2/3 ) success = 0;
   } 
   else if( random(ap + dp) < dp / 2) success = 0;

   ap = (int)me->query("mana");
   dp = (int)target->query("mana");
   if (dayphase < 6){
   if( random(ap + dp) < dp ) success = 0;
   } 
   else if( random(ap + dp) < dp * 2 / 3) success = 0;

   howlong = 0;        
   if(success == 1 ){
     msg +=  HIW "奇冷的寒气包围了$n的全身,将$n凝聚成冰块!\n" NOR;
      target->set_temp("frozen",1);
   if( target->is_die() ) return 1;

     target->set_temp("no_move", 1); 
 
     howlong = (me->query_skill("spells") / 10)+1;
     if(howlong>60) howlong=60;
   }       
   else {
     msg +=  HIR "$n满脸不屑,挥挥手便将寒气挥散了!\n" NOR;   
   } 

        message_vision(msg+NOR, me, target);

   if( living(target) ) target->kill_ob(me);

if (success == 0) {
return 1+random(2);
}

   if( howlong>0 ) call_out("remove_frozen", howlong, target);
        
   return 3+random(5);
}
コード例 #20
0
ファイル: give.c プロジェクト: huangleon/fy2005
int main(object me, string arg) {
	string target, item;
	object obj, who, *inv, obj2;
	int i, amount;

	if(!arg) {
		return notify_fail("��Ҫ��˭ʲ�ᶫ����\n");
	}

	if(sscanf(arg, "%s to %s", item, target)==2 || sscanf(arg, "%s %s", target, item)==2 );
	else {
		return notify_fail("��Ҫ��˭ʲ�ᶫ����\n");
	}

	if(!objectp(who = present(target, environment(me)))) {
		return notify_fail("����û������ˡ�\n");
	}

	if(who->query_temp("is_unconcious"))
		return notify_fail("���������޷�������������\n");


	if ( userp(who) && sizeof(all_inventory(who))>=26)
		return notify_fail("�����Ѿ�����̫�ණ���ˣ�\n");

	if(!living(who)) {
		return notify_fail("����û������ˡ�\n");
	}

	if(me == who) {
		return notify_fail("������Ҫ�����ֶ�����\n");
	}

	if(userp(me) && who->query("env/no_give"))
		return notify_fail("���˲�Ը�����κ�������Ʒ��\n");
		
	if (environment(me)->query("tianji_square")) {
		if (userp(who) && userp(me))
			return notify_fail("����㳡�˶����ӣ����ʺ������ף������ط��ɡ�\n");
	}
	
	if(sscanf(item, "%d %s", amount, item)==2) {
		if( !objectp(obj = present(item, me)) )
			return notify_fail("������û������������\n");
		if( obj->query("no_drop") && userp(who))
			return notify_fail("�����������������ˡ�\n");
		if( !obj->query_amount() )
			return notify_fail( obj->name() + "���ܱ��ֿ����ˡ�\n");
		if( amount < 1 )
			return notify_fail("����������������һ����\n");
		if( amount > obj->query_amount() )
			return notify_fail("��û��������" + obj->name() + "��\n");
		else if( amount == (int)obj->query_amount() )
			return do_give(me, obj, who);
		else {
			obj->set_amount( (int)obj->query_amount() - amount );
			obj2 = new(base_name(obj));
			obj2->set_amount(amount);
			obj2->set_name(obj->query("name"),obj->parse_command_id_list());
			obj2->set("long",obj->query("long"));
			obj2->set("unit",obj->query("unit"));


			if(!do_give(me, obj2, who)) {
				obj->set_amount( (int)obj->query_amount() + amount );
				return 0;
			}
			return 1;
		}
	} else if(item=="all") {
		if (environment(me)->query("tianji_square")) 
			return notify_fail("�������˵������������ô�ණ��������۶����ˡ�\n");
		inv = all_inventory(me);
		for(i=0; i<sizeof(inv); i++) {
			do_give(me, inv[i], who);
		}
		return 1;
	} else {
		if(!objectp(obj = present(item, me)))
			return notify_fail("������û������������\n");
		return do_give(me, obj, who);
	}
}
コード例 #21
0
ファイル: put.c プロジェクト: gongfuPanada/xyj45
int main(object me, string arg)
{
   string target, item;
   object obj, dest, *inv, obj2;
   int i, amount;

   if(!arg) return notify_fail("你要将什么东西放进哪里?\n");

   if( sscanf(arg, "%s in %s", item, target)!=2 )
     return notify_fail("你要给谁什么东西?\n");

   dest = present(target, me);
   if( !dest || living(dest) ) dest = present(target, environment(me));
   if( !dest || living(dest) )
     return notify_fail("这里没有这样东西。\n");


   if(sscanf(item, "%d %s", amount, item)==2) {
     if( !objectp(obj = present(item, me)) )
        return notify_fail("你身上没有这样东西。\n");
     if( obj->query("no_give") || 
        obj->query("no_drop") || obj->query("no_get") )
        return notify_fail( "Ok.\n" );
     if( !obj->query_amount() )
        return notify_fail( obj->name() + "不能被分开。\n");
     if( amount < 1 )
        return notify_fail("东西的数量至少是一个。\n");
     if( amount > obj->query_amount() )
        return notify_fail("你没有那么多的" + obj->name() + "。\n");
     else if( amount == (int)obj->query_amount() )
        return do_put(me, obj, dest);
     else {
        obj2 = new(base_name(obj));
        obj2->set_amount(amount);
        if(do_put(me, obj2, dest)) { // failed to put.
            obj->set_amount((int)obj->query_amount()-amount);
            return 1;
        } else return 0;
     }
   }

   if(item=="all") {
     inv = all_inventory(me);
     for(i=0; i<sizeof(inv); i++)  {
        if( inv[i]->query("no_give") || 
          inv[i]->query("no_drop") || inv[i]->query("no_get") )
             continue;

        if( inv[i] != dest ) do_put(me, inv[i], dest);
     }
     write("Ok.\n");
     return 1;
   }

   if(!objectp(obj = present(item, me)))
     return notify_fail("你身上没有这样东西。\n");
   if( obj->query("no_give") || 
     obj->query("no_drop") || obj->query("no_get") )
     return notify_fail( "Ok.\n" );
   return do_put(me, obj, dest);
}
コード例 #22
0
ファイル: _fireball.c プロジェクト: ehershey/pd
int cmd_fireball(string str) {
    object tp, ob;
    int attack, wisdom, skip, which, i;
    string what, *strengths, *weaknesses;
    object *inv;
   if (!spell()) {
      notify_fail("What?\n");
      return 0;
   }
    this_player()->set_magic_round();
    tp = this_player();
    if(tp->query_ghost()) {
        notify_fail("Your voice is hollow.\n");
        return 0;
    }
    if((string)tp->query_class() != "mage") {
        write("You mumble in confusion.");
        say(tp->query_cap_name()+" mumbles in confusion.", tp);
        return 1;
    }
    if(environment(tp)->query_property("no magic")) {
        notify_fail("Something seems to be blocking your concentration.\n");
        return 0;
    }
    if (this_player()->query_disable())
       return notify_fail("You are busy.\n");
    if((int)tp->query_mp() < 20) {
        notify_fail("Too low on magic power.\n");
        return 0;
    }
    if(!str) {
        ob = (object)tp->query_current_attacker();
        if(!ob) {
            notify_fail("Fireball what?\n");
            return 0;
        }
    }
    else {
        ob = present(str, environment(this_player()));
        if(!ob) {
            sscanf(str, "%s %d", what, which);
            inv = all_inventory(environment(tp));
            for(i=0, skip = 0; i<sizeof(inv) && !ob; i++) {
                if(inv[i]->id(what)) {
                    skip++;
                    if(skip == which) ob = inv[i];
                }
            }
            if(!ob) {
                notify_fail("You do not see "+str+" here.\n");
                return 0;
            }
        }
    }
    if(!living(ob)) {
        notify_fail(ob->query_cap_name()+" is not a living thing!\n");
        return 0;
    }
    if(ob == tp) {
        notify_fail("Not a very bright thing to do.\n");
        return 0;
    }
    if(ob->is_player() && !interactive(ob)) {
        notify_fail("You cannot attack link-dead players.\n");
        return 0;
    }
    if(ob->query_property("no magic")) {
        notify_fail(sprintf("%s is immune to your magic.\n",
          ob->query_cap_name()));
        return 0;
    }
    if(!this_player()->kill_ob(ob)) {
        write(ob->query_cap_name()+" can't be attacked by you yet.");
       return 1;
    }
    attack = (int)tp->query_skill("magic attack")*2/3 + (int)tp->query_stats("wisdom");
    wisdom = (int)ob->query_stats("wisdom")/2 + (int)ob->query_skill("magic defense")/3;
    attack -= wisdom;
    weaknesses = (string *)ob->query_property("weakness");
    if (!pointerp(weaknesses))
        weaknesses = ({ });
コード例 #23
0
ファイル: reply.c プロジェクト: mudchina/nitan3
int main(object me, string arg)
{
	string target, mud;
	object obj;
        string no_tell, can_tell;
        string reply_out;

	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 || ! me->visible(obj))
	{
		if (MESSAGE_D->send_msg_to(me, target, arg))
			return 1;
		return notify_fail("刚才和你说话的人现在已经离开游戏了。\n");
	}

        no_tell = obj->query("env/no_tell");
	if (! wizardp(me) && (no_tell == "all" || no_tell == "ALL" ||
	    is_sub(me->query("id"), no_tell)))
        {
                can_tell = obj->query("env/can_tell");
                if (! is_sub(me->query("id"), can_tell))
		        return notify_fail("这个人不想听你罗嗦啦。\n");
        }

	if (playerp(obj) && obj->is_net_dead())
		return notify_fail("这个人现在不在线上,听不到你的话。\n");

	if (! living(obj))
		return notify_fail("这人现在恐怕听不到你说的话了...\n");

	reply_out = sprintf(HIG "%s回答你:%s\n" NOR,
                            me->name(1) + HIG "(" + me->query("id") + ")", arg);
        if (! TELL_CMD->notice_user(me->name(1), me->query("id"), obj, reply_out))
                return 1;

        // 成功的回答了
	write(HIG "你回答" + obj->name(1) + HIG + "(" + obj->query("id") +
              "):" + arg + "\n" NOR);

        if (query_idle(obj) >= 120)
                write(YEL "可是" + obj->name(1) +
                      YEL "已经在猪圈中发呆有" + chinese_number(query_idle(obj) / 60) +
                      "分钟了,恐怕没法听到你的话。\n");

        // 如果选择的不是全阻塞(2),则自动忽略这条信息,显示
        // 下一条信息。
        if (me->query("env/jam_talk") != 2)
                SKIP_CMD->main(me, "");

	return 1;
}
コード例 #24
0
ファイル: neilisuck.c プロジェクト: gongfuPanada/jy
int exert(object me, object target)
{
	int sp, dp;

       if ( target == me ) target = offensive_target(me);
	if( !objectp(target) || target->query("id") == "mu ren" )
		return notify_fail("你要吸取谁的内力?\n");


	if ( me->query_temp("sucked") )
		return notify_fail("你刚刚吸取过内力!\n");

	if( objectp(me->query_temp("weapon")) )
		return notify_fail("你必须空手才能施用化功大法吸人内力!\n");

//        if( !me->is_fighting() || !target->is_fighting())

	if( (int)me->query_skill("huagong-dafa",1) < 60 )
		return notify_fail("你的化功大法功力不够,不能吸取对方的内力!n");

	if( (int)me->query("neili",1) < 20 )
		return notify_fail("你的内力不够,不能使用化功大法。\n");

	if( (int)target->query("max_neili") <= 0 )
		return notify_fail( target->name() +
			"没有任何内力!\n");

        if( (int)target->query("neili") < 60 )
		return notify_fail( target->name() +
			"已经内力涣散,你已经无法从他体内吸取任何内力了!\n");

	message_vision(
		HIR "$N一张脸突然变得惨白,右掌直出,猛地对准$n的膻中大穴按了上去!\n\n" NOR,
		me, target );

        if ( living(target) )
           { if( !target->is_killing(me) ) target->kill_ob(me); }

        sp = me->query_skill("force") + me->query_skill("dodge") + me->query_skill("zhaixinggong",1)/2;
        dp = target->query_skill("force") + target->query_skill("dodge");

	me->set_temp("sucked", 1);		

        if (( random(sp) > random(dp) ) || !living(target) )
	{
		tell_object(target, HIR "你顿觉膻中微痛,如同被尖针刺了个小孔,全身内力如水银般循孔飞泄而出!\n" NOR);
		tell_object(me, HIG "你觉得" + target->name() + "的内力自手掌源源不绝地流了进来。\n" NOR);

		target->add("neili", -1*((int)me->query_skill("huagong-dafa", 1) + target->query("jiali")) );
            if ( target->query("neili") <1 ) target->set("neili",0);
		me->add("neili", (int)me->query_skill("huagong-dafa", 1) + target->query("jiali") );

		if( target->query("combat_exp") >= me->query("combat_exp") ) {		
			if( (int)me->query("potential") - (int)me->query("learned_points") < 100 )
				me->add("potential", 1);
			me->add("combat_exp", 1);
		}

                me->start_busy(4);
		target->start_busy(random(4));
                me->add("neili", -7);

		call_out("del_sucked", 2, me);
	}
	else
	{	
		message_vision(HIY "可是$p看破了$P的企图,机灵地闪了开去。\n" NOR, me, target);
		me->start_busy(4);
		call_out("del_sucked", 4, me);
	}

	return 1;
}
コード例 #25
0
ファイル: bt_poison.c プロジェクト: heypnus/xkx2001
int update_condition(object me, int duration)
{
	int damage = 1;
   if( !living(me) ) {
      message("vision", me->name() + "�������ã�����Ѭ��ij������������ٲ�Ӭ��\n", environment(me), ({me}));
コード例 #26
0
ファイル: qu.c プロジェクト: mudchina/nitan3
int perform(object me)
{
        string msg;
        object weapon, target;
        int skill, ap, dp;

        if (userp(me) && ! me->query("can_perform/xianglong-zhang/qu"))
                return notify_fail("你所使用的外功中没有这种功能。\n");

        if (! target) target = offensive_target(me);

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

        if (me->query_temp("weapon") || me->query_temp("secondary_weapon"))
                return notify_fail(QU "只能空手使用。\n");

        if ((int)me->query_skill("xianglong-zhang", 1) < 150)
                return notify_fail("你降龙十八掌火候不够,难以施展" QU "。\n");

        if (me->query_skill_mapped("strike") != "xianglong-zhang")
                return notify_fail("你没有激发降龙十八掌,难以施展" QU "。\n");

        if (me->query_skill_prepared("strike") != "xianglong-zhang")
                return notify_fail("你没有准备降龙十八掌,难以施展" QU "。\n");

        if (! objectp(weapon = target->query_temp("weapon")))
                return notify_fail("对方没有使用兵器,难以施展" QU "。\n");

        if ((int)me->query_skill("force") < 300)
                return notify_fail("你的内功修为不够,难以施展" QU "。\n");

        if ((int)me->query("max_neili") < 3000)
                return notify_fail("你的内力修为不够,难以施展" QU "。\n");

        if ((int)me->query("neili") < 500)
                return notify_fail("你现在的真气不足,难以施展" QU "。\n");

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

        msg = HIW "$N" HIW "暴喝一声,全身内劲迸发,气贯右臂奋力外扯,企图将$n"
              HIW "的" + weapon->name() + HIW "吸入掌中。\n" NOR;

        ap = me->query_skill("strike") + me->query("str") * 10;
        dp = target->query_skill("parry") + target->query("dex") * 10;

        if (ap / 3 + random(ap) > dp)
        {
                me->add("neili", -300);
                msg += HIR "$n" HIR "只觉周围气流涌动,手中" + weapon->name()
                       + HIR "竟然拿捏不住,向$N" HIR "掌心脱手飞去。\n" NOR;
                me->start_busy(2);
                weapon->move(me, 1);
        } else
        {
                me->add("neili", -200);
                msg += CYN "$n" CYN "只觉周围气流涌动,慌忙中连将手中"
                       + weapon->name() + CYN "挥舞得密不透风,使得$N"
                       CYN "无从下手。\n" NOR;
                me->start_busy(3);
        }
        message_combatd(msg, me, target);
        return 1;
}
コード例 #27
0
ファイル: yingzhi.c プロジェクト: gongfuPanada/mhxy2002
int perform(object me, object target)
{

        int d=me->query_skill("lotusmove",1)/2;
        int j=me->query_skill("cibei-dao", 1)/2;
     int i=me->query_skill("jienan-zhi", 1)/2;
        object weapon = me->query_temp("weapon");
        if( !target ) target = offensive_target(me);
     
        if( !target || !me->is_fighting(target) )
                return notify_fail("刀影指只能对战斗中的对手使用。\n");                

        if( (int)me->query_skill("lotusforce", 1) < 100 )
                return notify_fail("你的内功还未练成,不能使用刀影指!\n");    
        if( (int)me->query_skill("cibei-dao", 1) < 100 )
                return notify_fail("你的刀法还未练成,不能使用刀影指!\n");        
        if (!weapon || weapon->query("skill_type") != "blade"
        || me->query_skill_mapped("blade") != "cibei-dao")
                return notify_fail("你手里没有刀,无法使用刀影指!\n");
        if((int)me->query_skill("jienan-zhi", 1) < 100 )
                return notify_fail("你的指法还未练成,不能使用刀影指!\n");  
        if(me->query_skill_mapped("force") != "lotusforce")
                return notify_fail("你的内功不是莲台心法,无法使用刀影
指!\n");

                if(me->query_temp("no_yingzhi"))
                        return notify_fail("绝招滥使就不灵了!\n");
        if(me->query_skill_mapped("parry") != "cibei-dao")
           if(me->query_skill_mapped("parry") != "cibei-dao")
                return notify_fail("你的招架功夫不对,无法使用刀影指!\n");
        if((int)me->query("force") < 300 )
                return notify_fail("你现在内力不足,不能使用刀指!\n");      
        if((int)me->query_skill("blade", 1) < 100 )
                return notify_fail("你的基本刀法不够娴熟,不能在刀招中夹杂使用刀影指。\n");
        if((int)me->query_skill("unarmed", 1) < 100 )
                return notify_fail("你的扑技格斗不够娴熟,不能在刀招中夹杂使用刀影指。\n");     
        message_vision(HIR"\n$N大吼一声使出刀影指,指随刀走,刀光中夹杂着阵阵指风一起奔向$n!\n"NOR, me,target);
       me->add("force", -200); 
     me->add("sen", -50);
        me->add_temp("apply/dodge", d); 
  me->add_temp("apply/attack", (i+j)/1); 
        COMBAT_D->do_attack(me, target, me->query_temp("weapon"),1);
        me->add_temp("apply/unarmed", i/1); 
        COMBAT_D->do_attack(me, target, me->query_temp("weapon"),1);
     me->add_temp("apply/unarmed", -i/1);
        COMBAT_D->do_attack(me, target, me->query_temp("weapon"),1);
  me->add_temp("apply/attack", -((i+j)/1)); 
   me->add_temp("apply/dodge", -d);
me->set_temp("no_yingzhi",1);
                call_out("yingzhi_ok",2+random(2),me);


        if( !target->is_fighting(me) ) {
                if( living(target) ) {
                        if( userp(target) ) target->fight_ob(me);
                        else target->kill_ob(me);
                }
        }

        return 1;
}
コード例 #28
0
ファイル: taiji.c プロジェクト: aricxu/xkx100
void checking(object me, string prepare)
{
	object weapon = me->query_temp("weapon");
	string tjjzhao, tjqzhao1, tjqzhao2, tjqzhao3;

	tjjzhao = SKILL_D("taiji-jian")->query_skill_name(random(140));
	tjqzhao1 = SKILL_D("taiji-quan")->query_skill_name(random(150));
	tjqzhao2 = SKILL_D("taiji-quan")->query_skill_name(random(150));
	tjqzhao3 = SKILL_D("taiji-quan")->query_skill_name(random(150));

	if( me->query_temp("taiji") < 1 )
	{
		remove_effect(me);
		tell_object(me, "\n你大周天搬运完毕,将内力合于丹田,入窍归元。\n");
		return;
	}
	else if( !living(me) || me->is_ghost() )
	{
		remove_effect(me);
		return;
	}
	else if( prepare == "tjq" && objectp(weapon) )
	{
		remove_effect(me);
		return;
	}
	else if( prepare == "tjj" && (!objectp(weapon) ||
		weapon->query("skill_type") != "sword") )
	{
		if( me->query_temp("taiji_fight") )
			message_combatd(CYN"\n$N手中无剑,剑意顿失!\n"NOR, me);
		remove_effect(me);
		return;
	}
	else if( me->query_skill_mapped("force") != "taiji-shengong")
	{
		remove_effect(me);
		tell_object(me, HIR"\n你忽觉胸口一阵烦恶,原来所用内功与太极心法相逆!\n" NOR);
		me->receive_damage("qi", 1000, "内功走火入魔死了");
		return;
	}
	else if( !me->is_busy() )
	{
		if( me->query_temp("taiji_fight") && !me->is_fighting() )
		{
			remove_effect(me);
			if( prepare == "tjj" )
				message_combatd("\n$N使到" + tjjzhao + ",双手同时画圆,复成第五十四式「持剑归原」。\n"NOR, me);
			else
				message_combatd("\n$N使到上步"+ tjqzhao1 + ",上步" + tjqzhao2 + "," + tjqzhao3 + "而合太极,神定气闲的站在当地。\n"NOR, me);
			return;
		}
		else if( prepare == "tjj" &&
			(me->query_skill_mapped("sword") != "taiji-jian" ||
			me->query_skill_mapped("parry") != "taiji-jian") )
		{
			if( me->query_temp("taiji_fight") )
				message_combatd(CYN"\n$N圈转" + weapon->name() + CYN",突然变招,使出与太极剑意不同的剑法!\n"NOR, me);
			remove_effect(me);
			return;
		}
		else if( prepare == "tjq" &&
			(me->query_skill_prepared("unarmed") != "taiji-quan" ||
			me->query_skill_mapped("unarmed") != "taiji-quan" ||
			me->query_skill_mapped("parry") != "taiji-quan") )
		{
			if( me->query_temp("taiji_fight") )
				message_combatd(CYN"\n$N双手一错,突然使出与太极拳旨相反的招数!\n"NOR, me);
			remove_effect(me);
			return;
		}
	}

	if( !me->query_temp("taiji_fight") ) me->add_temp("taiji", -1);
	call_out("checking", 1, me, prepare);
} 
コード例 #29
0
ファイル: yq.c プロジェクト: lostsnow/dtxy
int main(object me, string arg)
{
    object ob,*target;
    string banghui,n1,n2;
    int money,i,flag;
    object lingpai;
    mapping data;
    string *what,stuffid,stuffname;
    string name;
    if(! (banghui=me->query("banghui")))
        return notify_fail("你没有参加任何帮会,无法邀请他人加入。\n");
    lingpai=new("/obj/lingpai");
    lingpai->create(banghui);
    if(lingpai->query("no_use"))	{
        destruct(lingpai);
        return notify_fail("你的帮会文件有问题,快与巫师联系吧。\n");
    }
    flag=0;
    if( lingpai->query("bangzhu_id")==me->query("id")
            || ( stringp(me->query("bh_rank")) &&
                 sscanf((string)me->query("bh_rank"),"%s副帮主%s",n1,n2)==2))
        flag=1;
    destruct(lingpai);
    if(! arg)
        return notify_fail("你要邀请谁加入你的帮会?\n");
    if( me->query("id")==arg)
        return notify_fail("邀请自己?!\n");
    if(! objectp(ob=present(arg,environment(me))))
        return notify_fail("这儿有没这么个人。\n");
    if(! ob->is_character() )
        return notify_fail("你只能邀请「人」加入你的帮会。\n");
    if(ob->query("banghui")==me->query("banghui"))
        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("对方正忙着呢。\n");
    if(!living(ob))	return notify_fail("你得先弄醒他再说。\n");
    if(member_array(banghui,npc_banghui)!=-1
            && userp(ob))
        return notify_fail("你无权邀请玩家加入「"+banghui+"」!\n");
    if( userp(ob) && !flag)
        return notify_fail("你无权邀请玩家加入「"+banghui+"」!\n");

    message_vision("$N邀请$n参加帮会「"+me->query("banghui")+"」。\n",me,ob);
    if(! userp(ob) )	{
        if(!ob->query("attitude")) return notify_fail("看样子"+ob->query("name")+"对你的帮会没有兴趣。\n");

        if((!(banghui=ob->query("banghui"))|| ob->query("zhongcheng")<me->query_per())&&ob->query("kee")*100>ob->query("max_kee")*80)	{
            message_vision("$N对$n说道:“即是如此,你我不如切磋(qiecuo)一下武功如何?”\n",ob,me);
            ob->set_temp("oldsix/target",me);
            return 1;
        }
        message_vision("$N冲着$n笑道:“我可不敢高攀贵帮啊。”\n",ob,me);
        return 1;

    }
    else	{
        tell_object(ob,"如果你愿意加入对方的帮会,请使用jiaru "+me->query("id")+"。\n");
        ob->set_temp("oldsix/target",me);
        return 1;
    }
}
コード例 #30
0
ファイル: clxiaoting.c プロジェクト: heypnus/xkx2001
int valid_leave(object me, string dir)
{
        string beauty;
        object ob, leader, ling, *inv;
        int bonus, record;

        if( dir != "north" )
                return ::valid_leave(me, dir);

        if( !(ob = present("situ heng", environment(me))) )
                return ::valid_leave(me, dir);

        if( !living(ob) )
                return ::valid_leave(me, dir);

        if( ob->is_fighting() || ob->is_busy() ) {
                message_vision("$N拦在$n面前,喝道:" + RANK_D->query_rude(me) + "不得无礼!没见帮主正忙着?\n", ob, me);
                return notify_fail("");
        }

        if( stringp(beauty = me->query_temp("bangs/beauty")) ) {
                inv = all_inventory(this_object());
                for(int i = 0; i < sizeof(inv); i++) {
                if( (string)inv[i]->query("name") == beauty
                && inv[i]->query_leader() == me ) {
                message_vision("$N在$n的头上弹了个清脆的脑崩儿,$n的脑门儿上立刻长出了个小臌包。\n", ob, me);
                return ::valid_leave(me, dir);
                }
                }
	}

        if( !userp(me) ) {
                beauty = (string)me->query("name");
                if( intp(bonus = info_beauty[beauty])
                &&  leader = me->query_leader() ) {
                if( userp(leader) && (string)leader->query_temp("bangs/beauty") == beauty ) {
                tell_object(leader, ob->name() + "说道:好!好!好!" + (string)ob->query("fam") + "上上下下几千人中数你最讨帮主的欢心!\n");
                leader->delete_temp("bangs/beauty");

                bonus = bonus * 25000 / (100000 + (int)leader->query("combat_exp"));
                record = bonus + random(bonus);
                leader->add("combat_exp", record);
                leader->add("shen", -record);
                write_file("/log/test/BangWomen",  sprintf("%s于%s时上贡%s得%s经验点\n", leader->query("name"), ctime(time()), beauty, chinese_number(record)));

                if( ling = present("bang ling", leader) ) {
                if( (string)ling->query("owner") == leader->query("id") )
                        ling->add("score", bonus/2 + random(bonus/2));
                }

                me->set_leader(0);

                remove_call_out("destroy_beauty");
                call_out("destroy_beauty", 1, me, leader);
                return ::valid_leave(me, dir);
                }
                }
	}

        message_vision("$N拦在$n面前,喝道:" + RANK_D->query_rude(me) + "不得无礼!后面是帮主的卧房。\n", ob, me);

        return notify_fail("");
}