高级天翼
C++是什么?
——正确答案:C
知道为什么吗?
哈哈哈,我不讲笑话,我只是笑话的搬运工(虽然笑话很冷)
李泽远在2020-07-26 21:16:40追加了内容
emmmm,我不太明白您的意思
李泽远在2020-07-26 21:17:11追加了内容
等一会儿,待我把压箱底的代码翻出来
李泽远在2020-07-26 21:27:15追加了内容
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int IQ=60,money=100,vip,xj=10,myIQ,mybuy,HP=100,xin=100,ATK=15;
bool chongzhi;
string s;
void myout(string s){
for(int i=0;i<s.size();i++){
cout<<s[i];
Sleep(80);
}
}
void die(){
system("cls");
cout<<"Duang!\n";
Sleep(1500);
system("color 4F\n");
Sleep(1500);
system("color 0F\n");
Sleep(1500);
system("color 7F\n");
Sleep(1500);
system("color 7c");
myout("You're dead.\n");
Sleep(1500);
exit(0);
}
void test(){
system("color 7c");
char a;
cout<<"\n测评系统1.0\n";
cout<<"开始测评!\n";
cout<<"A.1/3 B.1/4 C.1/5 D.1/6 \n";
cout<<"请选择(0-1)∫x^2 dx=( )\b\b";
cin>>a;
system("CLS");
cout<<"正在测评中";
for(int i=1;i<=6;i++){
cout<<".";
if(i==6)
break;
Sleep(1000);
}
system("CLS");
if(a=='A'){
system("color 7A");
cout<<"666,答对了!智商+5!";
IQ+=5;
system("color 7C");
}
else{
for(int i=1;i<=6;i++)
Beep(1000,200);
cout<<"您的智商已欠费\n";
cout<<"我推荐智商银行\n";
cout<<"智商银行年利率-100%,\n";
cout<<"可购买智商,存储智商等\n";
cout<<"与工商银行,农商银行并称三商\n";
cout<<"让你走上人生巅峰\n";
myout("更多福利请关注无敌公司,拨打热线0551-66662333\n");
}
Sleep(3000);
}
void VIP(){
cout<<"\n当前VIP等级为"<<vip<<endl;
cout<<"当前金币为"<<money<<",共需"<<xj<<"金币\n";
cout<<"是否要充值? 1 Yes 0 No\n";
cin>>chongzhi;
if(chongzhi==1){
if(money>=xj&&xin>=60){
money-=xj;
vip++;
xj*=2;
cout<<"当前VIP等级为"<<vip<<endl;
cout<<"当前金币为"<<money<<endl;
xin+=10;
}
else{
system("cls");
if(xin<60){
myout("信用度不足,无法充值,\n您已被服务员踹了一脚,血量-10,信用度-10");
HP-=10;
xin-=10;
}
else{
myout("金币不足,无法充值,\n您已被服务员踹了一脚,血量-10,信用度-10");
HP-=10;
xin-=10;
}
}
}
cout<<endl;
Sleep(2000);
}
int _HP=100,_ATK=10;
void copy(){
cout<<"您("<<HP<<")"<<" 对手("<<_HP<<")"<<endl;
HP-=_ATK;
_HP-=ATK;
Sleep(1000);
system("cls");
}
void dajia(){
cout<<"您的对手是智商银行的打手\n";
Sleep(1000);
while(1){
copy();
if(_HP<=0){
myout("成功了!\n");
ATK+=10;
_ATK+=15;
money+=500;
return;
}
else if(HP<=0)
die();
}
}
void cun(){
cout<<"目前智商为:"<<IQ<<endl;
cout<<"要存多少?\n";
cin>>myIQ;
if(myIQ<=IQ&&xin>=60)
{
IQ-=myIQ;
money+=10;
if(VIP>0)
{
cout<<"您为V"<<vip<<"用户,免费领金币和智商\n";
IQ+=vip*2;
money+=100;
}
cout<<"存好了!目前智商为"<<IQ<<"!\n";
xin+=10;
}
else{
if(xin<60)
cout<<"信用不足,无法存智商!\n";
if(IQ<myIQ)
cout<<"您没那么多智商!\n";
}
myIQ=0;
Sleep(1000);
}
void buy(){
string s="请问您要购买多少智商呢?";
string x="金钱不足!";
myout(s);
cin>>mybuy;
if(mybuy*100<=money){
IQ+=mybuy;
money-=mybuy*100;
myout("购买成功!");
}
else{
myout(x);
xin-=10;
HP-=10;
}
Sleep(1000);
}
double ans;
void IQ_PLUS(){
cout<<"这里是智力训练营!请回答下列题目.\n";
cout<<"(1)1+1=?";
cin>>ans;
if(ans==2){
srand(time(NULL));
if(rand()%10<=vip){
cout<<"服务员:快来看!这里有个老实人,快来欺负TA!\n";
cout<<"您的钱被抢没了。。。\n";
money=0;
}
cout<<"恭喜答对!\n";
IQ+=int(vip/2);
}
else{
cout<<"很好,有创新思维\n";
IQ+=int(vip/2);
}
Sleep(1000);
}
void outzt(){
cout<<"\n智商:"<<IQ<<endl;
cout<<"信用:"<<xin<<endl;
cout<<"血量:"<<HP<<endl;
cout<<"金钱:"<<money<<endl;
cout<<"攻击力:"<<ATK<<endl;
Sleep(5000);
}
bool chose,c;
void check(){
cout<<"正在检查中";
myout("......\n");
if(HP>=60){
cout<<"您很健康!\n";
myout("沉默......");
Sleep(3000);
myout("\n请您支付费用!\n按0支付,按1逃跑\n");
cin>>chose;
if(chose==0){
if(money>=40)
cout<<"成功支付!\n";
else{
myout("您没钱了!\n您已被服务员踹了一脚(现在您不健康了).\n");
HP-=10;
xin-=10;
}
}
else{
cout<<"您的良心呢?\n";
cout<<"牛小顿怒了!各项指数-10!n";
HP-=10;
xin-=10;
money-=10;
ATK-=10;
}
}
else{
cout<<"\n您不健康,是否要治疗?\n按1治疗";
cin>>c;
if(c==1){
cout<<"良心医院,免费治疗!\n";
cout<<"治疗成功!\n";
HP=100;
}
else
cout<<"不治拉倒!\n";
}
Sleep(1000);
}
bool ch;
void bengda(){
cout<<"您现在到了悬崖前......\n";
cout<<"1蹦跶 0返回";
cin>>ch;
if(ch)
die();
else{
myout("您被后面的人踹了一脚......");
die();
}
}
bool i;string str="引力";
void qiang(){
Sleep(1000);
cout<<"\n您正在抢劫智商银行,钱正在增加!\n";
money+=1000;
Sleep(3000);
cout<<"管理员牛小顿来了!\n0带着抢到的钱逃跑1作死\n";
cin>>i;
if(i==0){
if(ATK>=40){
cout<<"牛小顿使出了万有引力,您被抓起来了!\n";
money-=500;
}
else
cout<<"成功逃脱!\n";
}
else
die();
}
void Do_kung_fu(){
if(money>=200){
cout<<"练好了!花费10欧元.\n";
HP+=10;
ATK+=10;
money-=100;
}
else
myout("您以为这是免费的?\nThat's impossible!\n您钱不够了!");
}
void do_Sth(){
cout<<"\n你要搞点什么事情?\n";
cout<<"1:去医院\n";
cout<<"2:去蹦跶\n";
cout<<"3:打架\n";
cout<<"4:抢银行\n";
cout<<"5:练功夫\n";
int a;
scanf("%d",&a);
switch(a){
case 1 : check();break;
case 2 : bengda();break;
case 3 : dajia();break;
case 4 : qiang();break;
case 5 : Do_kung_fu();break;
}
Sleep(1000);
}
void menu(){
system("color 7c");
int a;
Sleep(1000);
while(1){
cout<<"\n";
if(HP==0){
cout<<"血量不足!\n";
cout<<"您必须搞点事情.\n";
}
if(money==0){
cout<<"金币不足!\n";
cout<<"您必须搞点事情.\n";
}
cout<<"牛小顿: 请问需要什么服务? \n";
cout<<"\n1检测智商;\n";
cout<<"2充VIP;\n";
cout<<"3存智商;\n";
cout<<"4购买智商;\n";
cout<<"5查看目前状态;\n";
cout<<"6搞点事情;\n";
cout<<"7智商训练营;\n";
cout<<"8退出;\n";
cin>>a;
if(a!=6&&(money==0||HP==0))
die();
else{
switch(a){
case 1 : test(); break;
case 2 : VIP (); break;
case 3 : cun(); break;
case 4 : buy(); break;
case 5 : outzt(); break;
case 6 : do_Sth(); break;
case 7 : IQ_PLUS();break;
case 8 : die(); break;
}
}
Sleep(3000);
system("cls");
}
}
void show(string s){
string m=s+",欢迎来到智商银行!\n我是牛小顿.\n";
cout<<"牛小顿:";
myout(m);
Sleep(2000);
system("cls");
menu();
}
int main(){
system("color 7c");
cout<<"请输入您的用户名:___\b\b\b";
cin>>s;
Sleep(3000);
show(s);
return 0;
}
未完待续,To be continued…
李泽远在2020-07-26 21:30:35追加了内容
多年前的代码了,现在正在完善
新手天翼
C语言是什么?
解:
∵shift+按键可以输出大写字母恒成立
且shift还可以输出上档键
∴字符的上档键格式取模下档键=字母的大写取模字母的小写
∴“+”=“=”的大写
∵C++这一单词因为其特殊性,需要全部大写
∴回归小写,C++的原形是“C==”
∵C是C语言的简称
∴C语言就是一个等于号 或者 C++在骂它祖宗
高级守护
我代码不是很行,但是玩梗,你找我就对了
【doge】、【滑稽】:这两个梗一般用于开玩笑的话后面,其中滑稽一般多用于ghs时使用
希望工程:一般句式为:希望。。。没事,如:希望人没事,大家看到这个梗基本上都会回一句:老希望工程了
某某(地名)脏话:如:广东脏话,一般代表使用者可能想用此地脏话骂人了
带....:一般网友会用带字替代“大”,如:带佬,带语言艺术家。。。。。
多人运动:指周青扬与罗志祥被传闻分手的消息这么多年一直就传得沸沸扬扬,而两位当事人对于分手传闻也是一直保持沉默,没有直接承认当然也没有直接否认,终于周青扬是忍无可忍,在个人社交媒体上发文称自己已经与罗志祥分手了一段时间,而且周青扬还在这个分手消息中透露出了许多的猛料,表示主要原因就是罗志祥太喜欢玩,趁自己没在身边时多次邀请美女去家里玩,更是和多名好朋友邀请多名年轻女子玩多人运动。网友多在ghs时使用此梗
ghs:额。。。。这个马,是一个词的是缩写,你们自己查吧
望带佬采纳
新手天翼
#include<bits/stdc++.h>
#include<windows.h>
#include<windows.h>
#include<cstdio>
#include<iostream>
#define qdo 262
#define qre 294
#define qmi 330
#define qfa 349
#define qso 392
#define qla 440
#define qsi 494
#define do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define do1 1046
#define re1 1175
#define mi1 1318
#define fa1 1480
#define so1 1568
#define la1 1760
#define si1 1976
#define sqdo 277
#define sqre 311
#define sqfa 370
#define sqso 415
#define sqla 466
#define sdo 554
#define sre 622
#define sfa 740
#define sso 831
#define sla 932
#define sdo1 1046
#define sre1 1245
#define sfa1 1480
#define sso1 1661
#define sla1 1865
using namespace std;
string s3="";
string s="";
int mima;
void kc()
{
srand(int(time(0)));
int a;
cout<<"是否进入游戏,谨慎选择\n1、进入 2、退出";
cin>>a;
if(a==1)
{
system("Cls");
cout<<"正在加载";
Sleep(500);
for(int i=1;i<=9;i++)
{
system("Cls");
s+="*";
cout<<s<<"\n "<<s.size()<<"0%";
Sleep(500);
}
Sleep(2000);
system("Cls");
s+="*";
cout<<s<<"\n "<<s.size()<<"0%";
}
else
{
cout<<"已退出。" ;
exit(0);
}
Sleep(1000);
system("Cls");
cout<<"您好!欢迎来到坑人冒险。\n————作者:神之右手\n\n";
cout<<"请建一个用户名\n";
getline(cin,s);
getline(cin,s);
cout<<"请记住下面这密码,很有用的(两秒后消失)";
Sleep(500);
mima=rand()%100+100;
cout<<endl<<mima<<endl;
s3+=char(mima/100+'0');
s3+=char(mima/10%10+'0');
s3+=char(mima%10+'0');
Sleep(2000);
system("Cls");
cout<<"加油吧!少年";
}
void agangjuex()
{
int ban=500,pai=200,dw=128,bs;
Beep(la,ban*1.5);
Sleep(ban*3.6);
Beep(la,ban*1.5);
Sleep(ban*3.6);
Beep(fa,pai);
Beep(mi,pai);//
Beep(re,ban);
Beep(re,pai);
Beep(re,pai);
Beep(re,ban);
Beep(re,pai);
Beep(re,pai);
Beep(fa,ban);
Beep(re,pai);
Beep(re,pai);
Beep(re,ban);
Beep(fa,pai);
Beep(so,pai);//
Beep(la,ban);
Beep(la,pai);
Beep(la,pai);
Beep(la,ban);
Beep(fa,pai);
Beep(so,pai);
Beep(la,ban);
Beep(so,pai);
Beep(so,pai);
Beep(so,ban);
Sleep(ban);//
Beep(so,ban*1.5);
Sleep(ban*3.6);
Beep(so,ban*1.5);
Sleep(ban*3.6);
Beep(mi,pai);
Beep(re,pai);//
Beep(do,ban);
Beep(do,pai);
Beep(do,pai);
Beep(do,ban);
Beep(do,pai);
Beep(do,pai);
Beep(sre,ban);
Beep(do,pai);
Beep(do,pai);
Beep(do,ban);
Beep(sre,pai);
Beep(fa,pai);//
Beep(so,ban);
Beep(so,pai);
Beep(so,pai);
Beep(so,ban);
Beep(sre,pai);
Beep(fa,pai);
Beep(so,ban);
Beep(fa,pai);
Beep(fa,pai);
Beep(fa,ban);
Sleep(ban);
cout<<"\n\n完毕";
}
void shaon()
{
int ban=500,pai=200,dw=128,bs;
Beep(do1,ban);
Beep(re1,ban);
Beep(do1,ban);
for(int i=1;i<=3;i++)
Beep(so1,ban);
Beep(mi1,pai);
Beep(so1,ban+pai);
Beep(mi1,ban);
Beep(mi1,ban);
for(int i=1;i<=4;i++)
Beep(re1,ban);
Beep(do1,pai);
Beep(mi1,pai);
Beep(re1,ban);
Beep(re1,ban);
Beep(mi1,ban);
Beep(la,ban);
Beep(do1,ban);
Beep(do1,ban);
Beep(la,pai);
Beep(la,ban+pai);
Beep(do1,ban);
Beep(re1,ban);
Beep(do1,ban);
for(int i=1;i<=3;i++)
Beep(fa1,pai);
Beep(mi1,pai);
Beep(fa1,pai);
Beep(mi1,pai);
Beep(re1,pai);
Beep(do1,pai);
for(int i=1;i<=3;i++)
Beep(so1,pai);
Beep(mi1,dw);
Beep(so1,dw+pai);
Beep(mi1,pai);
Beep(mi1,pai);
for(int i=1;i<=4;i++)
Beep(re1,pai);
Beep(do1,dw);
Beep(mi1,dw);
Beep(re1,ban);
Beep(re1,pai);
Beep(mi1,pai);
Beep(la,pai);
Beep(do1,pai);
Beep(do1,pai);
Beep(la,pai);
Beep(la,pai);
Beep(do1,pai);
Beep(do1,pai+pai+dw);
Beep(do1,pai);
for(int i=1;i<=3;i++)
{
Beep(fa1,pai);
Beep(mi1,pai);
}
Sleep(pai);
Beep(fa1,pai);
Beep(mi1,pai);
Beep(re1,pai);
Beep(do1,pai+ban*4);
cout<<"\n\n完毕";
}
void wohaiy()
{
int ban=500,pai=200,dw=128,bs;
Beep(do,ban);
Beep(do,ban);
Beep(mi,ban);
Beep(mi,ban);
Beep(re,pai);
Beep(do,ban+pai);
Beep(qla,ban);
Beep(qso,pai);
Beep(qso,pai);
Beep(do,ban);
Beep(do,ban);
Beep(mi,pai);
Beep(mi,ban+pai);
Beep(re,ban*2);
Sleep(ban*2);
Beep(do,ban);
Beep(do,pai);
Beep(do,pai);
Beep(mi,pai);
Beep(mi,ban);
Beep(mi,pai);
Beep(re,ban);
Beep(do,ban);
Beep(qla,pai+dw);
Beep(qla,pai);
Beep(qso,pai);
Beep(qla,pai);
Beep(re,pai);
Beep(do,pai+dw);
Beep(re,pai);
Beep(do,pai);
Beep(re,pai);
Beep(mi,ban+pai);
Beep(do,ban*2);
Sleep(ban*2);
Beep(do,ban);
Beep(do,ban);
Beep(mi,ban);
Beep(mi,pai);
Beep(mi,pai);
Beep(re,pai);
Beep(do,ban+pai);
Beep(qla,ban);
Beep(qso,ban);
Beep(do,ban);
Beep(do,pai);
Beep(do,pai);
Beep(mi,pai);
Beep(mi,ban+pai);
Beep(re,ban*2);
Sleep(ban*2);
Beep(do,ban);
Beep(do,ban);
Beep(mi,pai);
Beep(mi,ban);
Beep(mi,pai);
Beep(mi,pai);
Beep(re,ban);
Beep(do,pai);
Beep(qla,pai);
Beep(qso,dw);
Beep(qla,pai);
Beep(do,pai);
Beep(re,pai);
Beep(do,dw);
Beep(re,pai);
Beep(do,pai);
Beep(mi,pai);
Beep(mi,pai+ban);
Beep(do,ban*2);
Sleep(ban*2);
Beep(mi,pai);
Beep(so,ban+pai);
Beep(do1,ban*2);
Sleep(ban);
Beep(mi,pai);
Beep(re,ban);
Beep(mi,pai);
Beep(do,ban*2);
Beep(mi,pai);
Beep(so,ban+pai);
Beep(do1,ban+pai);
Beep(do1,pai);
Sleep(ban);
Beep(mi,pai);
Beep(la,ban);
Beep(so,pai);
Beep(so,ban*2);
Sleep(pai);
Beep(mi,pai);
Beep(so,ban+pai);
Beep(do1,ban*2);
Sleep(ban);
Beep(mi,pai);
Beep(re,ban);
Beep(mi,pai);
Beep(do,ban*2);
Beep(mi,pai);
Beep(so,ban);
for(int i=1;i<=4;i++)
Beep(so,pai);
Beep(mi,pai);
Beep(la,ban);
Beep(so,pai+ban);
Beep(mi,pai);
Beep(so,ban+pai);
Beep(do1,ban*2);
Sleep(ban);
Beep(mi,pai);
Beep(re,ban);
Beep(mi,pai);
Beep(do,ban*2);
Beep(mi,pai);
Beep(so,pai+ban);
Beep(do1,ban+pai);
Beep(do1,pai);
Beep(do1,pai);
Beep(la,ban);
Beep(so,pai);
Beep(so,dw);
Beep(la,dw);
Beep(so,ban*2);
Sleep(pai);
Beep(mi,pai);
Beep(so,ban+pai);
Beep(do1,ban*2);
Sleep(ban);
Beep(mi,pai);
Beep(re,ban);
Beep(mi,pai);
Beep(do,ban*2);
for(int i=1;i<=2;i++)
{
Beep(re,pai+dw);
Beep(do,dw);
}
Beep(re,ban);
Beep(mi,ban);
Beep(fa,ban*2);
Sleep(pai);
Beep(mi,ban);
Beep(re,pai);
Beep(do,pai);
Beep(do,ban*4);
}
void bir()
{
int ban=500,pai=200,dw=128,bs;
Beep(qso,ban);
Beep(qso,ban);
Beep(qla,ban);
Beep(qso,ban);
Beep(do,ban);
Beep(qsi,ban);
Beep(qso,ban);
Beep(qso,ban);
Beep(qla,ban);
Beep(qso,ban);
Beep(re,ban);
Beep(do,ban);
Beep(qso,ban);
Beep(qso,ban);
Beep(so,ban);
Beep(mi,ban);
Beep(re,ban);
Beep(do,pai);
Beep(qsi,pai);
Beep(qla,ban);
Beep(fa,ban);
Beep(fa,ban);
Beep(mi,ban);
Beep(do,ban);
Beep(re,ban);
Beep(do,ban);
}
int main() {
int s,xz;
kc();
Sleep(3000);
while(s!=4)
{
system("Cls");
cout<<"有一天,你发现你桌上有一台录音机。你决定?\n1、吃下去 2、听音乐 3、听公告 4、扔掉";
cout<<"\n you ↓ \n";
cout<<" @ |=|\n";
cin>>s;
if(s==1)
{
cout<<"你是一个狠人……\n你因吃录音机而不幸去世。";
cout<<"\n对了,录音机啥味道能给我讲讲呗";
for(int i=1;i<=6;i++)
{
cout<<".";
Sleep(300);
}
exit(0);
}
if(s==2)
{
s=12;
string s1;
cout<<"请输入密码";
cin>>s1;
while(s1!="密码")
{
if(s1==s3)
{
cout<<"你的断句和词语理解不对\n再试试";
Sleep(2000);
system("Cls");
}
else
{
cout<<"……";
exit(0);
}
cout<<"请输入密码 ";
cin>>s1;
}
if(s1=="密码")
{
cout<<"密码正确!";
Sleep(2000);
system("Cls");
while(s!=5)
{
cout<<"你想听啥?(剩下的还在补充,敬请期待)\n1、阿纲觉醒 2、少年(高潮) 3、我还有点小糊涂。 4、生日快乐 5、退出 ";
cin>>s;
Sleep(2000);
if(s==1)
{
agangjuex();
system("Cls");
}
if(s==2)
{
shaon();
system("Cls");
}
if(s==3)
{
wohaiy();
system("Cls");
}
if(s==4)
{
bir();
system("Cls");
}
if(s==5)
{
cout<<"已退出";
break;
}
}
}
}
if(s==3)
{
cout<<"最新消息:\n坑人冒险1.0上线了!有问题可以在评论反馈给我哦……";
cout<<"\n技巧:如果有一个坑,你不要跳过去%¥%!";
Sleep(2000);
system("Cls");
}
if(s==4)
{
cout<<"这时,你突然眼前一黑,耳边传来阵阵声音:\n";
string shengyin="我TM弄死你\n我TM弄死你\n沙雕,滚!";
for(int i=0;i<shengyin.size();i++)
{
cout<<shengyin[i];
Sleep(150);
}
cout<<"\n你:⊙(?◇?)?\n";
Sleep(1500);
int xuan;
while(1)
{
cout<<"这时\n";
cout<<" ~~ ~~~:我是白云 \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n我TM的目标是啥\n系统:现在,你要进行冒险,拿回你的收音机,不然你就回不去了。\n你:好吧\n";
cout<<"你决定?1、走过去 2、跳过去 3、高跳过去 4、我飞~ 5、氪金 6、零氪";
cin>>xuan;
if(xuan==1)
{
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~\n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" ===\n";
cout<<"========== 你 ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" ===\n";
cout<<"========== ========\n";
cout<<" _▋_ \n";
cout<<"\n你死了";
Sleep(700);
system("Cls");
}
if(xuan==2)
{
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== @ ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" @ ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" _▋_ =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
cout<<"\n superise ** fuck\n你死了";
Sleep(2000);
system("Cls");
}
if(xuan==3)
{
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~你~:我是白云~~~~~ \n";
cout<<" =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~ ~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~ ~: ~~~~~ \n";
cout<<" 我是白云 =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~ ~: ~~~~~ \n";
cout<<" =\n";
cout<<" 我是白云 ===\n";
cout<<"========== _▋_ ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~ ~: ~~~~~ \n";
cout<<" =\n";
cout<<" 云 ===\n";
cout<<"========== _▋_ ========\n";
cout<<" 我是白 ";
cout<<"\n superise ** fuck\n你死了";
Sleep(2000);
system("Cls");
}
if(xuan==4)
{
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" ﹥你 =\n";
cout<<" 超级加速! ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" >}你 =\n";
cout<<" 充能! ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" =≯你 =\n";
cout<<" 加~速! ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" ∑你 =\n";
cout<<" 冲啊!!! ===\n";
cout<<"========== ========\n";
Sleep(100);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(100);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(100);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" 你 =\n";
cout<<" @ ===\n";
cout<<"========== @ @========\n";
Sleep(100);
system("Cls");
cout<<" ~~ ~~~:我是白云~~~~~ \n";
cout<<" @ 你 =\n";
cout<<" @ ===\n";
cout<<"========== @========\n";
Sleep(100);
system("Cls");
cout<<" ~~ ~~~:∷是白云~~~~~ \n";
cout<<" @ 你 =\n";
cout<<" @ ===\n";
cout<<"========== ========\n";
Sleep(100);
system("Cls");
cout<<" ~~ ~~~:∷∷白云~~~~~ \n";
cout<<" @你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:∷∷∷云~~~~~ \n";
cout<<" 你 =\n";
cout<<" ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:∷∷∷云~~~~~ \n";
cout<<" =\n";
cout<<" 你 ===\n";
cout<<"========== ========\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:∷∷∷云~~~~~ \n";
cout<<" =\n";
cout<<" ===\n";
cout<<"========== === 你=====\n";
Sleep(200);
system("Cls");
cout<<" ~~ ~~~:∷∷∷云~~~~~ \n";
cout<<" =\n";
cout<<" ===\n";
cout<<"========== === =====\n";
cout<<" _▋_ ";
cout<<"\n小朋友,你是否有很多问号?";
Sleep(2000);
system("Cls");
}
if(xuan==5)
{
cout<<"\n果然,氪金的力量是强大的!!!\n但你没钱,你被……";
Sleep(1000);
exit(0);
}
if(xuan==6)
{
cout<<"\n系统“高兴”地把你踹到了对面……下一关!\n";
break;
}
}
Sleep(1500);
system("Cls");
while(1)
{
cout<<"你来到了:\n";
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~\n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" 你 [祭坛] <O 架| \n";
cout<<"================TTT========\n";
cout<<"神:要想过去,必须献祭才行!\n 你:1、献祭自己 2、先跳到祭坛上,再跳到刑事架上,最后到传送门 3、和神干架 4、挖隧道";
cin>>xz;
if(xz==1)
{
system("Cls");
cout<<"简单明了,你死了。";
exit(0);
}
if(xz==2)
{
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~\n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" 你 [祭坛] <O 架| \n";
cout<<"================TTT========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" _你_ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ______ \n";
cout<<" 你 <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" __你__ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ___你_ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌 ~~~~~~~ \n";
cout<<" _____ 云 \n";
cout<<" <| 邢| 你 @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌 ~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢|云 @@ \n";
cout<<" ____ <| 事|你 @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌 ~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事|云 @@ \n";
cout<<" [祭坛] <O 架|你 \n";
cout<<"================TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌 ~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架|_▋_ \n";
cout<<"================TTT云=======\n";
cout<<"你以为这么简单吗";
Sleep(2000);
system("Cls");
}
if(xz==3)
{
int red=100,cs=0;
int shuz=0,gr;
cout<<"~&Boss战!&~";
string boss="\n前方高能\n 做好警戒 \n奥利给!!!!!";
for(int i=0;i<boss.size();i++)
{
cout<<boss[i];
Sleep(100);
}
Sleep(2000);
system("Cls");
while(1)
{
cout<<" 生命值:"<<red;
cout<< " 生命值:"<<red<<endl;
cout<<"1、火炮 2、滑稽之力 3、冰雪风暴 4、觉醒:"<<shuz<<"%";
cin>>xz;
cs++;
if(shuz!=100)
shuz+=20;
if(shuz!=100)
{
if(xz==4)
{
cout<<"能量正在汇集…";
Sleep(1000);
system("Cls");
}
}
else
{
if(xz==4)
{
cout<<"你使用了觉醒·神之冲击\n";
cout<<"神:居然使用我的力量……\n";
cout<<"系统:ACE";
Sleep(3000);
system("Cls");
string s="一切事,该结束了……\n 在一闪闪白光中,你看到了曾经的少年……\n";
for(int i=0;i<s.size();i++)
{
cout<<s[i];
Sleep(100);
}
Sleep(2000);
system("Cls");
s="你醒来了,你的神力化作了金光,钻进了你的右手……";
for(int i=0;i<s.size();i++)
{
cout<<s[i];
Sleep(100);
}
Sleep(2000);
system("Cls");
cout<<"作者:终于完结了……\n请期待坑人冒险2.0!";
exit(0);
}
}
if(xz!=4)
{
cout<<"\n对手使用了滑稽盾\n";
if(cs==1)
cout<<"并嘲讽你:神是不可消灭的,一个人和一个神。";
if(cs==2)
cout<<"神:你没发现我和你长一样吗 \n 你:呵呵,我要杀了你";
if(cs==3)
cout<<"神:我是你的化身,我和你的名字一样,也叫"<<s;
if(cs>=4)
cout<<"神:杀了我也就杀了你 ,只要杀了你,我才是主角。";
Sleep(2000);
system("Cls");
}
}
}
if(xz==4)
{
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~\n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"===你===========TTT========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"=====你=========TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"========你======TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] <O 架| \n";
cout<<"===========你===TTT=========\n";
Sleep(200);
system("Cls");
cout<<"~~ ~~~~ ~~:我是乌云~~~~~~~ \n";
cout<<" ______ \n";
cout<<" <| 邢| @@ \n";
cout<<" ____ <| 事| @@ \n";
cout<<" [祭坛] 架| \n";
cout<<"============<O==TTT=========\n";
cout<<" _▋_ ";
string hah="惊喜不?意外不?(doge)";
for(int i=0;i<hah.size();i++)
{
cout<<hah[i];
Sleep(100);
}
Sleep(2000);
system("Cls");
}
}
}
}
return 0;
}
资深守护
#include<bits/stdc++.h>
#include<iostream>
#include<time.h>
#include<windows.h>
#include<stdlib.h>
using namespace std;
int main() {
system("color 10");
cout<<"你";
Sleep(100);
cout<<"的";
Sleep(100);
cout<<"世";
Sleep(100);
cout<<"界";
Sleep(100);
cout<<endl<<"(改编)作者:";
Sleep(100);
cout<<"许";
Sleep(100);
cout<<"金";
Sleep(100);
cout<<"夫";
Sleep(100);
cout<<endl<<" d---单人 s---双人"<<endl;
string app;
cin>>app;
if(app=="d"){
Sleep(100);
cout<<endl<<"相";Sleep(100);
cout<<"传";Sleep(100);
cout<<"世";Sleep(100);
cout<<"界";Sleep(100);
cout<<"由";Sleep(100);
cout<<"2";Sleep(100);
cout<<"名";Sleep(100);
cout<<"创";Sleep(100);
cout<<"世";Sleep(100);
cout<<"神";Sleep(100);
cout<<"所";Sleep(100);
cout<<"创";Sleep(100);
cout<<"造";Sleep(100);
cout<<"。";Sleep(100);
cout<<"一";Sleep(100);
cout<<"个";Sleep(100);
cout<<"叫";Sleep(100);
cout<<"N";Sleep(100);
cout<<"o";Sleep(100);
cout<<"t";Sleep(100);
cout<<"c";Sleep(100);
cout<<"h";Sleep(100);
cout<<",";Sleep(100);
cout<<"一";Sleep(100);
cout<<"个";Sleep(100);
cout<<"叫";Sleep(100);
cout<<"H";Sleep(100);
cout<<"e";Sleep(100);
cout<<"r";Sleep(100);
cout<<"o";Sleep(100);
cout<<"b";Sleep(100);
cout<<"r";Sleep(100);
cout<<"i";Sleep(100);
cout<<"n";Sleep(100);
cout<<"g";Sleep(100);
cout<<"。";Sleep(100);
cout<<"他";Sleep(100);
cout<<"们";Sleep(100);
cout<<"是";Sleep(100);
cout<<"一";Sleep(100);
cout<<"对";Sleep(100);
cout<<"兄";Sleep(100);
cout<<"弟";Sleep(100);
cout<<"。";
Sleep(100);
cout<<endl;
cout<<"他";Sleep(100);
cout<<"们";Sleep(100);
cout<<"创";Sleep(100);
cout<<"造";Sleep(100);
cout<<"出";Sleep(100);
cout<<"了";Sleep(100);
cout<<"人";Sleep(100);
cout<<"类";Sleep(100);
cout<<"。";Sleep(100);
cout<<"N";Sleep(100);
cout<<"o";Sleep(100);
cout<<"t";Sleep(100);
cout<<"c";Sleep(100);
cout<<"h";Sleep(100);
cout<<"总";Sleep(100);
cout<<"是";Sleep(100);
cout<<"创";Sleep(100);
cout<<"造";Sleep(100);
cout<<"出";Sleep(100);
cout<<"对";Sleep(100);
cout<<"人";Sleep(100);
cout<<"类";Sleep(100);
cout<<"有";Sleep(100);
cout<<"益";Sleep(100);
cout<<"的";Sleep(100);
cout<<"东";Sleep(100);
cout<<"西";Sleep(100);
cout<<",";
cout<<"可Herobring相反。";
Sleep(100);
cout<<endl<<endl<<"有一天,Herobring与Notch大战了一场,Herobring被Notch";
cout<<"的铁傀儡击杀了。Herobring死前发誓要复仇。";
Sleep(100);
cout<<endl<<endl<<"可是,当大家都很高兴的时候,Notch找到你,对你说:";
Sleep(100);
cout<<endl<<endl<<"“Him的创世之力不会被轻易消灭,总有一天,他会苏醒的!”";
Sleep(100);
cout<<endl<<endl<<"苍老的Notch说完话,便倒下了。";
Sleep(100);
cout<<endl<<endl<<endl<<endl<<"一场新的故事,拉开了序幕...";
}
string name;
cout<<endl<<endl<<"你的名字:";
cin>>name;
int xsw=0;
long long a,b,c,ji=1,him=0,xue=50+ji*25,gong=50+ji*50,jin=0,myl=20,hxue=100,lg=100,fang=5000+ji*10;
int xue1=100,xue2=200,xue3=400,xue4=400,xue5=700,xue6=800,money=0;
bool shaoshang=0,judu=0,zuzhou=0,huimie=0,yaoshi=0;
while(him!=1){
cout<<endl<<"1--冒险 2--商店 3--状态 ";
cin>>a;
if(a==1){
cout<<endl<<"1--僵尸森林 2--骷髅大陆 3--女巫沼泽 4--末影宫殿 ";
cout<<"5--守卫之洋 6--林地府邸 7--封印守护者:终界之龙 8--herobring的封印";
cin>>b;
if(b==1){
while(xue1>0){
if(xsw==0){
cout<<endl<<"夜幕即将降临";
system("color 90");Sleep(500);
system("color E0");Sleep(500);
system("color C0");Sleep(500);
system("color 48");Sleep(500);
system("color 07");Sleep(500);
}
xsw=1;
cout<<endl<<"僵尸向你扑来!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
xue1-=gong;
cout<<endl<<"僵尸克了"<<gong<<"滴血";
if(xue1>0){
cout<<endl<<"僵尸还有"<<xue1<<"滴血";
cout<<endl<<"僵尸咬了你!你克了10滴血";
xue-=10;
cout<<endl<<"你还有"<<xue<<"滴血";
}
else
cout<<endl<<"僵尸挂菜!";
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0){
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败僵尸,经验加10点!获得50元。";
jin+=10;
xue1=100;
money+=50;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==2){
while(xue2>0){
cout<<endl<<"骷髅拿起了弓!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
xue2-=gong;
cout<<endl<<"骷髅克了"<<gong<<"滴血";
if(xue2>0){
cout<<endl<<"骷髅还有"<<xue2<<"滴血";
cout<<endl<<"你被射中了!你克了20滴血";
xue-=20;
cout<<endl<<"你还有"<<xue<<"滴血";
}
else cout<<endl<<"骷髅挂菜!";
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0)
{
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败骷髅,经验加20点!获得100元";
jin+=20;
xue2=200;
money+=100;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==3){
while(xue3>0){
cout<<endl<<"女巫丢出了药水!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1)
{
xue3-=gong;
cout<<endl<<"女巫克了"<<gong<<"滴血";
if(xue3>0)
{
cout<<endl<<"女巫还有"<<xue3<<"滴血";
cout<<endl<<"你被药水砸中了!你克了50滴血";
xue-=50;
cout<<endl<<"你还有"<<xue<<"滴血";
}
else cout<<endl<<"女巫挂菜!";
}
else if(c==2)
{
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0)
{
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败女巫,经验加50点!获得250元(这数字很像你)";
jin+=50;
xue3=400;
money+=250;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==4){
while(xue4>0) {
cout<<endl<<"你看见了末影人的眼睛!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
xue4-=gong;
cout<<endl<<"末影人克了"<<gong<<"滴血";
if(xue4>0){
cout<<endl<<"末影人还有"<<xue4<<"滴血";
cout<<endl<<"你被末影人攻击了!你克了80滴血";
xue-=80;
cout<<endl<<"你还有"<<xue<<"滴血";
}
else
cout<<endl<<"末影人挂菜!";
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0){
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败末影人,经验加80点!获得400元";
jin+=80;
xue4=100;
money+=400;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==5){
while(xue5>0){
cout<<endl<<"你被守卫者用光波链接了!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
xue5-=gong;
cout<<endl<<"守卫者克了"<<gong<<"滴血";
if(xue5>0){
cout<<endl<<"守卫者还有"<<xue5<<"滴血";
cout<<endl<<"守卫者光波攻击成功!你克了150滴血";
xue-=150;
cout<<endl<<"你还有"<<xue<<"滴血";
}
else
cout<<endl<<"守卫者挂菜!";
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0){
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败守卫者,经验加150点!获得750元";
jin+=150;
xue5=100;
money+=750;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==7){
while(xue6>0)
{
cout<<endl<<"圣龙怒吼一声!!!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
if(xue>(50000+ji*25)*0.9&&myl>20000000*0.5){
myl-=869000;
cout<<endl<<"圣龙克了"<<869000<<"滴血";
if(myl>0)
{
cout<<endl<<"圣龙还有"<<myl<<"滴血";
cout<<endl<<"圣龙召唤了陨石!你克了"<<lg*2-fang<<"滴血";
cout<<endl<<"你进入了烧伤状态!!!每回合减少20滴血!!";
xue-=lg*2-fang;
shaoshang=1;
if(shaoshang==1){
xue-=20;
}
cout<<endl<<"你还有"<<xue<<"滴血";
}
else{
cout<<endl<<"圣龙挂菜!";
yaoshi=1;
}
}
else if(xue>(50000+ji*25)*0.75&&myl>20000000*0.5){
myl-=869000;
cout<<endl<<"圣龙克了"<<869000<<"滴血";
if(myl>0)
{
cout<<endl<<"圣龙还有"<<myl<<"滴血";
cout<<endl<<"圣龙召唤了暗黑龙息!你克了"<<lg*1.5-fang<<"滴血";
cout<<endl<<"你进入了诅咒状态!!!每回合减少30滴血!!";
xue-=lg*1.5-fang;
shaoshang=1;
zuzhou=1;
if(shaoshang==1){
xue-=20;
}
if(zuzhou==1){
xue-=30;
}
cout<<endl<<"你还有"<<xue<<"滴血";
}
else{
cout<<endl<<"圣龙挂菜!";
yaoshi=1;
}
}
else if(xue>(50000+ji*25)*0.5&&myl>20000000*0.5){
myl-=869000;
cout<<endl<<"圣龙克了"<<869000<<"滴血";
if(myl>0)
{
cout<<endl<<"圣龙还有"<<myl<<"滴血";
cout<<endl<<"圣龙召唤了剧毒龙息!你克了"<<lg*3-fang<<"滴血";
cout<<endl<<"你进入了剧毒状态!!!每回合减少15滴血!!";
xue-=lg*3-fang;
shaoshang=1;
zuzhou=1;
judu=1;
if(shaoshang==1){
xue-=20;
}
if(zuzhou==1){
xue-=30;
}
if(judu==1){
xue-=10;
}
cout<<endl<<"你还有"<<xue<<"滴血";
}
else{
cout<<endl<<"圣龙挂菜!";
yaoshi=1;
}
}
else if(myl>20000000*0.5){
myl-=869000;
cout<<endl<<"圣龙克了"<<869000<<"滴血";
if(myl>0)
{
cout<<endl<<"圣龙还有"<<myl<<"滴血";
cout<<endl<<"圣龙召唤了深红龙息!你克了"<<20000000-myl<<"滴血";
xue-=20000000-myl;
shaoshang=1;
zuzhou=1;
judu=1;
if(shaoshang==1){
xue-=20;
}
if(zuzhou==1){
xue-=30;
}
if(judu==1){
xue-=10;
}
cout<<endl<<"你还有"<<xue<<"滴血";
}
else{
cout<<endl<<"圣龙挂菜!";
yaoshi=1;
}
}
else if(myl<20000000*0.5){
myl-=gong/100;
cout<<endl<<"圣龙克了"<<gong/100<<"滴血";
if(myl>0)
{
cout<<endl<<"圣龙愤怒了!它夺走了99999滴血";
myl+=99999;
xue-=99999;
shaoshang=1;
zuzhou=1;
judu=1;
huimie=1;
if(shaoshang==1){
xue-=20;
}
if(zuzhou==1){
xue-=30;
}
if(judu==1){
xue-=10;
}
if(huimie==1){
xue-=90;
}
cout<<endl<<"圣龙还有"<<myl<<"滴血";
cout<<endl<<"你还有"<<xue<<"滴血";
}
else{
cout<<endl<<"圣龙挂菜!";
yaoshi=1;
}
}
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0){
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败圣龙,经验加999点!获得9999元";
cout<<endl<<"你获得了解开封印的钥匙";
jin+=999;
xue6=900;
money+=9999;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==6){
while(xue6>0)
{
cout<<endl<<"卫道士拿出一把大斧头!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
xue6-=gong;
cout<<endl<<"卫道士克了"<<gong<<"滴血";
if(xue6>0)
{
cout<<endl<<"卫道士还有"<<xue6<<"滴血";
cout<<endl<<"卫道士狠狠砍了你一斧!你克了300滴血";
xue-=300;
cout<<endl<<"你还有"<<xue<<"滴血";
}
else
cout<<endl<<"卫道士挂菜!";
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
if(xue<=0){
cout<<endl<<"你死了!";
return 0;
}
}
cout<<endl<<"打败卫道士,经验加300点!获得1500元";
jin+=300;
xue6=100;
money+=1500;
while(jin>=50){
jin-=50;
ji+=1;
cout<<endl<<name<<"升级!";
gong+=2;
xue+=20;
}
Sleep(200);
system("cls");
}
if(b==8){
cout<<"确定?(1/2)";
cin>>b;
if(yaoshi==0){
cout<<"你没有钥匙"<<endl;
continue;
}
if(b==1){
cout<<"天地间一声大响,Him出现了!"<<endl;
cout<<"“你就是Notch的传承人?!不堪一击!”";
while(hxue>0){
cout<<endl<<"Him冲了过来!";
cout<<endl<<"是否攻击/逃跑?(1/2)";
cin>>c;
if(c==1){
hxue-=gong;
cout<<endl<<"Him克了"<<gong<<"滴血";
if(hxue>0){
cout<<endl<<"Him还有"<<hxue<<"滴血";
cout<<endl<<"你被Him打中了!你克了500滴血";
xue-=500;
if(xue<=0){
cout<<endl<<"你死了!";
return 0;
}
else
cout<<endl<<"你还有"<<xue<<"滴血";
}
else
cout<<endl<<"Him死了!";
}
else if(c==2){
xue-=50;
cout<<endl<<"逃跑失败!克50滴血 ";
cout<<endl<<"你还有"<<xue<<"滴血";
}
}
cout<<endl<<"你击杀了Him,你成了大英雄!";
him+=1;
}
}
}
else if(a==2){
cout<<endl<<"你有"<<money<<"元";
cout<<endl<<"1--河豚10元(建议不要买) 2--治疗药水(瞬间治疗)30元 3--治疗药水(瞬间治疗2)50元 4--退出";
cin>>b;
if(b==1){
if(money>=10){
cout<<endl<<"不听帅哥言,吃亏在眼前!";
return 0;
}
else
cout<<endl<<"钱不够!";
}
if(b==2){
if(money>=30){
money-=30;
xue+=100;
cout<<endl<<"购买成功!血加一百滴";
cout<<endl<<"你还有"<<xue<<"滴血";
}
else
cout<<endl<<"钱不够!";
}
if(b==3){
if(money>=50){
money-=50;
xue+=200;
cout<<endl<<"购买成功!血加二百滴";
cout<<endl<<"你还有"<<xue<<"滴血";
}
else cout<<"钱不够!";
}
}
else if(a==3){
cout<<endl<<endl<<"血量"<<xue<<"滴"<<" 攻击"<<gong<<"点 ";
cout<<endl<<ji<<"级 "<<"还有"<<50-jin<<"点经验升级"<<" 还有"<<money<<"元"<<endl;
}
else
cout<<" 乱输个毛!";
}
if(app=="s"){
cout<<"只有你一个人,无法联机!";
return 0;
}
cout<<endl<<"你赢了!";
return 0;
}
资深天翼
#include<string>
#include<bits/stdc++.h>
#include<windows.h>
#include<ctime>
#include<cmath>
using namespace std;
int main(){
MessageBox(NULL,"欢迎使用由沈峻宇制作的坑爹游戏,祝您游戏愉快~","坑爹游戏",MB_OK);
cout<<"首先,第一关!";
Sleep(1000);
system("cls");
cout<<"“曦”怎么读?(输入拼音)(青铜题目)"<<endl;
string a;
cin>>a;
if(a=="xi"){
cout<<"你好棒棒哦";
Sleep(1000);
system("cls");
cout<<"第二关来了!";
Sleep(1000);
system("cls");
cout<<"宇宇宇宇宇宇宇宇字宇宇宇宇宇宇宇宇宇宇宇宇,哪个字不一样?(输入序号)(白银题目)"<<endl;
int b;
cin>>b;
if(b==9){
cout<<"哎呦,不错哦!";
Sleep(1000);
system("cls");
cout<<"第三关来了";
Sleep(1000);
system("cls");
cout<<"你的妈妈和爸爸同时掉在水里,距离一样,你先救谁(中文)(黄金段位题目)"<<endl;
string c;
cin>>c;
if(c=="爸爸"||c=="妈妈"){
cout<<"错了哦!应该就是“谁 ”您的段位:白银";
}
else if(c=="谁"){
cout<<"少年,你很牛!";
Sleep(1000);
system("cls");
cout<<"第四关来了";
Sleep(1000);
system("cls");
cout<<"你快渴死了,你现在面前有两杯水,一杯是毒药,一杯是尿,你喝什么?(中文)(铂金段位题目)"<<endl;
string d;
cin>>d;
if(d=="水"){
cout<<"对了!恭喜";
Sleep(1000);
system("cls");
cout<<"第五关来了";
Sleep(1000);
system("cls");
cout<<"你现在得知你的盘子里食物下了毒,但你又快饿死了,你会怎么样 1.吃掉 2.不吃,饿死 3.吃一点点 4.画画(钻石段位题目)"<<endl;
int e;
cin>>e;
if(e==4){
cout<<"不错啊!准备冲星耀吧!";
Sleep(1000);
system("cls");
cout<<"第六关来了";
Sleep(1000);
system("cls");
cout<<"你在考试,你发现你同桌在看字条,你会怎么办吗?(中文)(星耀)"<<endl;
string f;
cin>>f;
if(f=="跟他一块看"){
cout<<"你真心机!对了!";
cout<<"第七关来了";
Sleep(1000);
system("cls");
cout<<"作者是谁?(中文)(无敌战神)"<<endl;
string g;
cin>>g;
if(g=="帅哥"){
cout<<"您成功了,通关了!";
system("cls");
for(int i=1;i<=100;i++){
cout<<(char)574;
}
}
else{
cout<<"一步之遥,就能上战神了,唉……您的段位:星耀";
}
}
else{
cout<<"错了,应该是“跟他一块看,您的段位:钻石";
}
}
else{
cout<<"错了!答案是4!没听过画饼充饥吗?,您的段位:铂金";
}
}
else{
cout<<"错了,答案是水,题目都告诉你了,你面前有两杯水!您的段位:黄金";
}
}
}
else{
cout<<"笨蛋!答案是9 您的段位:青铜";
}
}
else{
cout<<"宾狗!错了,答案是xi";
}
}
随手编的小游戏
新手光能
#include<iostream>
#include<time.h>
#include<stdio.h>
#include <stdlib.h>
using namespace std;
struct pai
{
int paifu;
int huase;
int yanse;
int dianshu;
int leixing;
int changdu;
void Kanpai()
{
if(paifu==0||paifu==1);
else
printf("牌副参数错误!\n");
switch(huase)
{
case 0:cout<<"黑桃";break;
case 1:cout<<"红桃";break;
case 2:cout<<"草花";break;
case 3:cout<<"方片";break;
case -1:cout<<"无色";break;
default:printf("花色错误!\n");break;
}
switch(dianshu)
{
case 0:cout<<"A ";break;
case 1:cout<<"2 ";break;
case 2:cout<<"3 ";break;
case 3:cout<<"4 ";break;
case 4:cout<<"5 ";break;
case 5:cout<<"6 ";break;
case 6:cout<<"7 ";break;
case 7:cout<<"8 ";break;
case 8:cout<<"9 ";break;
case 9:cout<<"10 ";break;
case 10:cout<<"J ";break;
case 11:cout<<"Q ";break;
case 12:cout<<"K ";break;
case -1:cout<<"无点数";break;
default:printf("点数错误!\n");break;
}
switch(leixing)
{
case 101:cout<<"【杀】"<<endl;break;
case 102:cout<<"【闪】"<<endl;break;
case 103:cout<<"【桃】"<<endl;break;
case 201:cout<<"【过河拆桥】"<<endl;break;
case 202:cout<<"【顺手牵羊】"<<endl;break;
case 203:cout<<"【无中生有】"<<endl;break;
case 204:cout<<"【决斗】"<<endl;break;
case 205:cout<<"【借刀杀人】"<<endl;break;
case 206:cout<<"【桃园结义】"<<endl;break;
case 207:cout<<"【五谷丰登】"<<endl;break;
case 208:cout<<"【南蛮入侵】"<<endl;break;
case 209:cout<<"【万箭齐发】"<<endl;break;
case 210:cout<<"【无懈可击】"<<endl;break;
case 251:cout<<"【乐不思蜀】"<<endl;break;
case 252:cout<<"【闪电】"<<endl;break;
case 301:cout<<"【诸葛连弩(1)】"<<endl;break;
case 302:cout<<"【雌雄双股剑(2)】"<<endl;break;
case 303:cout<<"【青釭剑(2)】"<<endl;break;
case 304:cout<<"【青龙偃月刀(3)】"<<endl;break;
case 305:cout<<"【丈八蛇矛(3)】"<<endl;break;
case 306:cout<<"【贯石斧(3)】"<<endl;break;
case 307:cout<<"【方天画戟(4)】"<<endl;break;
case 308:cout<<"【麒麟弓(5)】"<<endl;break;
case 331:cout<<"【八卦阵】"<<endl;break;
case 361:cout<<"【赤兔(-1)】"<<endl;break;
case 362:cout<<"【大宛(-1)】"<<endl;break;
case 363:cout<<"【紫辛(-1)】"<<endl;break;
case 381:cout<<"【爪黄飞电(+1)】"<<endl;break;
case 382:cout<<"【的卢(+1)】"<<endl;break;
case 383:cout<<"【绝影(+1)】"<<endl;break;
default:printf("类型参数错误!");break;
}
}
};
void Qishixipai(pai A[2][4][13],pai paidui[104])
{
int i,m,x,y,z,a[104]={0};
srand((unsigned)time(NULL));
for(i=1;i<=104;i++)
{
while(a[m=rand()%104]);
a[m]=i;
}
for(i=0;i<=103;i++)
{
x=(a[i]-1)/52;
y=((a[i]-1)-52*x)/13;
z=(a[i]-1)%13;
paidui[i]=A[x][y][z];
}
}
void Xipai(pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int i,m,a[104]={0};
srand((unsigned)time(NULL));
for(i=1;i<=(*qipaishu);i++)
{
while(a[m=rand()%(*qipaishu)]);
a[m]=i;
}
for(i=0;i<=((*qipaishu)-1);i++)
{
paidui[i]=qipaidui[a[i]];
qipaidui[a[i]].leixing=-1;
(*paiduishu)++;
(*qipaishu)--;
}
for(i=(*paiduishu);i<=103;i++)paidui[i].leixing=-1;
}
pai Mo1pai(pai A[104],int *x,pai B[104],int*y,int *b)
{
pai p;
if((*x)==0)Xipai(A,x,B,y);
else if((*x)<0)printf("摸牌参数错误!");
else;
p=A[104-(*x)];
(*x)--;
(*b)++;
return(p);
}
struct wujiang
{
char name;
int tili;
int tilishangxian;
int shoupaishangxian;
int huihekaishi;
int panding;
int mopai;
int chupai;
int qipai;
int huihejieshu;
int juese;
pai shoupai[20];
int shoupaishu;
pai zhuangbei[4];
int zhuangbeishu;
pai pandingpai[3];
int pandingshu;
int juli[1];
void Kanshoupai()
{
printf("玩家当前手牌:\n");
if(shoupaishu)
{
int m;
for(m=0;m<=(shoupaishu-1);m++)
{
printf("%d ",m);
(shoupai[m]).Kanpai();
}
}
else printf("空城!\n");
printf("\n");
}
void Kanzhuangbei()
{
if(juese)printf("玩家");
else printf("电脑");
printf("当前装备:\n");
printf("0 武器: ");
if((zhuangbei[0]).leixing==-1)printf("空\n");
else (zhuangbei[0]).Kanpai();
printf("1 防具: ");
if((zhuangbei[1]).leixing==-1)printf("空\n");
else (zhuangbei[1]).Kanpai();
printf("2 进攻马: ");
if((zhuangbei[2]).leixing==-1)printf("空\n");
else (zhuangbei[2]).Kanpai();
printf("3 防御马: ");
if((zhuangbei[3]).leixing==-1)printf("空\n");
else (zhuangbei[3]).Kanpai();
printf("\n");
}
void Kanpandingpai()
{
if(juese)printf("玩家");
else printf("电脑");
printf("当前判定区:\n");
if((pandingpai[0]).leixing==-1)printf("空\n");
else
{
printf("0 ");
(pandingpai[0]).Kanpai();
if((pandingpai[1]).leixing==-1);
else
{
printf("1 ");
(pandingpai[1]).Kanpai();
if((pandingpai[2]).leixing==-1);
else
{
printf("2 ");
(pandingpai[2]).Kanpai();
}
}
}
}
};
void Mopai(int*shoupaishu,pai shoupai[20],pai A[104],int *x,pai B[104],int*y,int juese)
{
if(juese)printf("玩家从牌堆摸2张牌\n");
else printf("电脑从牌堆摸2张牌\n");
pai p;
p=Mo1pai(A,x,B,y,shoupaishu);
shoupai[*shoupaishu-1]=p;
pai q;
q=Mo1pai(A,x,B,y,shoupaishu);
shoupai[*shoupaishu-1]=q;
int m;
if(juese)
{
printf("玩家当前手牌:\n");
for(m=0;m<=(*shoupaishu-1);m++)
{
printf("%d ",m);
(shoupai[m]).Kanpai();
}
}
printf("牌堆还剩%d张牌!\n\n",*x);
}
void Qishishoupai(wujiang *w,pai A[104],int *x,pai B[104],int*y)
{
pai a;
a=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=a;
pai b;
b=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=b;
pai c;
c=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=c;
pai d;
d=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=d;
int m;
if((*w).juese)printf("玩家从牌堆摸4张牌\n");
else printf("电脑从牌堆摸4张牌\n");
if((*w).juese)
{
printf("玩家当前手牌:\n");
for(m=0;m<=((*w).shoupaishu-1);m++)
{
printf("%d ",m);
((*w).shoupai[m]).Kanpai();
}
}
printf("牌堆还剩%d张牌!\n\n",*x);
}
void Panding(pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
paidui[*paiduishu].Kanpai();
qipaidui[*qipaishu]=paidui[*paiduishu];
(*paiduishu)--;
(*qipaishu)++;
}
pai Zhangba(wujiang*w,pai qipaidui[104],int*qipaishu)
{
int x,y;
pai p;
for(;;)
{
int i,j;
printf("请输入任意两张手牌之前的编号,以空格隔开,以回车结束!\n");
scanf("%d",&x);
scanf("%d",&y);
if((x>=0)&&(x<(*w).shoupaishu)&&(y>=0)&&(y<(*w).shoupaishu-1))
{
switch((((*w).shoupai[x].huase)%2)+(((*w).shoupai[y].huase)%2))
{
case 0:p.yanse=0;break;
case 2:p.yanse=1;break;
case 1:p.yanse=2;break;
default:printf("【丈八蛇矛】函数参数错误!\n");
}
qipaidui[*qipaishu]=(*w).shoupai[x];
(*w).shoupai[x].leixing=-1;
((*w).shoupaishu)--;
(*qipaishu)++;
qipaidui[*qipaishu]=(*w).shoupai[y];
(*w).shoupai[y].leixing=-1;
((*w).shoupaishu)--;
(*qipaishu)++; printf("弃牌数:%d",*qipaishu);
for(i=0;i<=(((*w).shoupaishu)+1);i++)
{
if((*w).shoupai[i].leixing==-1)
{
for(j=i+1;j<=(((*w).shoupaishu)+2);j++)
(*w).shoupai[j-1]=(*w).shoupai[j];
i--;
}
}
printf("玩家把:\n");
qipaidui[(*qipaishu)-2].Kanpai();
qipaidui[(*qipaishu)-1].Kanpai();
printf("当作一张");
switch(p.yanse)
{
case 0:printf("黑色");break;
case 2:printf("红色");break;
case 1:printf("无色");break;
default:printf("绿色");break;
}
printf("无点数的【杀】");
p.dianshu=-1;
p.leixing=101;
return p;
break;
}
printf("你将两张空气当作一张空气属性的【杀】使用或打出!\n");
}
}
int Xuanpai(wujiang*w,int t)
{
int x;
if((*w).juese)
{
for(;;)
{
printf("出牌请输入手牌之前的编号,以回车结束!\n如果你想结束出牌阶段,请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if((x>=-1&&x<((*w).shoupaishu))||((x==100)&&((*w).zhuangbei[0].leixing==305)))
{
return x;
break;
}
printf("你打出了一张空气!\n");
}
}
else return t;
}
pai Panpai(wujiang*w1,int*sha,int y,pai qipaidui[104],int*qipaishu)
{
pai p,q;
p.leixing=0;
q.leixing=-1;
if(y==-1)return q;
else
{
if(y==100)
{
if((*sha)>0)
{
q=Zhangba(w1,qipaidui,qipaishu);
printf("使用!\n");
return q;
}
else
{
printf("当前回合使用【杀】的次数已用尽,你也不能使用【丈八蛇矛】效果!\n");
return p;
}
}
switch((*w1).shoupai[y].leixing)
{
case 101:
if(((*sha)>0)||((*w1).zhuangbei[0].leixing==301))
{
if(((*w1).zhuangbei[0].leixing==301))printf("武器【诸葛连弩】效果被触发!\n");
return (*w1).shoupai[y];
break;
}
else
{
if((*w1).juese)printf("当前回合使用【杀】的次数已用尽,你不能使用【杀】!\n");
return p;break;
}
case 102:
if((*w1).juese)
printf("当前不需要响应任何操作,你不能主动打出【闪】!\n");
return p;break;
case 103:
if(((*w1).tili)<((*w1).tilishangxian))
{
return (*w1).shoupai[y];
break;
}
else
{
if((*w1).juese)
printf("你并未受伤,不能对自己使用【桃】!\n");
}
return p;break;
case 210:
if((*w1).juese)
printf("当前不需要响应任何锦囊,你不能主动打出【无懈可击】!\n");
return p;break;
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 207:
case 208:
case 209:
case 251:
case 252:
case 301:
case 302:
case 303:
case 304:
case 305:
case 306:
case 307:
case 308:
case 331:
case 361:
case 362:
case 363:
case 381:
case 382:
case 383:return (*w1).shoupai[y];break;
default:printf("手牌类型参数错误!\n");return p;break;
}
}
}
int Mubiao(pai p,wujiang *w1,wujiang *w2,int*sha)
{
int x;
switch(p.leixing)
{
case 101:
if((*w1).juese)
{
printf("请选择【杀】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
if((*w1).zhuangbei[0].changdu>=(*w1).juli[0])
{
(*sha)--;
return((*w2).juese);
}
else
{
printf("武器长度不够!\n");
return -2;
}
}
else
{
printf("目标错误!\n");
return -2;
}
}
else
{
if((*w1).zhuangbei[0].changdu>=(*w1).juli[0])
{
(*sha)--;
return((*w2).juese);
}
else return -2;
}
break;
case 103:return((*w1).juese);break;
case 201:
if((*w1).juese)
{
printf("请选择【过河拆桥】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
if((*w2).shoupaishu||(*w2).zhuangbeishu||(*w2).pandingshu)return((*w2).juese);
else
{
printf("目标没有牌!\n");
return -2;
}
}
else
{
printf("目标错误!\n");
return -2;
}
}
else return((*w2).juese);
break;
case 202:
if((*w1).juese)
{
printf("请选择【顺手牵羊】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
if(((*w2).shoupaishu||(*w2).zhuangbeishu||(*w2).pandingshu)&&((*w1).juli[0]<=1))return((*w2).juese);
else
{
printf("目标没有牌!\n");
return -2;
}
}
else
{
printf("目标错误!\n");
return -2;
}
}
else
{
if((*w1).juli[0]<=1)return((*w2).juese);
else return -2;
}
break;
case 203:
return((*w1).juese);break;
case 204:
if((*w1).juese)
{
printf("请选择【决斗】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)return((*w2).juese);
else
{
printf("目标错误!\n");
return -2;
}
}
else return((*w2).juese);
break;
case 205:
int y;
if((*w1).juese)
{
printf("请选择【借刀杀人】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x!=0)
{
printf("目标错误!\n");
return -2;
}
else
{
if(((*w2).zhuangbei[0]).leixing<=300||((*w2).zhuangbei[0]).leixing>=331)
{
printf("目标装备区里没有武器!\n");
return -2;
}
else
{
printf("请选择【杀】的目标!\n提示:【杀】的目标必须在【借刀杀人】的目标的攻击范围之内!\n输入目标前的编号,以回车结束!\n0 玩家\n");
scanf("%d",&y);
if(y!=0)
{
printf("目标错误!\n");
return -2;
}
else
{
if(((*w2).zhuangbei[0].changdu)<(*w2).juli[0])
{
printf("武器距离不够!\n");
return -2;
}
else
return((*w2).juese);
}
}
}
}
else
{
if(((*w2).zhuangbei[0]).leixing<=300||((*w2).zhuangbei[0]).leixing>=331)return -2;
else
{
if(((*w2).zhuangbei[0].changdu)<(*w2).juli[0])return -2;
else return((*w2).juese);
}
}
break;
case 206:
case 207:return 99;break;
case 208:
case 209:return 100;break;
case 251:
if((*w1).juese)
{
printf("请选择【乐不思蜀】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
int i;
for(i=0;i<=2;i++)
{
if((*w2).pandingpai[i].leixing==251)
i=-1;
break;
}
if(i==-1)
{
printf("目标判定区里不能同时存在两张相同的延时类锦囊!\n");
return -2;
}
else return((*w2).juese);
}
else
{
printf("目标错误!\n");
return -2;
}
}
else
{
int i;
for(i=0;i<=2;i++)
{
if((*w2).pandingpai[i].leixing==251)
i=-1;
break;
}
if(i==-1)return -2;
else return((*w2).juese);
}
break;
case 252:
int i;
for(i=0;i<=2;i++)
{
if((*w1).pandingpai[i].leixing==252)
i=-1;
break;
}
if(i==-1)
{
if((*w1).juese)printf("目标判定区里不能同时存在两张相同的延时类锦囊!\n");
return -2;
}
else return ((*w1).juese);
break;
case 301:
case 302:
case 303:
case 304:
case 305:
case 306:
case 307:
case 308:
case 331:
case 361:
case 362:
case 363:
case 381:
case 382:
case 383:return((*w1).juese);break;
default:return -2;break;
}
}
void Da1pai(wujiang *w1,wujiang*w2,pai qipaidui[104],int *qipaishu,int x)
{
int i;
if((x<0||x>=((*w1).shoupaishu))&&x!=100)
printf("你的牌呢?!\n");
else
{
switch(((*w1).shoupai)[x].leixing)
{
case 101:
case 102:
case 103:
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 207:
case 208:
case 209:
case 210:
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
break;
case 251:
for(i=1;i>=0;i--)(*w2).pandingpai[i+1]=(*w2).pandingpai[i];
(*w2).pandingpai[0]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
((*w2).pandingshu)++;
break;
case 252:
for(i=1;i>=0;i--)(*w1).pandingpai[i+1]=(*w1).pandingpai[i];
(*w1).pandingpai[0]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
((*w1).pandingshu)++;
break;
case 301:
case 302:
case 303:
case 304:
case 305:
case 306:
case 307:
case 308:
if((*w1).zhuangbei[0].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[0];
(*qipaishu)++;
}
(*w1).zhuangbei[0]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
case 331:
if((*w1).zhuangbei[1].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[1];
(*qipaishu)++;
}
(*w1).zhuangbei[1]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
case 361:
case 362:
case 363:
if((*w1).zhuangbei[2].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[2];
(*qipaishu)++;
}
(*w1).zhuangbei[2]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
case 381:
case 382:
case 383:
if((*w1).zhuangbei[3].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[3];
(*qipaishu)++;
}
(*w1).zhuangbei[3]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
default:break;
}
}
}
void Miaoshu(pai p,int juese,int duixiang)
{
if(juese==0)printf("电脑");
else if(juese==1)printf("玩家");
else printf("角色参数错误!\n");
if(p.leixing<=300&&p.leixing>100)
{
switch(duixiang)
{
case -1:printf("打出");break;
case 0:printf("对电脑使用");break;
case 1:printf("对玩家使用");break;
case 99:printf("使用");break;
case 100:printf("对所有人使用");break;
default:printf("对象参数错误\n");break;
}
}
else if(p.leixing>=301&&p.leixing<=400)
printf("装备");
else printf("你出的是什么东西?\n");
p.Kanpai();
if(!juese&&(p.leixing==101||p.leixing==204||p.leixing==205||p.leixing==207||p.leixing==208||p.leixing==209))printf("请响应!\n");
}
int Wuxie(pai *p,wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu,int a)
{
int x;
if((*w1).juese)
{
printf("是否使用【无懈可击】响应?\n\n");
for(;;)
{
(*w1).Kanshoupai();
printf("如果要使用【无懈可击】请输入手牌之前编号,不需要请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if(x==-1)
{
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==210)
{
printf("电脑使用");
((*w2).shoupai)[x].Kanpai();
printf("对象是");
(*p).Kanpai();
(*p)=((*w2).shoupai)[x];
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
a++;
break;
}
}
break;
}
else if((*w1).shoupai[x].leixing==210)
{
printf("玩家使用");
((*w1).shoupai)[x].Kanpai();
printf("对象是");
(*p).Kanpai();
(*p)=((*w1).shoupai)[x];
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(int i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
(*w1).Kanshoupai();
a++;
break;
}
else printf("你确定你使用的是【无懈可击】?\n");
}
}
else
{
printf("是否使用【无懈可击】响应?\n");
for(;;)
{
(*w2).Kanshoupai();
printf("如果要使用【无懈可击】请输入手牌之前编号,不需要请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if(x==-1)break;
else if((*w2).shoupai[x].leixing==210)
{
printf("玩家使用");
((*w2).shoupai)[x].Kanpai();
printf("对象是");
(*p).Kanpai();
(*p)=((*w2).shoupai)[x];
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
(*w2).Kanshoupai();
a++;
break;
}
else printf("你确定你使用的是【无懈可击】?\n");
}
}
return a;
}
int Qiutao(wujiang*w,pai qipaidui[104],int*qipaishu)
{
int x;
if((*w).juese)
{
for(;;)
{
printf("如果要使用【桃】请输入手牌之前的编号,不需要请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if(x==-1)
{
return -1;
break;
}
else if((*w).shoupai[x].leixing==103)
{
qipaidui[*qipaishu]=((*w).shoupai)[x];
for(int i=x+1;i<=((*w).shoupaishu);i++)((*w).shoupai)[i-1]=((*w).shoupai)[i];
((*w).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
else printf("你确定你使用的是【桃】?\n");
}
}
else
{
for(x=0;x<((*w).shoupaishu);x++)
{
if((*w).shoupai[x].leixing==103)
{
qipaidui[*qipaishu]=((*w).shoupai)[x];
for(int i=x+1;i<=((*w).shoupaishu);i++)((*w).shoupai)[i-1]=((*w).shoupai)[i];
((*w).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
}
return -1;
}
}
int Binsi(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
if(((*w2).tili)>0)return 0;
else
{
int i;
if((*w1).juese)
{
for(;;)
{
printf("电脑濒死,是否使用【桃】?\n");
i=Qiutao(w1,qipaidui,qipaishu);
if(i==0)((*w2).tili)++;
if((i==-1)||((*w2).tili>0))break;
}
if((*w2).tili>0)return 0;
else
{
for(;;)
{
i=Qiutao(w2,qipaidui,qipaishu);
if(i==0)((*w2).tili)++;
if((i==-1)||((*w2).tili>0))break;
}
if((*w2).tili>0)return 0;
else return -1;
}
}
else
{
for(;;)
{
printf("玩家濒死,是否使用【桃】?\n");
i=Qiutao(w2,qipaidui,qipaishu);
if(i==0)((*w2).tili)++;
if((i==-1)||((*w2).tili>0))break;
}
if((*w2).tili>0)return 0;
else return -1;
}
}
}
int Shan(wujiang*w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int x;
if((*w2).juese)
{
if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing!=303))
{
for(;;)
{
int m;
printf("是否发动【八卦阵】防具效果?\n0 否\n1 是\n请输入选项之前的编号,以回车结束!\n");
scanf("%d",&m);
if(m==1)
{
Panding(paidui,paiduishu,qipaidui,qipaishu);
if(qipaidui[(*qipaishu)-1].huase%2)
{
printf("【八卦阵】判定成功!\n");
return 0;
}
}
else if(m==0)
{
printf("【八卦阵】判定失败!\n");
break;
}
else printf("你确定你输入的是“0”或“1”?\n");
}
}
else if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing==303))printf("【青釭剑】锁定技被触发!\n");
for(;;)
{
printf("请输入手牌之前的编号,或者输入“-1”放弃打出【闪】,以回车结束!\n");
scanf("%d",&x);
if(x==-1)
{
return -1;
break;
}
else if((*w2).shoupai[x].leixing==102)
{
printf("玩家打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
else printf("你确定你打出的是【闪】?\n");
}
}
else
{
if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing!=303))
{
Panding(paidui,paiduishu,qipaidui,qipaishu);
if(qipaidui[(*qipaishu)-1].huase%2)
{
printf("【八卦阵】判定成功!\n");
return 0;
}
else printf("【八卦阵】判定失败!\n");
}
else if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing==303))printf("【青釭剑】锁定技被触发!\n");
int i;
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==102)
{
printf("电脑打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
}
return -1;
}
}
int Sha(wujiang *w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int x;
if((*w2).juese)
{
printf("请打出【闪】响应【杀】!否则你将受到1点伤害!\n");
x=Shan(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(x==-1)
{
int i;
((*w2).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else if(x==0&&((*w1).zhuangbei[0].leixing==306))
{
int i;
if(((*w1).shoupaishu)>=2)
{
printf("电脑弃掉:\n");
((*w1).shoupai)[0].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[0];
for(i=1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
((*w1).shoupai)[0].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[0];
for(i=1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
printf("发动【贯石斧】武器效果使【杀】造成伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else return 0;
}
else if(x==0&&((*w1).zhuangbei[0].leixing==304))
{
int i;
for(x=0;x<((*w1).shoupaishu);x++)
{
if((*w1).shoupai[x].leixing==101)
{
printf("电脑发动【青龙偃月刀】效果对玩家使用");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
i=Sha(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
return i;
break;
}
}
return 0;
}
}
else
{
x=Shan(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(x==-1)
{
if((*w1).zhuangbei[0].leixing==308)
{
for(;;)
{
printf("是否发动【麒麟弓】武器效果?\n0 否\n1 是\n");
scanf("%d",&x);
if(x==1)
{
if(((*w2).zhuangbei[2].leixing==-1)&&((*w2).zhuangbei[3].leixing==-1))
{
printf("电脑根本没有马,射你妹的马啊!\n");
break;
}
else
{
for(;;)
{
printf("0 ");
((*w2).zhuangbei[2]).Kanpai();
printf("1 ");
((*w2).zhuangbei[3]).Kanpai();
printf("请选择要弃掉的马,输入之前的编号,以回车结束!\n");
scanf("%d",&x);
if((x==0)&&((*w2).zhuangbei[2].leixing!=-1))
{
printf("你弃掉了电脑的");
((*w2).zhuangbei)[2].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[2];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[2].leixing=-1;
((*w2).juli[0])++;
break;
}
else if((x==1)&&((*w2).zhuangbei[3].leixing!=-1))
{
printf("你弃掉了电脑的");
((*w2).zhuangbei)[3].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[3];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[3].leixing=-1;
((*w1).juli[0])--;
break;
}
else printf("射你妹的马!");
}
break;
}
}
else if(x==0)break;
else printf("键盘上的“0”和“1”被你吃了吗?\n");
}
}
int i;
((*w2).tili)--;
printf("玩家对电脑造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else if(x==0&&((*w1).zhuangbei[0].leixing==306))
{
for(;;)
{
printf("是否发动【贯石斧】武器效果?\n0 否\n1 是\n");
scanf("%d",&x);
if(x==1)
{
int i;
if((*w1).shoupaishu+(*w1).zhuangbeishu<=2)
{
printf("你除了【贯石斧】以外连2张牌都没有,发动你妹的效果!\n");
break;
}
else
{
printf("请分别弃掉两张牌!\n");
for(i=0;i<=2;i++)
{
for(;;)
{
printf("请选择区域:\n0 手牌\n1 装备\n");
scanf("%d",&x);
if(x==0&&((*w1).shoupaishu==0))printf("你根本没有手牌,弃你妹啊!\n");
else if(x==1&&((*w1).zhuangbeishu==1))printf("你根本没有别的装备,弃你妹啊!\n");
else if(x>=0&&x<=1)break;
else printf("键盘上的“0”和“1”被你吃了吗?\n");
}
if(x==0)
{
for(;;)
{
(*w1).Kanshoupai();
printf("弃牌请输入手牌之前的编号,以回车结束!\n");
scanf("%d",&x);
if(x>=0&&x<((*w1).shoupaishu))break;
else printf("弃你妹的手牌!\n");
}
printf("你弃掉了");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
}
else
{
for(;;)
{
(*w1).Kanzhuangbei();
printf("请输入装备之前的编号,以回车键结束!\n");
scanf("%d",&x);
if((((*w1).zhuangbei[x]).leixing!=-1)&&(x>=0)&&(x<=3))
{
printf("你弃掉了");
((*w1).zhuangbei)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).zhuangbei)[x];
((*w1).zhuangbeishu)--;
(*qipaishu)++;
((*w1).zhuangbei)[x].leixing=-1;
break;
}
else printf("弃你妹的装备!\n");
}
}
}
}
printf("玩家发动【贯石斧】武器效果使【杀】造成伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
else if(x==0)break;
else printf("键盘上的“0”和“1”被你吃了吗?\n");
}
}
else if(x==0&&((*w1).zhuangbei[0].leixing==304))
{
for(;;)
{
printf("是否发动【青龙偃月刀】武器效果?\n0 否\n1 是\n");
scanf("%d",&x);
if(x==1)
{
for(;;)
{
printf("请对电脑使用一张【杀】!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
(*w1).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
return 0;
break;
}
else if((*w1).shoupai[x].leixing==101)
{
int i;
printf("玩家对电脑使用");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
i=Sha(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
return i;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
}
else if(x==0)
{
return 0;
break;
}
else printf("你确定你输入的是“0”或“1”?\n");
}
}
else return 0;
}
return 0;
}
void Tao(wujiang*w1)
{
((*w1).tili)++;
if((*w1).juese)printf("玩家");
else printf("电脑");
printf("恢复了1点体力!\n");
if(((*w1).tili)>((*w1).tilishangxian))printf("你被撑死了!\n");
}
void Chai(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
int i,x,y;
if((*w1).juese)
{
for(;;)
{
if((*w2).shoupaishu+(*w2).zhuangbeishu+(*w2).pandingshu==0)
{
printf("对方空城,拆你妹啊!\n");
break;
}
else
{
printf("请选择想拆的区域,输入选项之前的编号,以回车结束!\n0 手牌\n1 装备区\n2 判定区\n");
scanf("%d",&x);
if(x==0&&((*w2).shoupaishu==0))printf("你拆掉了一张空气!\n");
else if(x==1&&((*w2).zhuangbeishu==0))printf("你拆掉了一张空气!\n");
else if(x==2&&((*w2).pandingshu==0))printf("你拆掉了一张空气!\n");
else if(x>=0&&x<=2)break;
else printf("你拆掉了太空区里的一张牌!\n");
}
}
switch(x)
{
case 0:
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("你弃掉了电脑的");
((*w2).shoupai)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
break;
case 1:
for(;;)
{
(*w2).Kanzhuangbei();
printf("请输入装备之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((((*w2).zhuangbei[y]).leixing!=-1)&&(y>=0)&&(y<=3))
{
printf("你弃掉了电脑的");
((*w2).zhuangbei)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[y];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[y].leixing=-1;
if(!y)((*w2).zhuangbei)[y].changdu=1;
else if(y==2)((*w2).juli[0])++;
else if(y==3)((*w1).juli[0])--;
break;
}
else printf("你弃掉了一张空气!\n");
}
break;
case 2:
for(;;)
{
(*w2).Kanpandingpai();
printf("请输入判定牌之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((*w2).pandingpai[y].leixing!=-1)
{
printf("你弃掉了电脑的");
((*w2).pandingpai)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).pandingpai)[y];
((*w2).pandingshu)--;
(*qipaishu)++;
((*w2).pandingpai)[y].leixing=-1;
break;
}
else printf("你弃掉了一张空气!\n");
}
break;
default:break;
}
}
else
{
if((*w2).zhuangbeishu)
{
if((*w2).zhuangbei[1].leixing!=-1)
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[1].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[1];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[1].leixing=-1;
}
else if((*w2).zhuangbei[3].leixing!=-1)
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[3].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[3];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[3].leixing=-1;
((*w1).juli[0])--;
}
else if((*w2).zhuangbei[0].leixing!=-1)
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[0].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
}
else
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[2].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[2];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[2].leixing=-1;
((*w2).juli[0])++;
}
}
else
{
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("电脑弃掉了玩家的手牌");
((*w2).shoupai)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
}
}
}
void Qian(wujiang *w1,wujiang *w2)
{
int i,x,y;
if((*w1).juese)
{
for(;;)
{
if((*w2).shoupaishu+(*w2).zhuangbeishu+(*w2).pandingshu==0)
{
printf("对方空城啦!你牵走了一张寂寞!\n");
break;
}
else
{
printf("请选择想牵的区域,输入选项之前的编号,以回车结束!\n0 手牌\n1 装备区\n2 判定区\n");
scanf("%d",&x);
if(x==0&&((*w2).shoupaishu==0))printf("你牵走了一张空气!\n");
else if(x==1&&((*w2).zhuangbeishu==0))printf("你牵走了一张空气!\n");
else if(x==2&&((*w2).pandingshu==0))printf("你牵走了一张空气!\n");
else if(x>=0&&x<=2)break;
else printf("你牵走了太空区里的一张牌!\n");
}
}
switch(x)
{
case 0:
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("你牵走了电脑的");
((*w2).shoupai)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
((*w1).shoupaishu)++;
break;
case 1:
for(;;)
{
(*w2).Kanzhuangbei();
printf("请输入装备之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((((*w2).zhuangbei[y]).leixing!=-1)&&(y>=0)&&(y<=3))
{
printf("你牵走了电脑的");
((*w2).zhuangbei)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[y];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[y].leixing=-1;
if(!y)((*w2).zhuangbei[y]).changdu=1;
else if(y==2)((*w2).juli[0])++;
else if(y==3)((*w1).juli[0])--;
break;
}
else printf("你弃掉了一张空气!\n");
}
break;
case 2:
for(;;)
{
(*w2).Kanpandingpai();
printf("请输入判定牌之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((*w2).pandingpai[y].leixing!=-1)
{
printf("你牵走了电脑的");
((*w2).pandingpai)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).pandingpai)[y];
((*w2).pandingshu)--;
((*w1).shoupaishu)++;
((*w2).pandingpai)[y].leixing=-1;
break;
}
else printf("你牵走了一张空气!\n");
}
break;
default:break;
}
}
else
{
if((*w2).zhuangbeishu)
{
if((*w2).zhuangbei[1].leixing!=-1)
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[1].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[1];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[1].leixing=-1;
}
else if((*w2).zhuangbei[3].leixing!=-1)
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[3].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[3];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[3].leixing=-1;
((*w1).juli[0])--;
}
else if((*w2).zhuangbei[0].leixing!=-1)
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[0].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
}
else
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[2].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[2];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[2].leixing=-1;
((*w2).juli[0])--;
}
}
else
{
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("电脑牵走了玩家的手牌");
((*w2).shoupai)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
((*w1).shoupaishu)++;
}
}
}
void Wuzhong(wujiang*w1,pai A[104],int *x,pai B[104],int*y)
{
Mopai(&((*w1).shoupaishu),(*w1).shoupai,A,x,B,y,(*w1).juese);
}
int Juedou(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
int i,j,x;
if((*w1).juese)
{
for(;;)
{
j=0;
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==101)
{
printf("电脑打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
}
if(!j)
{
printf("玩家对电脑造成1点伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
j=0;
for(;;)
{
printf("请打出一张【杀】响应【决斗】,否则你将受到1点伤害!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w1).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w1).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
int i;
((*w1).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w2,w1,qipaidui,qipaishu);
return i;
break;
}
else if(((*w1).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w1,qipaidui,qipaishu);
p.paifu=-1;
printf("打出!\n");
j=1;
break;
}
else if((*w1).shoupai[x].leixing==101)
{
printf("玩家打出");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
}
}
else
{
for(;;)
{
j=0;
for(;;)
{
printf("请打出一张【杀】响应【决斗】,否则你将受到1点伤害!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w1).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w2).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
int i;
((*w2).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
else if(((*w2).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w2,qipaidui,qipaishu);
p.paifu=-1;
printf("打出!\n");
j=1;
break;
}
else if((*w2).shoupai[x].leixing==101)
{
printf("玩家打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
j=0;
for(x=0;x<((*w1).shoupaishu);x++)
{
if((*w1).shoupai[x].leixing==101)
{
printf("电脑打出");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(int i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
}
if(!j)
{
printf("玩家对电脑造成1点伤害!\n");
((*w2).tili)--;
i=Binsi(w2,w1,qipaidui,qipaishu);
return i;
break;
}
}
}
}
int Jiedao(wujiang*w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int i,j=0,x;
if((*w1).juese)
{
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==101)
{
printf("电脑对玩家使用");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
}
if(j)
{
i=Sha(w2,w1,paidui,paiduishu,qipaidui,qipaishu);
return i;
printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
}
else
{
printf("电脑放弃使用【杀】,玩家获得电脑的武器");
(*w2).zhuangbei[0].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
(*w1).Kanshoupai();
return 0;
}
}
else
{
for(;;)
{
printf("请对电脑使用一张【杀】,否则电脑将获得你的武器!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w2).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w2).Kanshoupai();
scanf("%d",&x);
if(x==-1)break;
else if(((*w2).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w2,qipaidui,qipaishu);
p.paifu=-1;
printf("使用!\n");
j=1;
break;
}
else if((*w2).shoupai[x].leixing==101)
{
printf("玩家对电脑使用");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
else printf("你确定你使用的是【杀】?\n");
}
if(j)
{
i=Sha(w2,w1,paidui,paiduishu,qipaidui,qipaishu);
return i;
printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
else
{
printf("玩家放弃使用【杀】,电脑获得玩家的武器");
((*w2).zhuangbei)[0].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
return 0;
}
}
}
void Taoyuan(wujiang*w)
{
if((*w).tili<(*w).tilishangxian)
{
((*w).tili)++;
if((*w).juese)printf("玩家");
else printf("电脑");
printf("恢复1点体力!\n");
}
}
void Kaipai(pai paidui[104],int* paiduishu,int renshu,pai wugu[10])
{
int i;
printf("五谷丰登开牌:\n");
for(i=1;i<=renshu;i++)
{
wugu[i-1]=paidui[104-(*paiduishu)];
(*paiduishu)--;
printf("%d ",i-1);
wugu[i-1].Kanpai();
}
}
void Qupai(pai wugu[10],wujiang*w)
{
int i,x;
printf("五谷丰登开牌:\n");
for(i=0;(wugu[i].leixing)!=-1;i++)
{
printf("%d ",i);
wugu[i].Kanpai();
}
if((*w).juese)
{
for(;;)
{
printf("请选择你想要的卡牌,输入卡牌之前的编号,以回车结束!\n");
scanf("%d",&x);
if(wugu[x].leixing!=-1)
{
printf("玩家选择");
wugu[x].Kanpai();
(*w).shoupai[(*w).shoupaishu]=wugu[x];
((*w).shoupaishu)++;
for(i=x+1;i<=9;i++)wugu[i-1]=wugu[i];
wugu[9].leixing=-1;
break;
}
printf("你选择了一张空气加入手牌!");
}
}
else
{
printf("电脑选择");
wugu[0].Kanpai();
(*w).shoupai[(*w).shoupaishu]=wugu[0];
((*w).shoupaishu)++;
for(i=1;i<=9;i++)wugu[i-1]=wugu[i];
wugu[9].leixing=-1;
}
}
void Rengpai(pai wugu[10],pai qipaidui[104],int*qipaishu)
{
int i;
for(i=0;wugu[i].leixing!=-1;i++)
{
qipaidui[*qipaishu]=wugu[i];
(*qipaishu)++;
wugu[i].leixing=-1;
}
}
int Nanman(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
int i,x;
if((*w1).juese)
{
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==101)
{
printf("电脑打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
}
printf("玩家对电脑造成1点伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else
{
for(;;)
{
printf("请打出一张【杀】响应【南蛮入侵】,否则你将受到1点伤害!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w2).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w2).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
int i;
((*w2).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
else if(((*w2).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w2,qipaidui,qipaishu);
p.paifu=-1;
printf("使用!\n");
return 0;
break;
}
else if((*w2).shoupai[x].leixing==101)
{
printf("玩家打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
}
}
int Wanjian(wujiang*w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int i;
i=Shan(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1)
{
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else return 0;
}
int Chupai(pai paidui[104],pai qipaidui[104],int *paiduishu,int*qipaishu,wujiang*w1,wujiang*w2,pai yuanshipaidui[2][4][13])
{
pai p1;
int sha=1;int y=-1,i,t=((*w1).shoupaishu)-1;
for(;;t--)
{
if((*w1).juese)
{
printf("\n电脑当前手牌数:%d\n",((*w2).shoupaishu));
(*w2).Kanzhuangbei();
(*w1).Kanshoupai();
(*w1).Kanzhuangbei();
}
int j=0;
if((*w1).juese&&((*w1).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
y=Xuanpai(w1,t);
p1=Panpai(w1,&sha,y,qipaidui,qipaishu);
if((p1).leixing==-1)break;
else if((p1).leixing==0)continue;
else
{
int duixiang;
duixiang=Mubiao(p1,w1,w2,&sha);
if(duixiang==-2)continue;
else
{
Da1pai(w1,w2,qipaidui,qipaishu,y);
Miaoshu(p1,((*w1).juese),duixiang);
if(!((*w1).juese))
{
printf("\n电脑当前手牌数:%d\n",((*w1).shoupaishu));
(*w1).Kanzhuangbei();
(*w2).Kanshoupai();
(*w2).Kanzhuangbei();
}
switch(p1.leixing)
{
case 101:
i=Sha(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1){return -1;break;}
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
break;
case 103:
Tao(w1);
break;
case 201:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Chai(w1,w2,qipaidui,qipaishu);
else;
if((*w1).juese)(*w1).Kanshoupai();
break;
case 202:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Qian(w1,w2);
else;
if((*w1).juese)(*w1).Kanshoupai();
break;
case 203:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Wuzhong(w1,paidui,paiduishu,qipaidui,qipaishu);
else;
break;
case 204:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Juedou(w1,w2,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 205:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Jiedao(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 206:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Taoyuan(w1);
j=0;
for(;;)
{
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Taoyuan(w2);
break;
case 207:
pai wugu[10];
for(i=1;i<=10;i++)wugu[i-1].leixing=-1;
Kaipai(paidui,paiduishu,2,wugu);
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Qupai(wugu,w1);
for(;;)
{
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Qupai(wugu,w2);
Rengpai(wugu,qipaidui,qipaishu); printf("弃牌数:%d\n",*qipaishu);
break;
case 208:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Nanman(w1,w2,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 209:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Wanjian(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 361:
case 362:
case 363:
((*w1).juli[0])--;break;
case 381:
case 382:
case 383:
((*w2).juli[0])++;break;
default:break;
}
printf("\n");
}
}
}
return 0;
}
void Qipai(pai shoupai[20],int *shoupaishu,pai qipaidui[104],int *qipaishu,int juese,int *shoupaishangxian)
{
int x;
if((*shoupaishu)>(*shoupaishangxian))
{
if(juese!=1&&juese!=0)printf("身份参数错误!");
int q=(*shoupaishu)-(*shoupaishangxian);
int i,j;
for(j=1;j<=q;j++)
{
for(;;)
{
if(juese)
{
printf("弃牌请输入手牌之前的编号,以回车结束!\n注:一次只能弃一张牌\n");
printf("手牌数:%d\n",*shoupaishu);
scanf("%d",&x);
if(x>=0&&x<(*shoupaishu))break;
else printf("你弃掉了一张空气!\n");
}
else
{
srand((unsigned)time(NULL));
x=rand()%(*shoupaishu);
break;
}
}
qipaidui[*qipaishu]=shoupai[x];
for(i=x+1;i<=(*shoupaishu);i++)shoupai[i-1]=shoupai[i];
(*shoupaishu)--;
if(juese)printf("弃牌阶段玩家弃置");
else printf("弃牌阶段电脑弃置");
qipaidui[*qipaishu].Kanpai();
(*qipaishu)++;
int m;
if(juese)
{
printf("玩家当前手牌:\n");
for(m=0;m<=(*shoupaishu-1);m++)
{
printf("%d ",m);
(shoupai[m]).Kanpai();
}
} printf("弃牌堆:%d\n",*qipaishu);
}
}
}
int Huihe(pai A[104],pai B[104],int *x,int *y,pai yuanshipaidui[2][4][13],wujiang *w1,wujiang *w2)
{
printf("\n回合开始阶段……\n");
switch((*w1).huihekaishi)
{
case 0:break;
default:printf("回合开始阶段参数错误!\n");break;
}
printf("判定阶段……\n");
int K=0;
if((*w1).pandingshu>0)
{
int i,j;
for(;(*w1).pandingshu;)
{
switch((*w1).pandingpai[0].leixing)
{
case 251:printf("【乐不思蜀】开始判定……\n"); break;
case 252:printf("【闪电】开始判定……\n");break;
default:printf("【??】开始判定……\n");break;
}
j=0;
pai p=((*w1).pandingpai[0]);
for(;;)//在判定之前询问【无懈】
{
i=Wuxie(&p,w2,w1,B,y,0);
if(!i)break;
j++;
i=Wuxie(&p,w1,w2,B,y,0);
if(!i)break;
j++;
}
switch((*w1).pandingpai[0].leixing)
{
case 251:
if(!(j%2))
{
printf("【乐不思蜀】的判定牌是:");
Panding(A,x,B,y);
if((B[(*y)-1].huase)!=1)
{
printf("【乐不思蜀】判定成功!\n");
if((*w1).juese)printf("玩家");
else printf("电脑");
printf("跳过出牌阶段!\n");
K=-1;
}
else printf("【乐不思蜀】判定失败!\n");
}
B[*y]=(*w1).pandingpai[0];
((*w1).pandingshu)--;
(*w1).pandingpai[0]=(*w1).pandingpai[1];
(*w1).pandingpai[1]=(*w1).pandingpai[2];
(*w1).pandingpai[2].leixing=-1;
(*y)++;
break;
case 252:
if(!(j%2))
{
printf("【闪电】的判定牌是:");
Panding(A,x,B,y);
if((B[(*y)-1].huase==0)&&(B[(*y)-1].dianshu>=1)&&(B[(*y)-1].dianshu<=8))
{
printf("【闪电】判定成功!\n");
if((*w1).juese)printf("玩家");
else printf("电脑");
printf("受到3点雷电伤害!");
((*w1).tili)=((*w1).tili)-3;
i=Binsi(w2,w1,B,y);
B[*y]=(*w1).pandingpai[0];
((*w1).pandingshu)--;
(*w1).pandingpai[0]=(*w1).pandingpai[1];
(*w1).pandingpai[1]=(*w1).pandingpai[2];
(*w1).pandingpai[2].leixing=-1;
(*y)++;
if(i==-1)return -1;
}
else
{
printf("【闪电】判定失败!\n");
(*w2).pandingpai[2]=(*w2).pandingpai[1];
(*w2).pandingpai[1]=(*w2).pandingpai[0];
(*w2).pandingpai[0]=(*w1).pandingpai[0];
(*w1).pandingpai[0]=(*w1).pandingpai[1];
(*w1).pandingpai[1]=(*w1).pandingpai[2];
(*w1).pandingpai[2].leixing=-1;
((*w1).pandingshu)--;
((*w2).pandingshu)++;
}
break;
}
default:printf("判定牌错误!");
} printf("弃牌数:%d\n",*y);
}
}
else if(!((*w1).pandingshu));
else printf("判定阶段参数错误!\n");
printf("摸牌阶段……\n");
switch((*w1).mopai)
{
case 0:Mopai(&((*w1).shoupaishu),(*w1).shoupai,A,x,B,y,(*w1).juese);break;
case -1:break;
default:printf("摸牌阶段参数错误!\n");break;
}
if(K==-1)goto M;
printf("出牌阶段……\n");
switch((*w1).chupai)
{
case 0:
{
int i;
i=Chupai(A,B,x,y,w1,w2,yuanshipaidui);
if(i==-1)
{
return -1;
break;
}
else break;
}
case -1:break;
default:printf("出牌阶段参数错误!\n");break;
}
M:
printf("弃牌阶段……\n");
switch((*w1).qipai)
{
case 0:
Qipai((*w1).shoupai,&((*w1).shoupaishu),B,y,(*w1).juese,&((*w1).tili));break;
default:printf("弃牌阶段参数错误!\n");break;
}
printf("回合结束阶段……\n");
switch((*w1).huihejieshu)
{
case 0:break;
default:printf("回合结束阶段参数错误!\n");break;
}
return 0;
}
int main()
{
void Kanshoupai(pai p);
pai yuanshipaidui[2][4][13],qipaidui[104],paidui[104];
wujiang wanjia,com;
com.tili=wanjia.tili=5;
com.tilishangxian=wanjia.tilishangxian=5;
com.huihekaishi=wanjia.huihekaishi=0;
com.panding=wanjia.panding=0;
com.mopai=wanjia.mopai=0;
com.chupai=wanjia.chupai=0;
com.qipai=wanjia.qipai=0;
com.huihejieshu=wanjia.huihejieshu=0;
com.shoupaishu=wanjia.shoupaishu=0;
com.pandingshu=wanjia.pandingshu=0;
com.zhuangbeishu=wanjia.zhuangbeishu=0;
com.juese=0;wanjia.juese=1;
pai p;
p.leixing=-1;
com.zhuangbei[0]=com.zhuangbei[1]=com.zhuangbei[2]=com.zhuangbei[3]=wanjia.zhuangbei[0]=wanjia.zhuangbei[1]=wanjia.zhuangbei[2]=wanjia.zhuangbei[3]=p;
com.zhuangbei[0].changdu=wanjia.zhuangbei[0].changdu=1;
com.pandingpai[0]=com.pandingpai[1]=com.pandingpai[2]=wanjia.pandingpai[0]=wanjia.pandingpai[1]=wanjia.pandingpai[2]=p;
com.juli[0]=wanjia.juli[0]=1;
int a,b,c;
for(a=0;a<=1;a++)
{
for(b=0;b<=3;b++)
{
for(c=0;c<=12;c++)
{
yuanshipaidui[a][b][c].paifu=a;
yuanshipaidui[a][b][c].huase=b;
yuanshipaidui[a][b][c].dianshu=c;
}
}
}
yuanshipaidui[0][0][0].leixing=204;
yuanshipaidui[0][0][1].leixing=331;
yuanshipaidui[0][0][2].leixing=201;
yuanshipaidui[0][0][3].leixing=201;
yuanshipaidui[0][0][4].leixing=304;yuanshipaidui[0][0][4].changdu=3;
yuanshipaidui[0][0][5].leixing=251;
yuanshipaidui[0][0][6].leixing=101;
yuanshipaidui[0][0][7].leixing=101;
yuanshipaidui[0][0][8].leixing=101;
yuanshipaidui[0][0][9].leixing=101;
yuanshipaidui[0][0][10].leixing=202;
yuanshipaidui[0][0][11].leixing=201;
yuanshipaidui[0][0][12].leixing=208;
yuanshipaidui[0][1][0].leixing=209;
yuanshipaidui[0][1][1].leixing=102;
yuanshipaidui[0][1][2].leixing=103;
yuanshipaidui[0][1][3].leixing=103;
yuanshipaidui[0][1][4].leixing=308;yuanshipaidui[0][1][4].changdu=5;
yuanshipaidui[0][1][5].leixing=103;
yuanshipaidui[0][1][6].leixing=103;
yuanshipaidui[0][1][7].leixing=103;
yuanshipaidui[0][1][8].leixing=103;
yuanshipaidui[0][1][9].leixing=101;
yuanshipaidui[0][1][10].leixing=101;
yuanshipaidui[0][1][11].leixing=103;
yuanshipaidui[0][1][12].leixing=102;
yuanshipaidui[0][2][0].leixing=204;
yuanshipaidui[0][2][1].leixing=101;
yuanshipaidui[0][2][2].leixing=101;
yuanshipaidui[0][2][3].leixing=101;
yuanshipaidui[0][2][4].leixing=101;
yuanshipaidui[0][2][5].leixing=101;
yuanshipaidui[0][2][6].leixing=101;
yuanshipaidui[0][2][7].leixing=101;
yuanshipaidui[0][2][8].leixing=101;
yuanshipaidui[0][2][9].leixing=101;
yuanshipaidui[0][2][10].leixing=101;
yuanshipaidui[0][2][11].leixing=205;
yuanshipaidui[0][2][12].leixing=205;
yuanshipaidui[0][3][0].leixing=204;
yuanshipaidui[0][3][1].leixing=102;
yuanshipaidui[0][3][2].leixing=102;
yuanshipaidui[0][3][3].leixing=102;
yuanshipaidui[0][3][4].leixing=102;
yuanshipaidui[0][3][5].leixing=101;
yuanshipaidui[0][3][6].leixing=101;
yuanshipaidui[0][3][7].leixing=101;
yuanshipaidui[0][3][8].leixing=101;
yuanshipaidui[0][3][9].leixing=101;
yuanshipaidui[0][3][10].leixing=102;
yuanshipaidui[0][3][11].leixing=103;
yuanshipaidui[0][3][12].leixing=101;
yuanshipaidui[1][0][0].leixing=252;
yuanshipaidui[1][0][1].leixing=302;yuanshipaidui[1][0][1].changdu=2;
yuanshipaidui[1][0][2].leixing=202;
yuanshipaidui[1][0][3].leixing=202;
yuanshipaidui[1][0][4].leixing=383;
yuanshipaidui[1][0][5].leixing=303;yuanshipaidui[1][0][5].changdu=2;
yuanshipaidui[1][0][6].leixing=208;
yuanshipaidui[1][0][7].leixing=101;
yuanshipaidui[1][0][8].leixing=101;
yuanshipaidui[1][0][9].leixing=101;
yuanshipaidui[1][0][10].leixing=210;
yuanshipaidui[1][0][11].leixing=305;yuanshipaidui[1][0][11].changdu=3;
yuanshipaidui[1][0][12].leixing=362;
yuanshipaidui[1][1][0].leixing=206;
yuanshipaidui[1][1][1].leixing=102;
yuanshipaidui[1][1][2].leixing=207;
yuanshipaidui[1][1][3].leixing=207;
yuanshipaidui[1][1][4].leixing=361;
yuanshipaidui[1][1][5].leixing=251;
yuanshipaidui[1][1][6].leixing=203;
yuanshipaidui[1][1][7].leixing=203;
yuanshipaidui[1][1][8].leixing=203;
yuanshipaidui[1][1][9].leixing=101;
yuanshipaidui[1][1][10].leixing=203;
yuanshipaidui[1][1][11].leixing=201;
yuanshipaidui[1][1][12].leixing=381;
yuanshipaidui[1][2][0].leixing=301;yuanshipaidui[1][2][0].changdu=1;
yuanshipaidui[1][2][1].leixing=331;
yuanshipaidui[1][2][2].leixing=201;
yuanshipaidui[1][2][3].leixing=201;
yuanshipaidui[1][2][4].leixing=382;
yuanshipaidui[1][2][5].leixing=251;
yuanshipaidui[1][2][6].leixing=208;
yuanshipaidui[1][2][7].leixing=101;
yuanshipaidui[1][2][8].leixing=101;
yuanshipaidui[1][2][9].leixing=101;
yuanshipaidui[1][2][10].leixing=101;
yuanshipaidui[1][2][11].leixing=210;
yuanshipaidui[1][2][12].leixing=210;
yuanshipaidui[1][3][0].leixing=301;yuanshipaidui[1][3][0].changdu=1;
yuanshipaidui[1][3][1].leixing=102;
yuanshipaidui[1][3][2].leixing=202;
yuanshipaidui[1][3][3].leixing=202;
yuanshipaidui[1][3][4].leixing=306;yuanshipaidui[1][3][4].changdu=3;
yuanshipaidui[1][3][5].leixing=102;
yuanshipaidui[1][3][6].leixing=102;
yuanshipaidui[1][3][7].leixing=102;
yuanshipaidui[1][3][8].leixing=102;
yuanshipaidui[1][3][9].leixing=102;
yuanshipaidui[1][3][10].leixing=102;
yuanshipaidui[1][3][11].leixing=307;yuanshipaidui[1][3][11].changdu=4;
yuanshipaidui[1][3][12].leixing=363;
int paiduishu=104;
int qipaishu=0;
printf("游戏开始! by cyh\n");
Qishixipai(yuanshipaidui,paidui);
Qishishoupai(&wanjia,paidui,&(paiduishu),qipaidui,&(qipaishu));
Qishishoupai(&com,paidui,&(paiduishu),qipaidui,&(qipaishu));
int i;
for(;;)
{
i=Huihe(paidui,qipaidui,&paiduishu,&qipaishu,yuanshipaidui,&wanjia,&com);
if(i==-1)break;
i=Huihe(paidui,qipaidui,&paiduishu,&qipaishu,yuanshipaidui,&com,&wanjia);
if(i==-1)break;
}
}
中级天翼
#include<iostream>
#include<time.h>
#include<stdio.h>
#include <stdlib.h>
using namespace std;
struct pai
{
int paifu;
int huase;
int yanse;
int dianshu;
int leixing;
int changdu;
void Kanpai()
{
if(paifu==0||paifu==1);
else
printf("牌副参数错误!\n");
switch(huase)
{
case 0:cout<<"黑桃";break;
case 1:cout<<"红桃";break;
case 2:cout<<"草花";break;
case 3:cout<<"方片";break;
case -1:cout<<"无色";break;
default:printf("花色错误!\n");break;
}
switch(dianshu)
{
case 0:cout<<"A ";break;
case 1:cout<<"2 ";break;
case 2:cout<<"3 ";break;
case 3:cout<<"4 ";break;
case 4:cout<<"5 ";break;
case 5:cout<<"6 ";break;
case 6:cout<<"7 ";break;
case 7:cout<<"8 ";break;
case 8:cout<<"9 ";break;
case 9:cout<<"10 ";break;
case 10:cout<<"J ";break;
case 11:cout<<"Q ";break;
case 12:cout<<"K ";break;
case -1:cout<<"无点数";break;
default:printf("点数错误!\n");break;
}
switch(leixing)
{
case 101:cout<<"【杀】"<<endl;break;
case 102:cout<<"【闪】"<<endl;break;
case 103:cout<<"【桃】"<<endl;break;
case 201:cout<<"【过河拆桥】"<<endl;break;
case 202:cout<<"【顺手牵羊】"<<endl;break;
case 203:cout<<"【无中生有】"<<endl;break;
case 204:cout<<"【决斗】"<<endl;break;
case 205:cout<<"【借刀杀人】"<<endl;break;
case 206:cout<<"【桃园结义】"<<endl;break;
case 207:cout<<"【五谷丰登】"<<endl;break;
case 208:cout<<"【南蛮入侵】"<<endl;break;
case 209:cout<<"【万箭齐发】"<<endl;break;
case 210:cout<<"【无懈可击】"<<endl;break;
case 251:cout<<"【乐不思蜀】"<<endl;break;
case 252:cout<<"【闪电】"<<endl;break;
case 301:cout<<"【诸葛连弩(1)】"<<endl;break;
case 302:cout<<"【雌雄双股剑(2)】"<<endl;break;
case 303:cout<<"【青釭剑(2)】"<<endl;break;
case 304:cout<<"【青龙偃月刀(3)】"<<endl;break;
case 305:cout<<"【丈八蛇矛(3)】"<<endl;break;
case 306:cout<<"【贯石斧(3)】"<<endl;break;
case 307:cout<<"【方天画戟(4)】"<<endl;break;
case 308:cout<<"【麒麟弓(5)】"<<endl;break;
case 331:cout<<"【八卦阵】"<<endl;break;
case 361:cout<<"【赤兔(-1)】"<<endl;break;
case 362:cout<<"【大宛(-1)】"<<endl;break;
case 363:cout<<"【紫辛(-1)】"<<endl;break;
case 381:cout<<"【爪黄飞电(+1)】"<<endl;break;
case 382:cout<<"【的卢(+1)】"<<endl;break;
case 383:cout<<"【绝影(+1)】"<<endl;break;
default:printf("类型参数错误!");break;
}
}
};
void Qishixipai(pai A[2][4][13],pai paidui[104])
{
int i,m,x,y,z,a[104]={0};
srand((unsigned)time(NULL));
for(i=1;i<=104;i++)
{
while(a[m=rand()%104]);
a[m]=i;
}
for(i=0;i<=103;i++)
{
x=(a[i]-1)/52;
y=((a[i]-1)-52*x)/13;
z=(a[i]-1)%13;
paidui[i]=A[x][y][z];
}
}
void Xipai(pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int i,m,a[104]={0};
srand((unsigned)time(NULL));
for(i=1;i<=(*qipaishu);i++)
{
while(a[m=rand()%(*qipaishu)]);
a[m]=i;
}
for(i=0;i<=((*qipaishu)-1);i++)
{
paidui[i]=qipaidui[a[i]];
qipaidui[a[i]].leixing=-1;
(*paiduishu)++;
(*qipaishu)--;
}
for(i=(*paiduishu);i<=103;i++)paidui[i].leixing=-1;
}
pai Mo1pai(pai A[104],int *x,pai B[104],int*y,int *b)
{
pai p;
if((*x)==0)Xipai(A,x,B,y);
else if((*x)<0)printf("摸牌参数错误!");
else;
p=A[104-(*x)];
(*x)--;
(*b)++;
return(p);
}
struct wujiang
{
char name;
int tili;
int tilishangxian;
int shoupaishangxian;
int huihekaishi;
int panding;
int mopai;
int chupai;
int qipai;
int huihejieshu;
int juese;
pai shoupai[20];
int shoupaishu;
pai zhuangbei[4];
int zhuangbeishu;
pai pandingpai[3];
int pandingshu;
int juli[1];
void Kanshoupai()
{
printf("玩家当前手牌:\n");
if(shoupaishu)
{
int m;
for(m=0;m<=(shoupaishu-1);m++)
{
printf("%d ",m);
(shoupai[m]).Kanpai();
}
}
else printf("空城!\n");
printf("\n");
}
void Kanzhuangbei()
{
if(juese)printf("玩家");
else printf("电脑");
printf("当前装备:\n");
printf("0 武器: ");
if((zhuangbei[0]).leixing==-1)printf("空\n");
else (zhuangbei[0]).Kanpai();
printf("1 防具: ");
if((zhuangbei[1]).leixing==-1)printf("空\n");
else (zhuangbei[1]).Kanpai();
printf("2 进攻马: ");
if((zhuangbei[2]).leixing==-1)printf("空\n");
else (zhuangbei[2]).Kanpai();
printf("3 防御马: ");
if((zhuangbei[3]).leixing==-1)printf("空\n");
else (zhuangbei[3]).Kanpai();
printf("\n");
}
void Kanpandingpai()
{
if(juese)printf("玩家");
else printf("电脑");
printf("当前判定区:\n");
if((pandingpai[0]).leixing==-1)printf("空\n");
else
{
printf("0 ");
(pandingpai[0]).Kanpai();
if((pandingpai[1]).leixing==-1);
else
{
printf("1 ");
(pandingpai[1]).Kanpai();
if((pandingpai[2]).leixing==-1);
else
{
printf("2 ");
(pandingpai[2]).Kanpai();
}
}
}
}
};
void Mopai(int*shoupaishu,pai shoupai[20],pai A[104],int *x,pai B[104],int*y,int juese)
{
if(juese)printf("玩家从牌堆摸2张牌\n");
else printf("电脑从牌堆摸2张牌\n");
pai p;
p=Mo1pai(A,x,B,y,shoupaishu);
shoupai[*shoupaishu-1]=p;
pai q;
q=Mo1pai(A,x,B,y,shoupaishu);
shoupai[*shoupaishu-1]=q;
int m;
if(juese)
{
printf("玩家当前手牌:\n");
for(m=0;m<=(*shoupaishu-1);m++)
{
printf("%d ",m);
(shoupai[m]).Kanpai();
}
}
printf("牌堆还剩%100000000000000000000000张牌!\n\n",*x);
}
void Qishishoupai(wujiang *w,pai A[104],int *x,pai B[104],int*y)
{
pai a;
a=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=a;
pai b;
b=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=b;
pai c;
c=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=c;
pai d;
d=Mo1pai(A,x,B,y,&((*w).shoupaishu));
(*w).shoupai[(*w).shoupaishu-1]=d;
int m;
if((*w).juese)printf("玩家从牌堆摸4张牌\n");
else printf("电脑从牌堆摸4张牌\n");
if((*w).juese)
{
printf("玩家当前手牌:\n");
for(m=0;m<=((*w).shoupaishu-1);m++)
{
printf("%d ",m);
((*w).shoupai[m]).Kanpai();
}
}
printf("牌堆还剩%d张牌!\n\n",*x);
}
void Panding(pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
paidui[*paiduishu].Kanpai();
qipaidui[*qipaishu]=paidui[*paiduishu];
(*paiduishu)--;
(*qipaishu)++;
}
pai Zhangba(wujiang*w,pai qipaidui[104],int*qipaishu)
{
int x,y;
pai p;
for(;;)
{
int i,j;
printf("请输入任意两张手牌之前的编号,以空格隔开,以回车结束!\n");
scanf("%d",&x);
scanf("%d",&y);
if((x>=0)&&(x<(*w).shoupaishu)&&(y>=0)&&(y<(*w).shoupaishu-1))
{
switch((((*w).shoupai[x].huase)%2)+(((*w).shoupai[y].huase)%2))
{
case 0:p.yanse=0;break;
case 2:p.yanse=1;break;
case 1:p.yanse=2;break;
default:printf("【丈八蛇矛】函数参数错误!\n");
}
qipaidui[*qipaishu]=(*w).shoupai[x];
(*w).shoupai[x].leixing=-1;
((*w).shoupaishu)--;
(*qipaishu)++;
qipaidui[*qipaishu]=(*w).shoupai[y];
(*w).shoupai[y].leixing=-1;
((*w).shoupaishu)--;
(*qipaishu)++; printf("弃牌数:%d",*qipaishu);
for(i=0;i<=(((*w).shoupaishu)+1);i++)
{
if((*w).shoupai[i].leixing==-1)
{
for(j=i+1;j<=(((*w).shoupaishu)+2);j++)
(*w).shoupai[j-1]=(*w).shoupai[j];
i--;
}
}
printf("玩家把:\n");
qipaidui[(*qipaishu)-2].Kanpai();
qipaidui[(*qipaishu)-1].Kanpai();
printf("当作一张");
switch(p.yanse)
{
case 0:printf("黑色");break;
case 2:printf("红色");break;
case 1:printf("无色");break;
default:printf("绿色");break;
}
printf("无点数的【杀】");
p.dianshu=-1;
p.leixing=101;
return p;
break;
}
printf("你将两张空气当作一张空气属性的【杀】使用或打出!\n");
}
}
int Xuanpai(wujiang*w,int t)
{
int x;
if((*w).juese)
{
for(;;)
{
printf("出牌请输入手牌之前的编号,以回车结束!\n如果你想结束出牌阶段,请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if((x>=-1&&x<((*w).shoupaishu))||((x==100)&&((*w).zhuangbei[0].leixing==305)))
{
return x;
break;
}
printf("你打出了一张空气!\n");
}
}
else return t;
}
pai Panpai(wujiang*w1,int*sha,int y,pai qipaidui[104],int*qipaishu)
{
pai p,q;
p.leixing=0;
q.leixing=-1;
if(y==-1)return q;
else
{
if(y==100)
{
if((*sha)>0)
{
q=Zhangba(w1,qipaidui,qipaishu);
printf("使用!\n");
return q;
}
else
{
printf("当前回合使用【杀】的次数已用尽,你也不能使用【丈八蛇矛】效果!\n");
return p;
}
}
switch((*w1).shoupai[y].leixing)
{
case 101:
if(((*sha)>0)||((*w1).zhuangbei[0].leixing==301))
{
if(((*w1).zhuangbei[0].leixing==301))printf("武器【诸葛连弩】效果被触发!\n");
return (*w1).shoupai[y];
break;
}
else
{
if((*w1).juese)printf("当前回合使用【杀】的次数已用尽,你不能使用【杀】!\n");
return p;break;
}
case 102:
if((*w1).juese)
printf("当前不需要响应任何操作,你不能主动打出【闪】!\n");
return p;break;
case 103:
if(((*w1).tili)<((*w1).tilishangxian))
{
return (*w1).shoupai[y];
break;
}
else
{
if((*w1).juese)
printf("你并未受伤,不能对自己使用【桃】!\n");
}
return p;break;
case 210:
if((*w1).juese)
printf("当前不需要响应任何锦囊,你不能主动打出【无懈可击】!\n");
return p;break;
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 207:
case 208:
case 209:
case 251:
case 252:
case 301:
case 302:
case 303:
case 304:
case 305:
case 306:
case 307:
case 308:
case 331:
case 361:
case 362:
case 363:
case 381:
case 382:
case 383:return (*w1).shoupai[y];break;
default:printf("手牌类型参数错误!\n");return p;break;
}
}
}
int Mubiao(pai p,wujiang *w1,wujiang *w2,int*sha)
{
int x;
switch(p.leixing)
{
case 101:
if((*w1).juese)
{
printf("请选择【杀】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
if((*w1).zhuangbei[0].changdu>=(*w1).juli[0])
{
(*sha)--;
return((*w2).juese);
}
else
{
printf("武器长度不够!\n");
return -2;
}
}
else
{
printf("目标错误!\n");
return -2;
}
}
else
{
if((*w1).zhuangbei[0].changdu>=(*w1).juli[0])
{
(*sha)--;
return((*w2).juese);
}
else return -2;
}
break;
case 103:return((*w1).juese);break;
case 201:
if((*w1).juese)
{
printf("请选择【过河拆桥】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
if((*w2).shoupaishu||(*w2).zhuangbeishu||(*w2).pandingshu)return((*w2).juese);
else
{
printf("目标没有牌!\n");
return -2;
}
}
else
{
printf("目标错误!\n");
return -2;
}
}
else return((*w2).juese);
break;
case 202:
if((*w1).juese)
{
printf("请选择【顺手牵羊】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
if(((*w2).shoupaishu||(*w2).zhuangbeishu||(*w2).pandingshu)&&((*w1).juli[0]<=1))return((*w2).juese);
else
{
printf("目标没有牌!\n");
return -2;
}
}
else
{
printf("目标错误!\n");
return -2;
}
}
else
{
if((*w1).juli[0]<=1)return((*w2).juese);
else return -2;
}
break;
case 203:
return((*w1).juese);break;
case 204:
if((*w1).juese)
{
printf("请选择【决斗】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)return((*w2).juese);
else
{
printf("目标错误!\n");
return -2;
}
}
else return((*w2).juese);
break;
case 205:
int y;
if((*w1).juese)
{
printf("请选择【借刀杀人】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x!=0)
{
printf("目标错误!\n");
return -2;
}
else
{
if(((*w2).zhuangbei[0]).leixing<=300||((*w2).zhuangbei[0]).leixing>=331)
{
printf("目标装备区里没有武器!\n");
return -2;
}
else
{
printf("请选择【杀】的目标!\n提示:【杀】的目标必须在【借刀杀人】的目标的攻击范围之内!\n输入目标前的编号,以回车结束!\n0 玩家\n");
scanf("%d",&y);
if(y!=0)
{
printf("目标错误!\n");
return -2;
}
else
{
if(((*w2).zhuangbei[0].changdu)<(*w2).juli[0])
{
printf("武器距离不够!\n");
return -2;
}
else
return((*w2).juese);
}
}
}
}
else
{
if(((*w2).zhuangbei[0]).leixing<=300||((*w2).zhuangbei[0]).leixing>=331)return -2;
else
{
if(((*w2).zhuangbei[0].changdu)<(*w2).juli[0])return -2;
else return((*w2).juese);
}
}
break;
case 206:
case 207:return 99;break;
case 208:
case 209:return 100;break;
case 251:
if((*w1).juese)
{
printf("请选择【乐不思蜀】的目标!\n输入目标前的编号,以回车结束!\n0 电脑1\n");
scanf("%d",&x);
if(x==0)
{
int i;
for(i=0;i<=2;i++)
{
if((*w2).pandingpai[i].leixing==251)
i=-1;
break;
}
if(i==-1)
{
printf("目标判定区里不能同时存在两张相同的延时类锦囊!\n");
return -2;
}
else return((*w2).juese);
}
else
{
printf("目标错误!\n");
return -2;
}
}
else
{
int i;
for(i=0;i<=2;i++)
{
if((*w2).pandingpai[i].leixing==251)
i=-1;
break;
}
if(i==-1)return -2;
else return((*w2).juese);
}
break;
case 252:
int i;
for(i=0;i<=2;i++)
{
if((*w1).pandingpai[i].leixing==252)
i=-1;
break;
}
if(i==-1)
{
if((*w1).juese)printf("目标判定区里不能同时存在两张相同的延时类锦囊!\n");
return -2;
}
else return ((*w1).juese);
break;
case 301:
case 302:
case 303:
case 304:
case 305:
case 306:
case 307:
case 308:
case 331:
case 361:
case 362:
case 363:
case 381:
case 382:
case 383:return((*w1).juese);break;
default:return -2;break;
}
}
void Da1pai(wujiang *w1,wujiang*w2,pai qipaidui[104],int *qipaishu,int x)
{
int i;
if((x<0||x>=((*w1).shoupaishu))&&x!=100)
printf("你的牌呢?!\n");
else
{
switch(((*w1).shoupai)[x].leixing)
{
case 101:
case 102:
case 103:
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 207:
case 208:
case 209:
case 210:
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
break;
case 251:
for(i=1;i>=0;i--)(*w2).pandingpai[i+1]=(*w2).pandingpai[i];
(*w2).pandingpai[0]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
((*w2).pandingshu)++;
break;
case 252:
for(i=1;i>=0;i--)(*w1).pandingpai[i+1]=(*w1).pandingpai[i];
(*w1).pandingpai[0]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
((*w1).pandingshu)++;
break;
case 301:
case 302:
case 303:
case 304:
case 305:
case 306:
case 307:
case 308:
if((*w1).zhuangbei[0].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[0];
(*qipaishu)++;
}
(*w1).zhuangbei[0]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
case 331:
if((*w1).zhuangbei[1].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[1];
(*qipaishu)++;
}
(*w1).zhuangbei[1]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
case 361:
case 362:
case 363:
if((*w1).zhuangbei[2].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[2];
(*qipaishu)++;
}
(*w1).zhuangbei[2]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
case 381:
case 382:
case 383:
if((*w1).zhuangbei[3].leixing==-1)((*w1).zhuangbeishu)++;
else
{
qipaidui[*qipaishu]=((*w1).zhuangbei)[3];
(*qipaishu)++;
}
(*w1).zhuangbei[3]=(*w1).shoupai[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
break;
default:break;
}
}
}
void Miaoshu(pai p,int juese,int duixiang)
{
if(juese==0)printf("电脑");
else if(juese==1)printf("玩家");
else printf("角色参数错误!\n");
if(p.leixing<=300&&p.leixing>100)
{
switch(duixiang)
{
case -1:printf("打出");break;
case 0:printf("对电脑使用");break;
case 1:printf("对玩家使用");break;
case 99:printf("使用");break;
case 100:printf("对所有人使用");break;
default:printf("对象参数错误\n");break;
}
}
else if(p.leixing>=301&&p.leixing<=400)
printf("装备");
else printf("你出的是什么东西?\n");
p.Kanpai();
if(!juese&&(p.leixing==101||p.leixing==204||p.leixing==205||p.leixing==207||p.leixing==208||p.leixing==209))printf("请响应!\n");
}
int Wuxie(pai *p,wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu,int a)
{
int x;
if((*w1).juese)
{
printf("是否使用【无懈可击】响应?\n\n");
for(;;)
{
(*w1).Kanshoupai();
printf("如果要使用【无懈可击】请输入手牌之前编号,不需要请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if(x==-1)
{
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==210)
{
printf("电脑使用");
((*w2).shoupai)[x].Kanpai();
printf("对象是");
(*p).Kanpai();
(*p)=((*w2).shoupai)[x];
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
a++;
break;
}
}
break;
}
else if((*w1).shoupai[x].leixing==210)
{
printf("玩家使用");
((*w1).shoupai)[x].Kanpai();
printf("对象是");
(*p).Kanpai();
(*p)=((*w1).shoupai)[x];
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(int i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
(*w1).Kanshoupai();
a++;
break;
}
else printf("你确定你使用的是【无懈可击】?\n");
}
}
else
{
printf("是否使用【无懈可击】响应?\n");
for(;;)
{
(*w2).Kanshoupai();
printf("如果要使用【无懈可击】请输入手牌之前编号,不需要请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if(x==-1)break;
else if((*w2).shoupai[x].leixing==210)
{
printf("玩家使用");
((*w2).shoupai)[x].Kanpai();
printf("对象是");
(*p).Kanpai();
(*p)=((*w2).shoupai)[x];
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
(*w2).Kanshoupai();
a++;
break;
}
else printf("你确定你使用的是【无懈可击】?\n");
}
}
return a;
}
int Qiutao(wujiang*w,pai qipaidui[104],int*qipaishu)
{
int x;
if((*w).juese)
{
for(;;)
{
printf("如果要使用【桃】请输入手牌之前的编号,不需要请输入“-1”,以回车结束!\n");
scanf("%d",&x);
if(x==-1)
{
return -1;
break;
}
else if((*w).shoupai[x].leixing==103)
{
qipaidui[*qipaishu]=((*w).shoupai)[x];
for(int i=x+1;i<=((*w).shoupaishu);i++)((*w).shoupai)[i-1]=((*w).shoupai)[i];
((*w).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
else printf("你确定你使用的是【桃】?\n");
}
}
else
{
for(x=0;x<((*w).shoupaishu);x++)
{
if((*w).shoupai[x].leixing==103)
{
qipaidui[*qipaishu]=((*w).shoupai)[x];
for(int i=x+1;i<=((*w).shoupaishu);i++)((*w).shoupai)[i-1]=((*w).shoupai)[i];
((*w).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
}
return -1;
}
}
int Binsi(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
if(((*w2).tili)>0)return 0;
else
{
int i;
if((*w1).juese)
{
for(;;)
{
printf("电脑濒死,是否使用【桃】?\n");
i=Qiutao(w1,qipaidui,qipaishu);
if(i==0)((*w2).tili)++;
if((i==-1)||((*w2).tili>0))break;
}
if((*w2).tili>0)return 0;
else
{
for(;;)
{
i=Qiutao(w2,qipaidui,qipaishu);
if(i==0)((*w2).tili)++;
if((i==-1)||((*w2).tili>0))break;
}
if((*w2).tili>0)return 0;
else return -1;
}
}
else
{
for(;;)
{
printf("玩家濒死,是否使用【桃】?\n");
i=Qiutao(w2,qipaidui,qipaishu);
if(i==0)((*w2).tili)++;
if((i==-1)||((*w2).tili>0))break;
}
if((*w2).tili>0)return 0;
else return -1;
}
}
}
int Shan(wujiang*w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int x;
if((*w2).juese)
{
if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing!=303))
{
for(;;)
{
int m;
printf("是否发动【八卦阵】防具效果?\n0 否\n1 是\n请输入选项之前的编号,以回车结束!\n");
scanf("%d",&m);
if(m==1)
{
Panding(paidui,paiduishu,qipaidui,qipaishu);
if(qipaidui[(*qipaishu)-1].huase%2)
{
printf("【八卦阵】判定成功!\n");
return 0;
}
}
else if(m==0)
{
printf("【八卦阵】判定失败!\n");
break;
}
else printf("你确定你输入的是“0”或“1”?\n");
}
}
else if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing==303))printf("【青釭剑】锁定技被触发!\n");
for(;;)
{
printf("请输入手牌之前的编号,或者输入“-1”放弃打出【闪】,以回车结束!\n");
scanf("%d",&x);
if(x==-1)
{
return -1;
break;
}
else if((*w2).shoupai[x].leixing==102)
{
printf("玩家打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
else printf("你确定你打出的是【闪】?\n");
}
}
else
{
if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing!=303))
{
Panding(paidui,paiduishu,qipaidui,qipaishu);
if(qipaidui[(*qipaishu)-1].huase%2)
{
printf("【八卦阵】判定成功!\n");
return 0;
}
else printf("【八卦阵】判定失败!\n");
}
else if(((*w2).zhuangbei[1].leixing==331)&&((*w1).zhuangbei[0].leixing==303))printf("【青釭剑】锁定技被触发!\n");
int i;
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==102)
{
printf("电脑打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
}
return -1;
}
}
int Sha(wujiang *w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int x;
if((*w2).juese)
{
printf("请打出【闪】响应【杀】!否则你将受到1点伤害!\n");
x=Shan(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(x==-1)
{
int i;
((*w2).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else if(x==0&&((*w1).zhuangbei[0].leixing==306))
{
int i;
if(((*w1).shoupaishu)>=2)
{
printf("电脑弃掉:\n");
((*w1).shoupai)[0].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[0];
for(i=1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
((*w1).shoupai)[0].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[0];
for(i=1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
printf("发动【贯石斧】武器效果使【杀】造成伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else return 0;
}
else if(x==0&&((*w1).zhuangbei[0].leixing==304))
{
int i;
for(x=0;x<((*w1).shoupaishu);x++)
{
if((*w1).shoupai[x].leixing==101)
{
printf("电脑发动【青龙偃月刀】效果对玩家使用");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
i=Sha(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
return i;
break;
}
}
return 0;
}
}
else
{
x=Shan(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(x==-1)
{
if((*w1).zhuangbei[0].leixing==308)
{
for(;;)
{
printf("是否发动【麒麟弓】武器效果?\n0 否\n1 是\n");
scanf("%d",&x);
if(x==1)
{
if(((*w2).zhuangbei[2].leixing==-1)&&((*w2).zhuangbei[3].leixing==-1))
{
printf("电脑根本没有马,射你妹的马啊!\n");
break;
}
else
{
for(;;)
{
printf("0 ");
((*w2).zhuangbei[2]).Kanpai();
printf("1 ");
((*w2).zhuangbei[3]).Kanpai();
printf("请选择要弃掉的马,输入之前的编号,以回车结束!\n");
scanf("%d",&x);
if((x==0)&&((*w2).zhuangbei[2].leixing!=-1))
{
printf("你弃掉了电脑的");
((*w2).zhuangbei)[2].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[2];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[2].leixing=-1;
((*w2).juli[0])++;
break;
}
else if((x==1)&&((*w2).zhuangbei[3].leixing!=-1))
{
printf("你弃掉了电脑的");
((*w2).zhuangbei)[3].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[3];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[3].leixing=-1;
((*w1).juli[0])--;
break;
}
else printf("射你妹的马!");
}
break;
}
}
else if(x==0)break;
else printf("键盘上的“0”和“1”被你吃了吗?\n");
}
}
int i;
((*w2).tili)--;
printf("玩家对电脑造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else if(x==0&&((*w1).zhuangbei[0].leixing==306))
{
for(;;)
{
printf("是否发动【贯石斧】武器效果?\n0 否\n1 是\n");
scanf("%d",&x);
if(x==1)
{
int i;
if((*w1).shoupaishu+(*w1).zhuangbeishu<=2)
{
printf("你除了【贯石斧】以外连2张牌都没有,发动你妹的效果!\n");
break;
}
else
{
printf("请分别弃掉两张牌!\n");
for(i=0;i<=2;i++)
{
for(;;)
{
printf("请选择区域:\n0 手牌\n1 装备\n");
scanf("%d",&x);
if(x==0&&((*w1).shoupaishu==0))printf("你根本没有手牌,弃你妹啊!\n");
else if(x==1&&((*w1).zhuangbeishu==1))printf("你根本没有别的装备,弃你妹啊!\n");
else if(x>=0&&x<=1)break;
else printf("键盘上的“0”和“1”被你吃了吗?\n");
}
if(x==0)
{
for(;;)
{
(*w1).Kanshoupai();
printf("弃牌请输入手牌之前的编号,以回车结束!\n");
scanf("%d",&x);
if(x>=0&&x<((*w1).shoupaishu))break;
else printf("弃你妹的手牌!\n");
}
printf("你弃掉了");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
}
else
{
for(;;)
{
(*w1).Kanzhuangbei();
printf("请输入装备之前的编号,以回车键结束!\n");
scanf("%d",&x);
if((((*w1).zhuangbei[x]).leixing!=-1)&&(x>=0)&&(x<=3))
{
printf("你弃掉了");
((*w1).zhuangbei)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).zhuangbei)[x];
((*w1).zhuangbeishu)--;
(*qipaishu)++;
((*w1).zhuangbei)[x].leixing=-1;
break;
}
else printf("弃你妹的装备!\n");
}
}
}
}
printf("玩家发动【贯石斧】武器效果使【杀】造成伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
else if(x==0)break;
else printf("键盘上的“0”和“1”被你吃了吗?\n");
}
}
else if(x==0&&((*w1).zhuangbei[0].leixing==304))
{
for(;;)
{
printf("是否发动【青龙偃月刀】武器效果?\n0 否\n1 是\n");
scanf("%d",&x);
if(x==1)
{
for(;;)
{
printf("请对电脑使用一张【杀】!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
(*w1).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
return 0;
break;
}
else if((*w1).shoupai[x].leixing==101)
{
int i;
printf("玩家对电脑使用");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
i=Sha(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
return i;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
}
else if(x==0)
{
return 0;
break;
}
else printf("你确定你输入的是“0”或“1”?\n");
}
}
else return 0;
}
return 0;
}
void Tao(wujiang*w1)
{
((*w1).tili)++;
if((*w1).juese)printf("玩家");
else printf("电脑");
printf("恢复了1点体力!\n");
if(((*w1).tili)>((*w1).tilishangxian))printf("你被撑死了!\n");
}
void Chai(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
int i,x,y;
if((*w1).juese)
{
for(;;)
{
if((*w2).shoupaishu+(*w2).zhuangbeishu+(*w2).pandingshu==0)
{
printf("对方空城,拆你妹啊!\n");
break;
}
else
{
printf("请选择想拆的区域,输入选项之前的编号,以回车结束!\n0 手牌\n1 装备区\n2 判定区\n");
scanf("%d",&x);
if(x==0&&((*w2).shoupaishu==0))printf("你拆掉了一张空气!\n");
else if(x==1&&((*w2).zhuangbeishu==0))printf("你拆掉了一张空气!\n");
else if(x==2&&((*w2).pandingshu==0))printf("你拆掉了一张空气!\n");
else if(x>=0&&x<=2)break;
else printf("你拆掉了太空区里的一张牌!\n");
}
}
switch(x)
{
case 0:
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("你弃掉了电脑的");
((*w2).shoupai)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
break;
case 1:
for(;;)
{
(*w2).Kanzhuangbei();
printf("请输入装备之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((((*w2).zhuangbei[y]).leixing!=-1)&&(y>=0)&&(y<=3))
{
printf("你弃掉了电脑的");
((*w2).zhuangbei)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[y];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[y].leixing=-1;
if(!y)((*w2).zhuangbei)[y].changdu=1;
else if(y==2)((*w2).juli[0])++;
else if(y==3)((*w1).juli[0])--;
break;
}
else printf("你弃掉了一张空气!\n");
}
break;
case 2:
for(;;)
{
(*w2).Kanpandingpai();
printf("请输入判定牌之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((*w2).pandingpai[y].leixing!=-1)
{
printf("你弃掉了电脑的");
((*w2).pandingpai)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).pandingpai)[y];
((*w2).pandingshu)--;
(*qipaishu)++;
((*w2).pandingpai)[y].leixing=-1;
break;
}
else printf("你弃掉了一张空气!\n");
}
break;
default:break;
}
}
else
{
if((*w2).zhuangbeishu)
{
if((*w2).zhuangbei[1].leixing!=-1)
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[1].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[1];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[1].leixing=-1;
}
else if((*w2).zhuangbei[3].leixing!=-1)
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[3].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[3];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[3].leixing=-1;
((*w1).juli[0])--;
}
else if((*w2).zhuangbei[0].leixing!=-1)
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[0].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
}
else
{
printf("电脑弃掉了玩家的");
((*w2).zhuangbei)[2].Kanpai();
qipaidui[*qipaishu]=((*w2).zhuangbei)[2];
((*w2).zhuangbeishu)--;
(*qipaishu)++;
((*w2).zhuangbei)[2].leixing=-1;
((*w2).juli[0])++;
}
}
else
{
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("电脑弃掉了玩家的手牌");
((*w2).shoupai)[y].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
}
}
}
void Qian(wujiang *w1,wujiang *w2)
{
int i,x,y;
if((*w1).juese)
{
for(;;)
{
if((*w2).shoupaishu+(*w2).zhuangbeishu+(*w2).pandingshu==0)
{
printf("对方空城啦!你牵走了一张寂寞!\n");
break;
}
else
{
printf("请选择想牵的区域,输入选项之前的编号,以回车结束!\n0 手牌\n1 装备区\n2 判定区\n");
scanf("%d",&x);
if(x==0&&((*w2).shoupaishu==0))printf("你牵走了一张空气!\n");
else if(x==1&&((*w2).zhuangbeishu==0))printf("你牵走了一张空气!\n");
else if(x==2&&((*w2).pandingshu==0))printf("你牵走了一张空气!\n");
else if(x>=0&&x<=2)break;
else printf("你牵走了太空区里的一张牌!\n");
}
}
switch(x)
{
case 0:
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("你牵走了电脑的");
((*w2).shoupai)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
((*w1).shoupaishu)++;
break;
case 1:
for(;;)
{
(*w2).Kanzhuangbei();
printf("请输入装备之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((((*w2).zhuangbei[y]).leixing!=-1)&&(y>=0)&&(y<=3))
{
printf("你牵走了电脑的");
((*w2).zhuangbei)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[y];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[y].leixing=-1;
if(!y)((*w2).zhuangbei[y]).changdu=1;
else if(y==2)((*w2).juli[0])++;
else if(y==3)((*w1).juli[0])--;
break;
}
else printf("你弃掉了一张空气!\n");
}
break;
case 2:
for(;;)
{
(*w2).Kanpandingpai();
printf("请输入判定牌之前的编号,以回车键结束!\n");
scanf("%d",&y);
if((*w2).pandingpai[y].leixing!=-1)
{
printf("你牵走了电脑的");
((*w2).pandingpai)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).pandingpai)[y];
((*w2).pandingshu)--;
((*w1).shoupaishu)++;
((*w2).pandingpai)[y].leixing=-1;
break;
}
else printf("你牵走了一张空气!\n");
}
break;
default:break;
}
}
else
{
if((*w2).zhuangbeishu)
{
if((*w2).zhuangbei[1].leixing!=-1)
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[1].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[1];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[1].leixing=-1;
}
else if((*w2).zhuangbei[3].leixing!=-1)
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[3].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[3];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[3].leixing=-1;
((*w1).juli[0])--;
}
else if((*w2).zhuangbei[0].leixing!=-1)
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[0].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
}
else
{
printf("电脑牵走了玩家的");
((*w2).zhuangbei)[2].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[2];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[2].leixing=-1;
((*w2).juli[0])--;
}
}
else
{
srand((unsigned)time(NULL));
y=rand()%((*w2).shoupaishu);
printf("电脑牵走了玩家的手牌");
((*w2).shoupai)[y].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).shoupai)[y];
for(i=y+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
((*w1).shoupaishu)++;
}
}
}
void Wuzhong(wujiang*w1,pai A[104],int *x,pai B[104],int*y)
{
Mopai(&((*w1).shoupaishu),(*w1).shoupai,A,x,B,y,(*w1).juese);
}
int Juedou(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
int i,j,x;
if((*w1).juese)
{
for(;;)
{
j=0;
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==101)
{
printf("电脑打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
}
if(!j)
{
printf("玩家对电脑造成1点伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
j=0;
for(;;)
{
printf("请打出一张【杀】响应【决斗】,否则你将受到1点伤害!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w1).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w1).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
int i;
((*w1).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w2,w1,qipaidui,qipaishu);
return i;
break;
}
else if(((*w1).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w1,qipaidui,qipaishu);
p.paifu=-1;
printf("打出!\n");
j=1;
break;
}
else if((*w1).shoupai[x].leixing==101)
{
printf("玩家打出");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
}
}
else
{
for(;;)
{
j=0;
for(;;)
{
printf("请打出一张【杀】响应【决斗】,否则你将受到1点伤害!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w1).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w2).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
int i;
((*w2).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
else if(((*w2).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w2,qipaidui,qipaishu);
p.paifu=-1;
printf("打出!\n");
j=1;
break;
}
else if((*w2).shoupai[x].leixing==101)
{
printf("玩家打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
j=0;
for(x=0;x<((*w1).shoupaishu);x++)
{
if((*w1).shoupai[x].leixing==101)
{
printf("电脑打出");
((*w1).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w1).shoupai)[x];
for(int i=x+1;i<=((*w1).shoupaishu);i++)((*w1).shoupai)[i-1]=((*w1).shoupai)[i];
((*w1).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
}
if(!j)
{
printf("玩家对电脑造成1点伤害!\n");
((*w2).tili)--;
i=Binsi(w2,w1,qipaidui,qipaishu);
return i;
break;
}
}
}
}
int Jiedao(wujiang*w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int i,j=0,x;
if((*w1).juese)
{
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==101)
{
printf("电脑对玩家使用");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
}
if(j)
{
i=Sha(w2,w1,paidui,paiduishu,qipaidui,qipaishu);
return i;
printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
}
else
{
printf("电脑放弃使用【杀】,玩家获得电脑的武器");
(*w2).zhuangbei[0].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
(*w1).Kanshoupai();
return 0;
}
}
else
{
for(;;)
{
printf("请对电脑使用一张【杀】,否则电脑将获得你的武器!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w2).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w2).Kanshoupai();
scanf("%d",&x);
if(x==-1)break;
else if(((*w2).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w2,qipaidui,qipaishu);
p.paifu=-1;
printf("使用!\n");
j=1;
break;
}
else if((*w2).shoupai[x].leixing==101)
{
printf("玩家对电脑使用");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
j=1;
break;
}
else printf("你确定你使用的是【杀】?\n");
}
if(j)
{
i=Sha(w2,w1,paidui,paiduishu,qipaidui,qipaishu);
return i;
printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
else
{
printf("玩家放弃使用【杀】,电脑获得玩家的武器");
((*w2).zhuangbei)[0].Kanpai();
(*w1).shoupai[(*w1).shoupaishu]=((*w2).zhuangbei)[0];
((*w2).zhuangbeishu)--;
((*w1).shoupaishu)++;
((*w2).zhuangbei)[0].leixing=-1;
((*w2).zhuangbei)[0].changdu=1;
return 0;
}
}
}
void Taoyuan(wujiang*w)
{
if((*w).tili<(*w).tilishangxian)
{
((*w).tili)++;
if((*w).juese)printf("玩家");
else printf("电脑");
printf("恢复1点体力!\n");
}
}
void Kaipai(pai paidui[104],int* paiduishu,int renshu,pai wugu[10])
{
int i;
printf("五谷丰登开牌:\n");
for(i=1;i<=renshu;i++)
{
wugu[i-1]=paidui[104-(*paiduishu)];
(*paiduishu)--;
printf("%d ",i-1);
wugu[i-1].Kanpai();
}
}
void Qupai(pai wugu[10],wujiang*w)
{
int i,x;
printf("五谷丰登开牌:\n");
for(i=0;(wugu[i].leixing)!=-1;i++)
{
printf("%d ",i);
wugu[i].Kanpai();
}
if((*w).juese)
{
for(;;)
{
printf("请选择你想要的卡牌,输入卡牌之前的编号,以回车结束!\n");
scanf("%d",&x);
if(wugu[x].leixing!=-1)
{
printf("玩家选择");
wugu[x].Kanpai();
(*w).shoupai[(*w).shoupaishu]=wugu[x];
((*w).shoupaishu)++;
for(i=x+1;i<=9;i++)wugu[i-1]=wugu[i];
wugu[9].leixing=-1;
break;
}
printf("你选择了一张空气加入手牌!");
}
}
else
{
printf("电脑选择");
wugu[0].Kanpai();
(*w).shoupai[(*w).shoupaishu]=wugu[0];
((*w).shoupaishu)++;
for(i=1;i<=9;i++)wugu[i-1]=wugu[i];
wugu[9].leixing=-1;
}
}
void Rengpai(pai wugu[10],pai qipaidui[104],int*qipaishu)
{
int i;
for(i=0;wugu[i].leixing!=-1;i++)
{
qipaidui[*qipaishu]=wugu[i];
(*qipaishu)++;
wugu[i].leixing=-1;
}
}
int Nanman(wujiang*w1,wujiang*w2,pai qipaidui[104],int*qipaishu)
{
int i,x;
if((*w1).juese)
{
for(x=0;x<((*w2).shoupaishu);x++)
{
if((*w2).shoupai[x].leixing==101)
{
printf("电脑打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(int i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
}
printf("玩家对电脑造成1点伤害!\n");
((*w2).tili)--;
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else
{
for(;;)
{
printf("请打出一张【杀】响应【南蛮入侵】,否则你将受到1点伤害!\n请输入手牌之前的编号,或者输入“-1”放弃出【杀】,以回车结束!\n");
if(((*w2).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
(*w2).Kanshoupai();
scanf("%d",&x);
if(x==-1)
{
int i;
((*w2).tili)--;
printf("电脑对玩家造成1点伤害!\n");
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
break;
}
else if(((*w2).zhuangbei[0].leixing==305)&&x==100)
{
pai p=Zhangba(w2,qipaidui,qipaishu);
p.paifu=-1;
printf("使用!\n");
return 0;
break;
}
else if((*w2).shoupai[x].leixing==101)
{
printf("玩家打出");
((*w2).shoupai)[x].Kanpai();
qipaidui[*qipaishu]=((*w2).shoupai)[x];
for(i=x+1;i<=((*w2).shoupaishu);i++)((*w2).shoupai)[i-1]=((*w2).shoupai)[i];
((*w2).shoupaishu)--;
(*qipaishu)++;
return 0;
break;
}
else printf("你确定你打出的是【杀】?\n");
}
}
}
int Wanjian(wujiang*w1,wujiang*w2,pai paidui[104],int*paiduishu,pai qipaidui[104],int*qipaishu)
{
int i;
i=Shan(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1)
{
i=Binsi(w1,w2,qipaidui,qipaishu);
return i;
}
else return 0;
}
int Chupai(pai paidui[104],pai qipaidui[104],int *paiduishu,int*qipaishu,wujiang*w1,wujiang*w2,pai yuanshipaidui[2][4][13])
{
pai p1;
int sha=1;int y=-1,i,t=((*w1).shoupaishu)-1;
for(;;t--)
{
if((*w1).juese)
{
printf("\n电脑当前手牌数:%d\n",((*w2).shoupaishu));
(*w2).Kanzhuangbei();
(*w1).Kanshoupai();
(*w1).Kanzhuangbei();
}
int j=0;
if((*w1).juese&&((*w1).zhuangbei[0].leixing==305))printf("如果想发动【丈八蛇矛】效果,请输入“100”,以回车结束!\n");
y=Xuanpai(w1,t);
p1=Panpai(w1,&sha,y,qipaidui,qipaishu);
if((p1).leixing==-1)break;
else if((p1).leixing==0)continue;
else
{
int duixiang;
duixiang=Mubiao(p1,w1,w2,&sha);
if(duixiang==-2)continue;
else
{
Da1pai(w1,w2,qipaidui,qipaishu,y);
Miaoshu(p1,((*w1).juese),duixiang);
if(!((*w1).juese))
{
printf("\n电脑当前手牌数:%d\n",((*w1).shoupaishu));
(*w1).Kanzhuangbei();
(*w2).Kanshoupai();
(*w2).Kanzhuangbei();
}
switch(p1.leixing)
{
case 101:
i=Sha(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1){return -1;break;}
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
break;
case 103:
Tao(w1);
break;
case 201:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Chai(w1,w2,qipaidui,qipaishu);
else;
if((*w1).juese)(*w1).Kanshoupai();
break;
case 202:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Qian(w1,w2);
else;
if((*w1).juese)(*w1).Kanshoupai();
break;
case 203:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Wuzhong(w1,paidui,paiduishu,qipaidui,qipaishu);
else;
break;
case 204:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Juedou(w1,w2,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 205:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Jiedao(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 206:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Taoyuan(w1);
j=0;
for(;;)
{
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Taoyuan(w2);
break;
case 207:
pai wugu[10];
for(i=1;i<=10;i++)wugu[i-1].leixing=-1;
Kaipai(paidui,paiduishu,2,wugu);
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Qupai(wugu,w1);
for(;;)
{
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))Qupai(wugu,w2);
Rengpai(wugu,qipaidui,qipaishu); printf("弃牌数:%d\n",*qipaishu);
break;
case 208:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Nanman(w1,w2,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 209:
for(;;)
{
i=Wuxie(&p1,w1,w2,qipaidui,qipaishu,0);
if(!i)break;
j++;
i=Wuxie(&p1,w2,w1,qipaidui,qipaishu,0);
if(!i)break;
j++;
}
if(!(j%2))
{
i=Wanjian(w1,w2,paidui,paiduishu,qipaidui,qipaishu);
if(i==-1)return -1;
if((*w1).juese)printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w1).tili,(*w1).tilishangxian,(*w2).tili,(*w2).tilishangxian);
else printf("玩家当前体力值:%d/%d\n电脑当前体力值:%d/%d\n",(*w2).tili,(*w2).tilishangxian,(*w1).tili,(*w1).tilishangxian);
}
break;
case 361:
case 362:
case 363:
((*w1).juli[0])--;break;
case 381:
case 382:
case 383:
((*w2).juli[0])++;break;
default:break;
}
printf("\n");
}
}
}
return 0;
}
void Qipai(pai shoupai[20],int *shoupaishu,pai qipaidui[104],int *qipaishu,int juese,int *shoupaishangxian)
{
int x;
if((*shoupaishu)>(*shoupaishangxian))
{
if(juese!=1&&juese!=0)printf("身份参数错误!");
int q=(*shoupaishu)-(*shoupaishangxian);
int i,j;
for(j=1;j<=q;j++)
{
for(;;)
{
if(juese)
{
printf("弃牌请输入手牌之前的编号,以回车结束!\n注:一次只能弃一张牌\n");
printf("手牌数:%d\n",*shoupaishu);
scanf("%d",&x);
if(x>=0&&x<(*shoupaishu))break;
else printf("你弃掉了一张空气!\n");
}
else
{
srand((unsigned)time(NULL));
x=rand()%(*shoupaishu);
break;
}
}
qipaidui[*qipaishu]=shoupai[x];
for(i=x+1;i<=(*shoupaishu);i++)shoupai[i-1]=shoupai[i];
(*shoupaishu)--;
if(juese)printf("弃牌阶段玩家弃置");
else printf("弃牌阶段电脑弃置");
qipaidui[*qipaishu].Kanpai();
(*qipaishu)++;
int m;
if(juese)
{
printf("玩家当前手牌:\n");
for(m=0;m<=(*shoupaishu-1);m++)
{
printf("%d ",m);
(shoupai[m]).Kanpai();
}
} printf("弃牌堆:%d\n",*qipaishu);
}
}
}
int Huihe(pai A[104],pai B[104],int *x,int *y,pai yuanshipaidui[2][4][13],wujiang *w1,wujiang *w2)
{
printf("\n回合开始阶段……\n");
switch((*w1).huihekaishi)
{
case 0:break;
default:printf("回合开始阶段参数错误!\n");break;
}
printf("判定阶段……\n");
int K=0;
if((*w1).pandingshu>0)
{
int i,j;
for(;(*w1).pandingshu;)
{
switch((*w1).pandingpai[0].leixing)
{
case 251:printf("【乐不思蜀】开始判定……\n"); break;
case 252:printf("【闪电】开始判定……\n");break;
default:printf("【??】开始判定……\n");break;
}
j=0;
pai p=((*w1).pandingpai[0]);
for(;;)//在判定之前询问【无懈】
{
i=Wuxie(&p,w2,w1,B,y,0);
if(!i)break;
j++;
i=Wuxie(&p,w1,w2,B,y,0);
if(!i)break;
j++;
}
switch((*w1).pandingpai[0].leixing)
{
case 251:
if(!(j%2))
{
printf("【乐不思蜀】的判定牌是:");
Panding(A,x,B,y);
if((B[(*y)-1].huase)!=1)
{
printf("【乐不思蜀】判定成功!\n");
if((*w1).juese)printf("玩家");
else printf("电脑");
printf("跳过出牌阶段!\n");
K=-1;
}
else printf("【乐不思蜀】判定失败!\n");
}
B[*y]=(*w1).pandingpai[0];
((*w1).pandingshu)--;
(*w1).pandingpai[0]=(*w1).pandingpai[1];
(*w1).pandingpai[1]=(*w1).pandingpai[2];
(*w1).pandingpai[2].leixing=-1;
(*y)++;
break;
case 252:
if(!(j%2))
{
printf("【闪电】的判定牌是:");
Panding(A,x,B,y);
if((B[(*y)-1].huase==0)&&(B[(*y)-1].dianshu>=1)&&(B[(*y)-1].dianshu<=8))
{
printf("【闪电】判定成功!\n");
if((*w1).juese)printf("玩家");
else printf("电脑");
printf("受到3点雷电伤害!");
((*w1).tili)=((*w1).tili)-3;
i=Binsi(w2,w1,B,y);
B[*y]=(*w1).pandingpai[0];
((*w1).pandingshu)--;
(*w1).pandingpai[0]=(*w1).pandingpai[1];
(*w1).pandingpai[1]=(*w1).pandingpai[2];
(*w1).pandingpai[2].leixing=-1;
(*y)++;
if(i==-1)return -1;
}
else
{
printf("【闪电】判定失败!\n");
(*w2).pandingpai[2]=(*w2).pandingpai[1];
(*w2).pandingpai[1]=(*w2).pandingpai[0];
(*w2).pandingpai[0]=(*w1).pandingpai[0];
(*w1).pandingpai[0]=(*w1).pandingpai[1];
(*w1).pandingpai[1]=(*w1).pandingpai[2];
(*w1).pandingpai[2].leixing=-1;
((*w1).pandingshu)--;
((*w2).pandingshu)++;
}
break;
}
default:printf("判定牌错误!");
} printf("弃牌数:%d\n",*y);
}
}
else if(!((*w1).pandingshu));
else printf("判定阶段参数错误!\n");
printf("摸牌阶段……\n");
switch((*w1).mopai)
{
case 0:Mopai(&((*w1).shoupaishu),(*w1).shoupai,A,x,B,y,(*w1).juese);break;
case -1:break;
default:printf("摸牌阶段参数错误!\n");break;
}
if(K==-1)goto M;
printf("出牌阶段……\n");
switch((*w1).chupai)
{
case 0:
{
int i;
i=Chupai(A,B,x,y,w1,w2,yuanshipaidui);
if(i==-1)
{
return -1;
break;
}
else break;
}
case -1:break;
default:printf("出牌阶段参数错误!\n");break;
}
M:
printf("弃牌阶段……\n");
switch((*w1).qipai)
{
case 0:
Qipai((*w1).shoupai,&((*w1).shoupaishu),B,y,(*w1).juese,&((*w1).tili));break;
default:printf("弃牌阶段参数错误!\n");break;
}
printf("回合结束阶段……\n");
switch((*w1).huihejieshu)
{
case 0:break;
default:printf("回合结束阶段参数错误!\n");break;
}
return 0;
}
int main()
{
void Kanshoupai(pai p);
pai yuanshipaidui[2][4][13],qipaidui[104],paidui[104];
wujiang wanjia,com;
com.tili=wanjia.tili=5;
com.tilishangxian=wanjia.tilishangxian=5;
com.huihekaishi=wanjia.huihekaishi=0;
com.panding=wanjia.panding=0;
com.mopai=wanjia.mopai=0;
com.chupai=wanjia.chupai=0;
com.qipai=wanjia.qipai=0;
com.huihejieshu=wanjia.huihejieshu=0;
com.shoupaishu=wanjia.shoupaishu=0;
com.pandingshu=wanjia.pandingshu=0;
com.zhuangbeishu=wanjia.zhuangbeishu=0;
com.juese=0;wanjia.juese=1;
pai p;
p.leixing=-1;
com.zhuangbei[0]=com.zhuangbei[1]=com.zhuangbei[2]=com.zhuangbei[3]=wanjia.zhuangbei[0]=wanjia.zhuangbei[1]=wanjia.zhuangbei[2]=wanjia.zhuangbei[3]=p;
com.zhuangbei[0].changdu=wanjia.zhuangbei[0].changdu=1;
com.pandingpai[0]=com.pandingpai[1]=com.pandingpai[2]=wanjia.pandingpai[0]=wanjia.pandingpai[1]=wanjia.pandingpai[2]=p;
com.juli[0]=wanjia.juli[0]=1;
int a,b,c;
for(a=0;a<=1;a++)
{
for(b=0;b<=3;b++)
{
for(c=0;c<=12;c++)
{
yuanshipaidui[a][b][c].paifu=a;
yuanshipaidui[a][b][c].huase=b;
yuanshipaidui[a][b][c].dianshu=c;
}
}
}
yuanshipaidui[0][0][0].leixing=204;
yuanshipaidui[0][0][1].leixing=331;
yuanshipaidui[0][0][2].leixing=201;
yuanshipaidui[0][0][3].leixing=201;
yuanshipaidui[0][0][4].leixing=304;yuanshipaidui[0][0][4].changdu=3;
yuanshipaidui[0][0][5].leixing=251;
yuanshipaidui[0][0][6].leixing=101;
yuanshipaidui[0][0][7].leixing=101;
yuanshipaidui[0][0][8].leixing=101;
yuanshipaidui[0][0][9].leixing=101;
yuanshipaidui[0][0][10].leixing=202;
yuanshipaidui[0][0][11].leixing=201;
yuanshipaidui[0][0][12].leixing=208;
yuanshipaidui[0][1][0].leixing=209;
yuanshipaidui[0][1][1].leixing=102;
yuanshipaidui[0][1][2].leixing=103;
yuanshipaidui[0][1][3].leixing=103;
yuanshipaidui[0][1][4].leixing=308;yuanshipaidui[0][1][4].changdu=5;
yuanshipaidui[0][1][5].leixing=103;
yuanshipaidui[0][1][6].leixing=103;
yuanshipaidui[0][1][7].leixing=103;
yuanshipaidui[0][1][8].leixing=103;
yuanshipaidui[0][1][9].leixing=101;
yuanshipaidui[0][1][10].leixing=101;
yuanshipaidui[0][1][11].leixing=103;
yuanshipaidui[0][1][12].leixing=102;
yuanshipaidui[0][2][0].leixing=204;
yuanshipaidui[0][2][1].leixing=101;
yuanshipaidui[0][2][2].leixing=101;
yuanshipaidui[0][2][3].leixing=101;
yuanshipaidui[0][2][4].leixing=101;
yuanshipaidui[0][2][5].leixing=101;
yuanshipaidui[0][2][6].leixing=101;
yuanshipaidui[0][2][7].leixing=101;
yuanshipaidui[0][2][8].leixing=101;
yuanshipaidui[0][2][9].leixing=101;
yuanshipaidui[0][2][10].leixing=101;
yuanshipaidui[0][2][11].leixing=205;
yuanshipaidui[0][2][12].leixing=205;
yuanshipaidui[0][3][0].leixing=204;
yuanshipaidui[0][3][1].leixing=102;
yuanshipaidui[0][3][2].leixing=102;
yuanshipaidui[0][3][3].leixing=102;
yuanshipaidui[0][3][4].leixing=102;
yuanshipaidui[0][3][5].leixing=101;
yuanshipaidui[0][3][6].leixing=101;
yuanshipaidui[0][3][7].leixing=101;
yuanshipaidui[0][3][8].leixing=101;
yuanshipaidui[0][3][9].leixing=101;
yuanshipaidui[0][3][10].leixing=102;
yuanshipaidui[0][3][11].leixing=103;
yuanshipaidui[0][3][12].leixing=101;
yuanshipaidui[1][0][0].leixing=252;
yuanshipaidui[1][0][1].leixing=302;yuanshipaidui[1][0][1].changdu=2;
yuanshipaidui[1][0][2].leixing=202;
yuanshipaidui[1][0][3].leixing=202;
yuanshipaidui[1][0][4].leixing=383;
yuanshipaidui[1][0][5].leixing=303;yuanshipaidui[1][0][5].changdu=2;
yuanshipaidui[1][0][6].leixing=208;
yuanshipaidui[1][0][7].leixing=101;
yuanshipaidui[1][0][8].leixing=101;
yuanshipaidui[1][0][9].leixing=101;
yuanshipaidui[1][0][10].leixing=210;
yuanshipaidui[1][0][11].leixing=305;yuanshipaidui[1][0][11].changdu=3;
yuanshipaidui[1][0][12].leixing=362;
yuanshipaidui[1][1][0].leixing=206;
yuanshipaidui[1][1][1].leixing=102;
yuanshipaidui[1][1][2].leixing=207;
yuanshipaidui[1][1][3].leixing=207;
yuanshipaidui[1][1][4].leixing=361;
yuanshipaidui[1][1][5].leixing=251;
yuanshipaidui[1][1][6].leixing=203;
yuanshipaidui[1][1][7].leixing=203;
yuanshipaidui[1][1][8].leixing=203;
yuanshipaidui[1][1][9].leixing=101;
yuanshipaidui[1][1][10].leixing=203;
yuanshipaidui[1][1][11].leixing=201;
yuanshipaidui[1][1][12].leixing=381;
yuanshipaidui[1][2][0].leixing=301;yuanshipaidui[1][2][0].changdu=1;
yuanshipaidui[1][2][1].leixing=331;
yuanshipaidui[1][2][2].leixing=201;
yuanshipaidui[1][2][3].leixing=201;
yuanshipaidui[1][2][4].leixing=382;
yuanshipaidui[1][2][5].leixing=251;
yuanshipaidui[1][2][6].leixing=208;
yuanshipaidui[1][2][7].leixing=101;
yuanshipaidui[1][2][8].leixing=101;
yuanshipaidui[1][2][9].leixing=101;
yuanshipaidui[1][2][10].leixing=101;
yuanshipaidui[1][2][11].leixing=210;
yuanshipaidui[1][2][12].leixing=210;
yuanshipaidui[1][3][0].leixing=301;yuanshipaidui[1][3][0].changdu=1;
yuanshipaidui[1][3][1].leixing=102;
yuanshipaidui[1][3][2].leixing=202;
yuanshipaidui[1][3][3].leixing=202;
yuanshipaidui[1][3][4].leixing=306;yuanshipaidui[1][3][4].changdu=3;
yuanshipaidui[1][3][5].leixing=102;
yuanshipaidui[1][3][6].leixing=102;
yuanshipaidui[1][3][7].leixing=102;
yuanshipaidui[1][3][8].leixing=102;
yuanshipaidui[1][3][9].leixing=102;
yuanshipaidui[1][3][10].leixing=102;
yuanshipaidui[1][3][11].leixing=307;yuanshipaidui[1][3][11].changdu=4;
yuanshipaidui[1][3][12].leixing=363;
int paiduishu=104;
int qipaishu=0;
printf("游戏开始! by cyh\n");
Qishixipai(yuanshipaidui,paidui);
Qishishoupai(&wanjia,paidui,&(paiduishu),qipaidui,&(qipaishu));
Qishishoupai(&com,paidui,&(paiduishu),qipaidui,&(qipaishu));
int i;
for(;;)
{
i=Huihe(paidui,qipaidui,&paiduishu,&qipaishu,yuanshipaidui,&wanjia,&com);
if(i==-1)break;
i=Huihe(paidui,qipaidui,&paiduishu,&qipaishu,yuanshipaidui,&com,&wanjia);
if(i==-1)break;
}
}
中级天翼
亮瞎你的狗眼!!!
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include<stdlib.h>
#include<time.h>
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
while(1)
{
cout<<rand()<<endl;
system("color 01");
cout<<rand()<<endl;
system("color 12");
cout<<rand()<<endl;
system("color 20");
cout<<rand()<<endl;
system("color 33");
cout<<rand()<<endl;
system("color 45");
cout<<rand()<<endl;
system("color 5D");
cout<<rand()<<endl;
system("color 64");
cout<<rand()<<endl;
system("color 76");
cout<<rand()<<endl;
system("color 88");
cout<<rand()<<endl;
system("color 9A");
cout<<rand()<<endl;
system("color A9");
cout<<rand()<<endl;
system("color BC");
cout<<rand()<<endl;
system("color CB");
cout<<rand()<<endl;
system("color DF");
cout<<rand()<<endl;
system("color E7");
cout<<rand()<<endl;
system("color FE");
cout<<rand()<<endl;
system("cls");
}
return 0;
}