This repository has been archived by the owner on Feb 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Item.cs
409 lines (393 loc) · 11.7 KB
/
Item.cs
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
using HybrasylEditor.UI;
using System.ComponentModel;
using System.Drawing.Design;
namespace HybrasylEditor
{
public class Item
{
private string name = "New Item";
private int sprite = 0;
private int equipSprite = -1;
private int displaySprite = 0;
private Sex sex = Sex.Neutral;
private Class @class = Class.Peasant;
private ItemType type = ItemType.UsableItem;
private WeaponType weaponType = WeaponType.None;
private EquipSlot equipSlot = EquipSlot.None;
private Element element = Element.None;
private int bodyStyle = 0;
private bool repairable = true;
private bool enchantable = false;
private bool depositable = true;
private bool droppable = true;
private bool vendorable = true;
private bool tailorable = false;
private bool smithable = false;
private bool consecratable = false;
private bool perishable = false;
private bool exchangeable = true;
private bool automaticConsecrateVariants = false;
private bool automaticTailorVariants = false;
private bool automaticSmithVariants = false;
private bool automaticEnchantVariants = false;
private bool automaticElementVariants = false;
private int level = 1;
private int ability = 0;
private int weight = 0;
private int color = 0;
private int maximumStack = 1;
private int maximumDurability = 0;
private int value = 0;
private int hp = 0;
private int mp = 0;
private int str = 0;
private int @int = 0;
private int wis = 0;
private int con = 0;
private int dex = 0;
private int hit = 0;
private int dmg = 0;
private int ac = 0;
private int mr = 0;
private int regen = 0;
private int minimumDamageS = 0;
private int maximumDamageS = 0;
private int minimumDamageL = 0;
private int maximumDamageL = 0;
// Tabs in category names are not displayed but are used for sorting
private const string basicInfo = "\t\t\t\t\tBasic Info";
private const string itemFlags = "\t\t\t\tItem Flags";
private const string itemVariants = "\t\t\tItem Variants";
private const string itemCharacteristics = "\t\tItem Characteristics";
private const string attributes = "\tAttributes";
[Category(basicInfo), Description("The item's name, what the fuck else."), DefaultValue("")]
public string Name
{
get { return name; }
set { name = value; }
}
[Category(basicInfo), DefaultValue(0), Editor(typeof(ItemSpriteEditor), typeof(UITypeEditor))]
public int Sprite
{
get { return sprite; }
set { sprite = value; }
}
[Category(basicInfo), DefaultValue(-1), Editor(typeof(ItemSpriteEditor), typeof(UITypeEditor))]
public int EquipSprite
{
get { return equipSprite; }
set { equipSprite = value; }
}
[Category(basicInfo), DefaultValue(0)]
public int DisplaySprite
{
get { return displaySprite; }
set { displaySprite = value; }
}
[Category(basicInfo), DefaultValue(Sex.Neutral)]
public Sex Sex
{
get { return sex; }
set { sex = value; }
}
[Category(basicInfo), DefaultValue(Class.Peasant)]
public Class Class
{
get { return @class; }
set { @class = value; }
}
[Category(basicInfo), DefaultValue(ItemType.UsableItem)]
public ItemType Type
{
get { return type; }
set { type = value; }
}
[Category(basicInfo), DefaultValue(WeaponType.None)]
public WeaponType WeaponType
{
get { return weaponType; }
set { weaponType = value; }
}
[Category(basicInfo), DefaultValue(EquipSlot.None)]
public EquipSlot EquipSlot
{
get { return equipSlot; }
set { equipSlot = value; }
}
[Category(basicInfo), DefaultValue(Element.None)]
public Element Element
{
get { return element; }
set { element = value; }
}
[Category(basicInfo), DefaultValue(0)]
public int BodyStyle
{
get { return bodyStyle; }
set { bodyStyle = value; }
}
[Category(itemFlags), DefaultValue(true)]
public bool Repairable
{
get { return repairable; }
set { repairable = value; }
}
[Category(itemFlags), DefaultValue(false)]
public bool Enchantable
{
get { return enchantable; }
set { enchantable = value; }
}
[Category(itemFlags), DefaultValue(true)]
public bool Depositable
{
get { return depositable; }
set { depositable = value; }
}
[Category(itemFlags), DefaultValue(true)]
public bool Droppable
{
get { return droppable; }
set { droppable = value; }
}
[Category(itemFlags), DefaultValue(true)]
public bool Vendorable
{
get { return vendorable; }
set { vendorable = value; }
}
[Category(itemFlags), DefaultValue(false)]
public bool Tailorable
{
get { return tailorable; }
set { tailorable = value; }
}
[Category(itemFlags), DefaultValue(false)]
public bool Smithable
{
get { return smithable; }
set { smithable = value; }
}
[Category(itemFlags), DefaultValue(false)]
public bool Consecratable
{
get { return consecratable; }
set { consecratable = value; }
}
[Category(itemFlags), DefaultValue(false)]
public bool Perishable
{
get { return perishable; }
set { perishable = value; }
}
[Category(itemFlags), DefaultValue(true)]
public bool Exchangeable
{
get { return exchangeable; }
set { exchangeable = value; }
}
[Category(itemVariants), DefaultValue(false)]
public bool AutomaticConsecreateVariants
{
get { return automaticConsecrateVariants; }
set { automaticConsecrateVariants = value; }
}
[Category(itemVariants), DefaultValue(false)]
public bool AutomaticTailorVariants
{
get { return automaticTailorVariants; }
set { automaticTailorVariants = value; }
}
[Category(itemVariants), DefaultValue(false)]
public bool AutomaticSmithVariants
{
get { return automaticSmithVariants; }
set { automaticSmithVariants = value; }
}
[Category(itemVariants), DefaultValue(false)]
public bool AutomaticEnchantVariants
{
get { return automaticEnchantVariants; }
set { automaticEnchantVariants = value; }
}
[Category(itemVariants), DefaultValue(false)]
public bool AutomaticElementVariants
{
get { return automaticElementVariants; }
set { automaticElementVariants = value; }
}
[Category(itemCharacteristics), DefaultValue(1)]
public int Level
{
get { return level; }
set { level = value; }
}
[Category(itemCharacteristics), DefaultValue(0)]
public int Ability
{
get { return ability; }
set { ability = value; }
}
[Category(itemCharacteristics), DefaultValue(0)]
public int Weight
{
get { return weight; }
set { weight = value; }
}
[Category(itemCharacteristics), DefaultValue(0)]
public int Color
{
get { return color; }
set { color = value; }
}
[Category(itemCharacteristics), DefaultValue(1)]
public int MaximumStack
{
get { return maximumStack; }
set { maximumStack = value; }
}
[Category(itemCharacteristics), DefaultValue(0)]
public int MaximumDurability
{
get { return maximumDurability; }
set { maximumDurability = value; }
}
[Category(itemCharacteristics), DefaultValue(0)]
public int Value
{
get { return value; }
set { this.value = value; }
}
[Category(attributes), DefaultValue(0)]
public int HP
{
get { return hp; }
set { hp = value; }
}
[Category(attributes), DefaultValue(0)]
public int MP
{
get { return mp; }
set { mp = value; }
}
[Category(attributes), DefaultValue(0)]
public int Str
{
get { return str; }
set { str = value; }
}
[Category(attributes), DefaultValue(0)]
public int Int
{
get { return @int; }
set { @int = value; }
}
[Category(attributes), DefaultValue(0)]
public int Wis
{
get { return wis; }
set { wis = value; }
}
[Category(attributes), DefaultValue(0)]
public int Con
{
get { return con; }
set { con = value; }
}
[Category(attributes), DefaultValue(0)]
public int Dex
{
get { return dex; }
set { dex = value; }
}
[Category(attributes), DefaultValue(0)]
public int Hit
{
get { return hit; }
set { hit = value; }
}
[Category(attributes), DefaultValue(0)]
public int Dmg
{
get { return dmg; }
set { dmg = value; }
}
[Category(attributes), DefaultValue(0)]
public int AC
{
get { return ac; }
set { ac = value; }
}
[Category(attributes), DefaultValue(0)]
public int MR
{
get { return mr; }
set { mr = value; }
}
[Category(attributes), DefaultValue(0)]
public int Regen
{
get { return regen; }
set { regen = value; }
}
[Category(attributes), DefaultValue(0)]
public int MinimumDamageS
{
get { return minimumDamageS; }
set { minimumDamageS = value; }
}
[Category(attributes), DefaultValue(0)]
public int MaximumDamageS
{
get { return maximumDamageS; }
set { maximumDamageS = value; }
}
[Category(attributes), DefaultValue(0)]
public int MinimumDamageL
{
get { return minimumDamageL; }
set { minimumDamageL = value; }
}
[Category(attributes), DefaultValue(0)]
public int MaximumDamageL
{
get { return maximumDamageL; }
set { maximumDamageL = value; }
}
public Item()
{
}
}
public enum ItemType
{
UsableItem,
UnusableItem,
Equipment
}
public enum WeaponType
{
None,
OneHanded,
TwoHanded,
Dagger,
Staff,
Claw
}
public enum EquipSlot
{
None,
Weapon,
Armor,
Shield,
Helmet,
Earring,
Necklace,
Rings,
Gauntlet,
Belt,
Greaves,
Boots,
Accessory,
Overcoat
}
}