menu6.cpp
来自「经典三国志游戏代码」· C++ 代码 · 共 39 行
CPP
39 行
/* 谋略菜单 */
void menu6(int x,int y)
{int size,buttons=0,temp,temp1,temp2;
char *buffer;
size=imagesize(352,315,402,405);
buffer=malloc(size);
cursoroff();
getimage(352,315,402,405,buffer);
putimage(352,315,buffer,XOR_PUT);
setcolor(WHITE);
rectangle(352,315,402,405);
paint(WHITE,360,350,1);
line(352,345,402,345);
line(352,375,402,375);
printxs(362,322,"反间?",YELLOW);
printxs(362,352,"流言",YELLOW);
printxs(362,382,"笼络",YELLOW);
for(;;)
{
mouse(&x,&y,&buttons);
if (buttons==1)
{
if (x>352 && x<402 && y>315 && y<345) {temp=heromenu(352,255,"笼络");if (temp!=0) {midtemp=temp;temp=housemenu(352,275,"对方");
if (temp!=0) {temp1=action;action=temp;temp=heromenu(352,255,"笼络");action=temp1;if (temp!=0) {herodat[midtemp].action=1;
temp1=herodat[midtemp].mental-herodat[temp].mental;viewfanjian(temp,temp1);}}}break;}
if (x>352 && x<402 && y>345 && y<375) {temp=heromenu(352,255,"笼络");if (temp!=0) {midtemp=temp;temp=housemenu(352,275,"对方");
if (temp!=0) {herodat[midtemp].action=1;temp1=herodat[midtemp].mental-housedat[temp].mingzhong;viewtalk(temp,temp1);}}break;}
if (x>352 && x<402 && y>375 && y<405) {temp=heromenu(352,255,"笼络");if (temp!=0) {midtemp=temp;temp=housemenu(352,275,"对方");
if (temp!=0) {temp1=action;action=temp;temp2=temp;temp=heromenu(352,255,"笼络");action=temp1;
if (temp!=0 && strcmp(herodat[temp].name,"刘备")!=0 && strcmp(herodat[temp].name,"孙权")!=0 && strcmp(herodat[temp].name,"曹操")!=0)
{herodat[midtemp].action=1;viewlongla(temp,temp2);}}}break;}
if (x<352 || x>402 || y<315 || y>455) break;
}
if (buttons==2) break;
}cursoroff();
putimage(352,315,buffer,COPY_PUT);
free(buffer);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?