加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
act.c 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
1i6 w31fen9 提交于 2021-12-14 23:30 . Add act.c
#include "zgs.h"
#include<string.h>
/*行为判断*/
extern Pig player[MAX_PLAYER];
bool can_xyq(int playerid,int recipient){/*Pig player[MAX_PLAYER];*/
int i;
if(strcmp(player[playerid].id,player[recipient].id)||((player[recipient].id=='M'&&player[playerid].id=='Z'))||(player[playerid].id=='Z'&&player[recipient].id=='Z')){/*如果自己是忠臣,对象是主公或者自己的身份和对象一致,或者主公对自己献殷勤*/
if(player[recipient].id=='M'){
for(i=0;i<player[playerid].card.number;i++){
if(player[playerid].card.type=='J'&&use_j(playerid,i,))
}
}
if(is_zp(recipient)||is_fp(recipient)){
}
if(player[playerid].id=='Z'&&player[recipient].id=='Z'){
}
}
}
bool can_bdy(int playerid,int recipient){
//使用杀
if(can_use_k(playerid,recipient)){
if(player[recipient].id=='M'||player[recipient].Loyalty_or_opposition==1){
player[playerid].Loyalty_or_opposition=-1;
}
if(player[recipient].Loyalty_or_opposition==-1){
player[playerid].Loyalty_or_opposition=1;
}
return true;
}
//使用决斗
int i;
for(i=0;i<player[playerid].card.number;i++){
if(player[playerid].card.type=="F"){
if(use_f(playerid,recipient,i)){
if(player[recipient].id=='M'){
player[playerid].Loyalty_or_opposition=-1;
}
if(player[recipient].Loyalty_or_opposition=-1){
player[playerid].Loyalty_or_opposition=1;
}
return true;
}
}
}
//使用无懈可击抵消献殷勤
}
//是否跳忠过
bool is_zp(int playerid){
if(player[playerid].Loyalty_or_opposition==1){
return true;
}
else{
return false;
}
}
//是否跳反过
bool is_fp(int playerid){
if(player[playerid].Loyalty_or_opposition==-1){
return true;
}
else{
return false;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化