代码拉取完成,页面将自动刷新
#include "zgs.h" /*锦囊牌实现*/
extern int player_number, MP;
extern Pig player[MAX_PLAYER];
void use_f(int id,int recipient){/*决斗*/
printf("Player[%d] fight Player[%d]\n",id,recipient);
int x=can_use(id,'F');
use(id,x);
jump(id,recipient);
if(suc(id,recipient,0))
for(;;){
if(can_use(recipient,'K')&&(!player[recipient].is_human||will_use(recipient,'K'))){
use_kk(recipient);
}else {
hurt(recipient,id,1);
break;
}
if(can_use(id,'K')&&(!player[id].is_human||will_use(id,'K'))){
use_kk(id);
} else {
hurt(id,recipient,1);
break;
}
}
}
void use_n(int id){/*南蛮入侵*/
printf("Player[%d] use %s\n",id,CARD_NAME('N'));
int x=can_use(id,'N');
use(id,x);
for(int i=id%player_number+1;i!=id;i=i%player_number+1)if(!is_dead(i)&&(printf(" ->Player[%d]:\n",i),suc(id,i,0))){
if(can_use(i,'K')&&(!player[i].is_human||will_use(i,'K'))){
use_kk(i);
}else
hurt(i,id,0);
}
}
void use_w(int id){/*万箭齐发*/
printf("Player[%d] use %s\n",id,CARD_NAME('W'));
int x=can_use(id,'W');
use(id,x);
for(int i=id%player_number+1;i!=id;i=i%player_number+1)if(!is_dead(i)&&(printf(" ->Player[%d]:\n",i),suc(id,i,0))){
if(can_use(i,'D')&&(!player[i].is_human||will_use(i,'D'))){
use_d(i);
}else
hurt(i,id,0);
}
}
bool suc(int id,int rec,int tab){
for(int i=id%player_number+1;i!=id;i=i%player_number+1)if(!is_dead(i)&&can_use(i,'J')){
if(player[i].is_human){
if(will_use(i,'J')){
jump(i,id);
xyq(i,rec);
return !use_j(i,id,tab);
}
}else{
if((is_fp(rec)&&player[i].id=='F')||(is_zp(rec)&&(player[i].id=='Z'||player[i].id=='M'))){
jump(i,id);
xyq(i,rec);
return !use_j(i,id,tab);
}
}
}
return 1;
}
bool use_j(int id, int rec,int tab){/*无懈可击*/
for(int i=1;i<=tab;i++)putchar(' ');
printf("Player[%d] use %s against Player[%d]\n",id,CARD_NAME('J'),rec);
int x=can_use(id,'J');
use(id,x);
return suc(id,rec,tab+2);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。