加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
base.c 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
buzhibujue 提交于 2021-12-16 00:32 . Add card J.
#include "zgs.h"
/*ʹɱ*/
extern int player_number, cur[MAX_PLAYER],MP;
extern Pig player[MAX_PLAYER];
bool can_use_k(int playerid,int recipient){
return recipient!=-1&&recipient<=player_number&&recipient>0&&can_use(playerid,'K') && playerid!=recipient && dis(playerid,recipient)<=1;
}
void use_d( int playerid){
printf(" Player[%d] use %s\n",playerid,CARD_NAME('D'));
int x=can_use( playerid, 'D' );
use(playerid,x);
}
void use_kk(int playerid){
printf( "Player[%d] use %s\n",playerid,CARD_NAME('K'));
int x=can_use( playerid, 'K' );
use(playerid,x);
}
void use_k(int playerid,int recipient){
printf("Player[%d] use %s to Player[%d]\n",playerid,CARD_NAME('K'),recipient);
jump(playerid,recipient);
if(can_use(recipient,'D')&&(!player[recipient].is_human||will_use(recipient,'D'))){
use_d(recipient);
}else
hurt(recipient,playerid,1);
int x=can_use(playerid, 'K' );
use(playerid,x);
}
void use_p(int playerid){
printf("Player[%d] use %s(%d+1=%d)\n",playerid,CARD_NAME('P'),player[playerid].health,player[playerid].health+1);
cur[playerid]++;
player[playerid]. health++;
if(player[playerid].health>4+(MP==playerid))
player[playerid].health=4+(MP==playerid);
use(playerid,can_use(playerid,'P'));
}
void use_z(int playerid){
printf("Player[%d] is equipped with %s\n",playerid, CARD_NAME('Z'));
player[playerid].has_z|=1;
use(playerid,can_use(playerid,'Z'));
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化