#include <paint.h>
#include <timerand.h>
#include <alloc.h>
#include <stdlib.h>
#include <mouse.h>
#include <printc.h>
#include <setgraph.h>
struct hero /* 定义武将资料结构体 */
{
char name[7]; /* 姓名 */
char burgh[7]; /* 所属城池 */
char attrib[7]; /* 所属势力 */
int age; /* 年龄 */
int control; /* 统制 */
int mental; /* 智力 */
int saber; /* 武力 */
int social; /* 魅力 */
int ligeance; /* 忠诚 */
long int solider; /* 士兵 */
int train; /* 训练 */
int action;
};
struct house /* 定义城池资料结构体 */
{
char name[7]; /* 城池名 */
char attrib[7]; /* 所属势力 */
long int money; /* 黄金 */
long int food; /* 粮草 */
long int people; /* 人口 */
int internal; /* 内政 */
int safe; /* 治安 */
int heronumber; /* 武将数 */
long int soliders; /* 士兵总数 */
int mingzhong; /* 民忠 */
int outname; /* 在野武将 */
};
int maxheronumber=0,midtemp=0; /* 数据文件中最大武将数 */
int action=0,year=201,yue=1; /* 城池行动号 */
char emperor[7];int yinxiongcode; /* 玩家所选英雄 */
struct hero herodat[301];struct house housedat[16];
int actionhero[9];
union REGS regs;
#include "initdat.c" /* 初始化数据文件 */
#include "addage.c" /* 每年武将年龄增加 */
#include "startme.c" /* 定义开始菜单 */
#include "actionh.c" /* 显示城池情报 */
#include "setburgh.c" /* 画一个城池 */
#include "initmap.c" /* 初始化地图 */
#include "heroion.c" /* 武将资料 */
#include "outhero.c" /* 定义在野武将选单 */
#include "selectem.c" /* 定义玩家群雄 */
#include "viewtalk.c" /* 定义流言语 */
#include "viewfan.c" /* 定义反间语 */
#include "viewlong.c" /* 定义笼络语 */
#include "viewtime.c" /* 显示时间 */
#include "viewnal.c" /* 内政上升语 */
#include "viewple.c" /* 人口 */
#include "viewsafe.c" /* 安全 */
#include "viewdole.c" /* 施舍 */
#include "viewpriz.c" /* 赏赐 */
#include "viewrain.c" /* 训练 */
#include "viewout.c" /* 登录信息 */
#include "viewlost.c" /* 登用 */
#include "viewfind.c" /* 搜索武将信息框 */
#include "business.c" /* 定义交易 */
#include "addder.c" /* 定义微兵 */
#include "dole.c" /* 定义施舍 */
#include "prize.c" /* 定义赏赐 */
#include "initcode.c"
#include "housmenu.c"
#include "menu2.c" /* 以下为定义各一级菜单 */
#include "menu3.c"
#include "menu4.c"
#include "menu5.c"
#include "menu6.c"
#include "menu7.c"
#include "menu9.c"
int heromenu(); /* 各类武将选单 */
void initheroaction(); /* 初始化武将行动 */
/*---------------- The main program -----------------*/
main()
{
int x=320,y=200,buttons=0;
int select,startselect;
if (installmouse()==0) {printf("The mouse not instaled.");getch();exit(0);}
restart:;
setgraph();
maxheronumber=inithero();inithouse();initheroaction();
startselect=startmenu();
switch(startselect)
{
case 1:break; /* 开始新游戏 */
case 2:break; /* 读取进度 */
case 3:closegraph();exit(0); /* 退出游戏 */
}
select=selectemperor(); /* 选择群雄 */
initmap(); /* 初始化画面 */
switch(select)
{
case 1:actionhouse(housedat[8]);strcpy(emperor,"曹操");action=8;break;
case 2:actionhouse(housedat[10]);strcpy(emperor,"孙权");action=10;break;
case 3:actionhouse(housedat[6]);strcpy(emperor,"刘备");action=6;break;
}
yinxiongcode=initcode();viewtime(150,10);
for(;;)
{
mouse(&x,&y,&buttons);
#include "control.c"
if (action>15) {action=1;yue++;if (yue>12) {yue=1;year++;addage();}viewtime(150,10);actionhouse(housedat[1]);}
}
}
/*----------------------------------------------------------------------*/
void initheroaction()
{
int k;
for(k=1;k<=maxheronumber;k++)
herodat[k].action=0;
}
/* 定义武将列表菜单 */
int heromenu(int x,int y,char work[7])
{
#include "heromenu.c"
for(;;)
{
mouse(&m,&n,&buttons);
#include "action0.c"
#include "action1.c" /* 武将情报 */
#include "action2.c" /* 生产 */
#include "action3.c" /* 人口 */
#include "action4.c" /* 治安 */
#include "action5.c" /* 施舍 */
#include "action6.c" /* 赏赐 */
#include "action7.c" /* 搜索 */
#include "action8.c" /* 买卖 */
#include "action9.c" /* 登用 */
#include "action10.c" /* 解雇 */
#include "action11.c" /* 情报类 */
}}
cursoroff();
putimage(x+50,y-100,buffer,COPY_PUT);
free(buffer);return back;
}
没有合适的资源?快使用搜索试试~ 我知道了~
sanguo.rar_sanguo_三国
共63个文件
c:53个
dat:2个
obj:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 23 浏览量
2022-09-14
16:50:54
上传
评论
收藏 237KB RAR 举报
温馨提示
三国游戏。c语言编写。san.exe是已经编译链接完成后的程序。
资源推荐
资源详情
资源评论
收起资源包目录
sanguo.rar (63个子文件)
sanguo
sanguo
INITCODE.C 124B
ACTION9.C 613B
MENU3.C 1KB
setburgh.c 1KB
MENU4.C 2KB
VIEWTALK.C 787B
ACTIONH.C 1KB
MENU6.C 2KB
HZK16 261KB
MENU9.C 921B
MENU7.C 576B
initmap.c 835B
AGA.C 2KB
GETNEAR.C 249B
CONTROL.C 619B
ADDDER.C 2KB
SELECTEM.C 646B
TCCONFIG.TC 2KB
ACTION6.C 1KB
SAN.MAP 4KB
ACTION1.C 805B
BURGH.DAT 930B
VIEWOUT.C 994B
INITDAT.C 4KB
action11.c 681B
PRIZE.C 2KB
ACTION4.C 809B
VIEWPRIZ.C 554B
viewsafe.c 597B
SAN.EXE 110KB
VIEWLOST.C 2KB
ACTION7.C 1KB
soundon.c 88B
ACTION5.C 1KB
VIEWFIND.C 707B
PRINTC.OBJ 3KB
HEROMENU.C 1KB
MENU2.C 756B
BUSINESS.C 2KB
VIEWNAL.C 601B
ACTION3.C 824B
SAN.BAK 5KB
VIEWPLE.C 601B
SAN.C 5KB
SAN.PIF 3KB
VIEWTIME.C 758B
HERO.DAT 6KB
VIEWDOLE.C 599B
ADDAGE.C 80B
VIEWRAIN.C 835B
ACTION2.C 820B
ACTION8.C 457B
DOLE.C 2KB
housmenu.c 2KB
VIEWFAN.C 883B
VIEWLONG.C 1KB
SAN.OBJ 62KB
MENU5.C 1KB
ACTION0.C 1KB
ACTION10.C 660B
STARTME.C 1KB
HEROION.C 2KB
outhero.c 2KB
共 63 条
- 1
资源评论
钱亚锋
- 粉丝: 86
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功