📄 unit1.cpp
字号:
rightcom.insertmj(mjot.takeone(true));
fapai_num+=4;
}
else
{
rightcom.insertmj(mjot.takeone(true));
fapai_num+=1;
}
clearform(Rect(687,37,735,532));
rightcom.resetbegin();
rightcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
break;
}
fapai_dir=fapai_dir==0?3:fapai_dir-1;
break;
case UpWaitForPG:
if(flag_pg==1)
{
upcom.peng();
gang=false;
}
else
{
upcom.gang();
gang=true;
}
clearform(Rect(132,20,627,68));
upcom.resetbegin();
upcom.draw(imagetype);
clearform(Rect(278,120,528,400));
mjots.draw(imagetype);
if(flag_pg==2&&upcom.wanttohu(true))
{
flag_zimo=true;
gamestat=UpWaitForHu;
}
else if(upcom.wanttobugang())
gamestat=UpWaitForBu;
else
gamestat=UpWaitForChu;
break;
case UpWaitForMo:
if(mjot.getcount()<8)
{
gamestat=WaitForHuangZhuang;
//timer->Enabled=true;
break;
}
gang=false;
if(upcom.mo())////
{
clearform(Rect(132,20,627,68));
upcom.resetbegin();
}
upcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(upcom.wanttohu(true))
{
gamestat=UpWaitForHu;
flag_zimo=true;
break;
}
if(upcom.wanttobugang())
gamestat=UpWaitForBu;
else gamestat=UpWaitForChu;
break;
case UpWaitForBu:
upcom.bugang();
gang=true;
clearform(Rect(132,20,627,68));
upcom.resetbegin();
upcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(upcom.wanttohu(true))
{
flag_zimo=true;
gamestat=UpWaitForHu;
}
else if(upcom.wanttobugang())
gamestat=UpWaitForBu;
else
gamestat=UpWaitForChu;
break;
case UpWaitForChu:
upcom.chu();
clearform(Rect(132,20,627,68));
upcom.resetbegin();
upcom.draw(imagetype);
//clearform(Rect(278,120,528,400));
mjots.draw(imagetype);
if(downplayer.canpeng()){
playerPGflag=(btstat)(playerPGflag|btPeng);
flag_bugang=flag_zimo=false;
}
if(downplayer.cangang())
{ flag_bugang=false;
playerPGflag=(btstat)(playerPGflag|btGang);
}
if(downplayer.canhu(false))
{
playerPGflag=(btstat)(playerPGflag|btHu);
flag_zimo=false;
}
if(playerPGflag!=0)
{
drawbt(playerPGflag);
gamestat=PlayerWaitForSelectBtn;
laststat=LeftWaitForMo;
timer->Enabled=false;
break;
}
if(leftcom.wanttohu(false))
{
gamestat=LeftWaitForHu;
flag_zimo=false;
loser=2;
break;
}
if(rightcom.wanttohu(false))
{
gamestat=RightWaitForHu;
flag_zimo=false;
loser=2;
break;
}
if(leftcom.wanttopeng())
{
gamestat=LeftWaitForPG;
flag_pg=1;
break;
}
if(leftcom.wanttogang())
{
gamestat=LeftWaitForPG;
flag_pg=2;
break;
}
if(rightcom.wanttopeng())
{
gamestat=RightWaitForPG;
flag_pg=1;
break;
}
if(rightcom.wanttogang())
{
gamestat=RightWaitForPG;
flag_pg=2;
break;
}
gamestat=LeftWaitForMo;
break;
case LeftWaitForPG:
if(flag_pg==1)
{
leftcom.peng();
gang=false;
}
else
{
leftcom.gang();
gang=true;
}
clearform(Rect(52,33,100,528));
leftcom.resetbegin();
leftcom.draw(imagetype);
clearform(Rect(278,120,528,400));
mjots.draw(imagetype);
if(flag_pg==2&&leftcom.wanttohu(true))
{
flag_zimo=true;
gamestat=LeftWaitForHu;
}
else if(leftcom.wanttobugang())
gamestat=LeftWaitForBu;
else
gamestat=LeftWaitForChu;
break;
case LeftWaitForMo:
if(mjot.getcount()<8)
{
gamestat=WaitForHuangZhuang;
//timer->Enabled=true;
break;
}
gang=false;
if(leftcom.mo())////
{
clearform(Rect(52,33,100,528));
leftcom.resetbegin();
}
leftcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(leftcom.wanttohu(true))
{
gamestat=LeftWaitForHu;
flag_zimo=true;
break;
}
if(leftcom.wanttobugang())
gamestat=LeftWaitForBu;
else gamestat=LeftWaitForChu;
break;
case LeftWaitForBu:
leftcom.bugang();
gang=true;
clearform(Rect(52,33,100,528));
leftcom.resetbegin();
leftcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(leftcom.wanttohu(true))
{
flag_zimo=true;
gamestat=LeftWaitForHu;
}
else if(leftcom.wanttobugang())
gamestat=LeftWaitForBu;
else
gamestat=LeftWaitForChu;
break;
case LeftWaitForChu:
leftcom.chu();
clearform(Rect(52,33,100,528));
leftcom.resetbegin();
leftcom.draw(imagetype);
//clearform(Rect(278,120,528,400));
mjots.draw(imagetype);
if(downplayer.canpeng()){
playerPGflag=(btstat)(playerPGflag|btPeng);
flag_bugang=flag_zimo=false;
}
if(downplayer.cangang())
{ flag_bugang=false;
playerPGflag=(btstat)(playerPGflag|btGang);
}
if(downplayer.canhu(false))
{
playerPGflag=(btstat)(playerPGflag|btHu);
flag_zimo=false;
}
if(playerPGflag!=0)
{
drawbt(playerPGflag);
gamestat=PlayerWaitForSelectBtn;
laststat=PlayerWaitForChu;
timer->Enabled=false;
break;
}
if(rightcom.wanttohu(false))
{
gamestat=RightWaitForHu;
flag_zimo=false;
loser=1;
break;
}
if(upcom.wanttohu(false))
{
gamestat=UpWaitForHu;
flag_zimo=false;
loser=1;
break;
}
if(upcom.wanttopeng())
{
gamestat=UpWaitForPG;
flag_pg=1;
break;
}
if(upcom.wanttogang())
{
gamestat=UpWaitForPG;
flag_pg=2;
break;
}
if(rightcom.wanttopeng())
{
gamestat=RightWaitForPG;
flag_pg=1;
break;
}
if(rightcom.wanttogang())
{
gamestat=RightWaitForPG;
flag_pg=2;
break;
}
if(mjot.getcount()<8)
{
gamestat=WaitForHuangZhuang;
// timer->Enabled=true;
break;
}
gang=false;
if(downplayer.mo())////
{
clearform(Rect(153,454,648,502));
downplayer.resetbegin();
}
downplayer.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(downplayer.canbugang())
{
flag_bugang=true;
playerPGflag=btGang;
}
if(downplayer.canhu(true))
{
flag_zimo=true;
playerPGflag=(btstat)(playerPGflag|btHu);
}
if(playerPGflag!=0)
{
gamestat=PlayerWaitForSelectBtn;
drawbt(playerPGflag);
timer->Enabled=false;
break;
}
drawbt(btNo);
gamestat=PlayerWaitForChu;
timer->Enabled=false;
break;
case RightWaitForPG:
if(flag_pg==1)
{
rightcom.peng();
gang=false;
}
else
{
rightcom.gang();
gang=true;
}
clearform(Rect(687,37,735,532));
rightcom.resetbegin();
rightcom.draw(imagetype);
clearform(Rect(278,120,528,400));
mjots.draw(imagetype);
if(flag_pg==2&&rightcom.wanttohu(true))
{
flag_zimo=true;
gamestat=RightWaitForHu;
}
else if(rightcom.wanttobugang())
gamestat=RightWaitForBu;
else
gamestat=RightWaitForChu;
break;
case RightWaitForMo:
if(mjot.getcount()<8)
{
gamestat=WaitForHuangZhuang;
// timer->Enabled=true;
break;
}
gang=false;
if(rightcom.mo())////
{
clearform(Rect(687,37,735,532));
rightcom.resetbegin();
}
rightcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(rightcom.wanttohu(true))
{
gamestat=RightWaitForHu;
flag_zimo=true;
break;
}
if(rightcom.wanttobugang())
gamestat=RightWaitForBu;
else gamestat=RightWaitForChu;
break;
case RightWaitForBu:
rightcom.bugang();
gang=true;
clearform(Rect(687,37,735,532));
rightcom.resetbegin();
rightcom.draw(imagetype);
clearmjot();
mjot.draw(imagetype);
if(rightcom.wanttohu(true))
{
flag_zimo=true;
gamestat=RightWaitForHu;
}
else if(rightcom.wanttobugang())
gamestat=RightWaitForBu;
else
gamestat=RightWaitForChu;
break;
case RightWaitForChu:
rightcom.chu();
clearform(Rect(687,37,735,532));
rightcom.resetbegin();
rightcom.draw(imagetype);
//clearform(Rect(278,120,528,400));
mjots.draw(imagetype);
if(downplayer.canpeng()){
playerPGflag=(btstat)(playerPGflag|btPeng);
flag_bugang=flag_zimo=false;
}
if(downplayer.cangang())
{ flag_bugang=false;
playerPGflag=(btstat)(playerPGflag|btGang);
}
if(downplayer.canhu(false))
{
playerPGflag=(btstat)(playerPGflag|btHu);
flag_zimo=false;
}
if(playerPGflag!=0)
{
drawbt(playerPGflag);
gamestat=PlayerWaitForSelectBtn;
laststat=UpWaitForMo;
timer->Enabled=false;
break;
}
if(upcom.wanttohu(false))
{
gamestat=UpWaitForHu;
flag_zimo=false;
loser=3;
break;
}
if(leftcom.wanttohu(false))
{
gamestat=LeftWaitForHu;
flag_zimo=false;
loser=3;
break;
}
if(leftcom.wanttopeng())
{
gamestat=LeftWaitForPG;
flag_pg=1;
break;
}
if(leftcom.wanttogang())
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -