还未完全完成,只是做个记录 可以参考,切勿复制粘贴(后果自负)
以下为定义在头文件下的函数声明,定义放在了GitHub。
还请各位看官有意见建议的都请告诉我,我会尽力改善
#include<iostream>
#include<conio.h>
#include<Windows.h>
using namespace std;
struct medicine
{
int ID;
char Name[20];
int Resume;
int Weight;
int Gold;
};
struct blank
{
int ID;
int Max_Size;
int Current_Weight;
int Current_Goods_Number;
medicine Medicines[5];
};
struct bag
{
int Max_Number;
int Current_Number;
int Used_Load;
int Max_Load;
blank* Blanks;
};
struct hero
{
char Name[20];
int Lv;
int Blood;
int Max_Blood;
int Defend;
int Attack;
int Key;
int Money;
bag Bag;
};
struct monster
{
char Name[20];
int Lv;
int Blood;
int Defend;
int Attack;
int Gold;
};
void buyStuff(hero& superman,medicine medicine);//买东西放进背包
bool pickStuff(hero& superman,medicine medicine);//捡东西放进背包
void initBlank(hero& superman);//给背包空格初始化为0
void initBag(hero& superman);//给背包元素初始化为0
void buyBag(hero& superman);//买一个更大的背包
void openBag(hero& superman);//打开背包
void sortBlank(hero& superman,int value);//
void useStuff(hero& superman,int value);//使用东西
void sprite_Data(hero& superman);//英雄的属性资料显示
void sprite_Data(hero& superman,monster& spider);//英雄的属性资料显示
void get_Hero_Position(int towerMap[5][20][20],int& floor,int& hero_X,int& hero_Y);//获取英雄坐标
int fight(hero *superman,monster spider);//战斗
void upLv(int& s,hero *superman);//升级
void mall(hero& superman);//商店
void sortBag(hero& superman);//整理背包
void hero_Act(int towerMap[5][20][20],int& floor,int& hero_X,int& hero_Y,hero& superman,monster enemy);//英雄的各种行为
void flashMap(int towerMap[5][20][20],int& floor);//打印地图