-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct.h
62 lines (57 loc) · 1023 Bytes
/
struct.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
typedef struct
{
char name[20]; //角色名
int level; //等级
int MAXhp;//最大生命
int hp;//生命
int attack;//攻击
int defence;//防御
int exp;//经验
int money;//钱
}player;
typedef struct
{
int ID;//编号
char name[20];//姓名
int effect;//效果类型
int range;//范围
}item;
struct itemList
{
item item1;//当前物品
struct itemList* next;//下一个物品 的地址
};
typedef struct
{
int ID;//商品的编号
int money;//商品的钱
}commodity;
struct commodityList
{
commodity commodity1;//当前商品
struct commodityList* next;//下一个商品的地址
};
struct bagList
{
int ID;//当前物品编号
int num;//当前商品数量
struct bagList* next;//下一个商品的地址
struct bagList* preview;//上一个商品的地址
};
typedef struct {
int ID;//怪物ID
char name[20];//怪物名
int level;//等级
int MAXhp;//最大HP
int hp;//当前hp
int attack;//当前攻击
int defence;//当前防御
int exp;//经验
int money;//战斗胜利后获得金钱
}enemy;
struct enemyList
{
struct enemyList* next;//下一个怪物地址
enemy enemy;//当前怪物信息
};