forked from pbem-games/atlantis-dsnlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitems.h
250 lines (206 loc) · 4.64 KB
/
items.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
// START A3HEADER
//
// This source file is part of the Atlantis PBM game program.
// Copyright (C) 1995-1999 Geoff Dunbar
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program, in the file license.txt. If not, write
// to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
//
// See the Atlantis Project web page for details:
// http://www.prankster.com/project
//
// END A3HEADER
#ifndef ITEMS_CLASS
#define ITEMS_CLASS
class Item;
class ItemType;
#include "fileio.h"
#include "gamedefs.h"
#include "alist.h"
#include "astring.h"
enum {
IT_NORMAL = 0x01,
IT_ADVANCED = 0x02,
IT_TRADE = 0x04,
IT_MAN = 0x08,
IT_MONSTER = 0x10,
IT_MAGIC = 0x20,
IT_WEAPON = 0x40,
IT_ARMOR = 0x80,
IT_MOUNT = 0x100,
IT_BATTLE = 0x200,
IT_SPECIAL = 0x400, // exclude from monster treasure
};
class ItemType
{
public:
char *name;
char *names;
char *abr;
enum {
CANTGIVE = 0x1,
};
int flags;
int skill;
int level;
int input;
int number;
int weight;
int type;
int baseprice;
int combat;
int index;
int walk;
int ride;
int fly;
int swim;
};
extern ItemType * ItemDefs;
class ManType
{
public:
int speciallevel;
int defaultlevel;
int firstskill;
int secondskill;
int thirdskill;
int fourthskill;
};
extern ManType * ManDefs;
class MonType
{
public:
int skill;
int hits;
int tactics;
int special;
int stealth;
int obs;
int silver;
int spoiltype;
int hostile; /* Percent */
int number;
char *name;
};
extern MonType * MonDefs;
class WeaponType
{
public:
enum {
NEEDSKILL = 0x1,
RANGED = 0x4,
NODEFENSE = 0x8,
GOODARMOR = 0x10,
NEVERMISS = 0x20,
};
int skill1;
int skill2;
int flags;
int skillBonus;
//
// For numAttacks:
// - A positive number is the number of attacks per round.
// - A negative number is the number of rounds per attack.
// - NUM_ATTACKS_SKILL indicates the the weapon gives as many attacks
// as the skill of the user.
//
enum {
NUM_ATTACKS_SKILL = 100,
};
int numAttacks;
};
extern WeaponType *WeaponDefs;
class ArmorType
{
public:
enum {
USEINASS = 0x1,
};
int flags;
//
// Against normal attacks, the chance of the armor protecting the wearer
// is: normalChance / normalFrom
//
int normalChance;
int normalFrom;
//
// Same thing, but against "good" attacks.
//
int goodChance;
int goodFrom;
};
extern ArmorType *ArmorDefs;
class MountType
{
public:
//
// This is the skill needed to use this mount.
//
int skill;
//
// This is the minimum bonus (and minimal skill level) for this mount.
//
int minBonus;
//
// This is the maximum bonus this mount will grant.
//
int maxBonus;
};
extern MountType *MountDefs;
class BattleItemType
{
public:
enum {
MAGEONLY = 0x1,
SPECIAL = 0x2,
SHIELD = 0x4,
};
int flags;
int itemNum;
int index;
int skillLevel;
};
extern BattleItemType *BattleItemDefs;
int ParseItem(AString *);
AString ItemString(int,int); /* type, num */
AString ItemDescription(int);
int IsSoldier(int);
class Item : public AListElem
{
public:
Item();
~Item();
void Readin(Ainfile *);
void Writeout(Aoutfile *);
AString Report(int);
int type;
int num;
AString * name;
};
class ItemList : public AList
{
public:
void Readin(Ainfile *);
void Writeout(Aoutfile *);
AString Report(int,int,int,int spoils=0);
AString BattleReport();
int Weight();
int GetNum(int);
void AddItem(int, AString *);
void SetNum(int,int); /* type, number */
void SetName (int, AString *);
AString * GetName (int);
};
#endif