-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemFileIO.cpp
99 lines (53 loc) · 1.52 KB
/
ItemFileIO.cpp
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
#include "Items.h"
/*
How do I plan to make the item files?
Things in () are comments and don't actaully exist in the file.
Nom:
Sword swords (singular, plural)
BSC:
400 4 +6 0.2 0.1
(size, weight, base damage, damage increase per item level,
damage increase per user [skill] level)
(primary item trait)
PRI:
equipment.weapon.edge.sword
(any secondary item traits)
SEC:
equipment.weapon.stab.sword
(There can be more...)
(Special things the item can do)
USE:
Weapon 3 (It is a weapon, with a threat rating of 3)
Slash/Edge(Which one?)
Stab
Lever
CanEnchant 4(Shorten to Enchant or even ECT, power of enchants)
(etc.)
(Materials it can be made from)
MAT: (The colon marks a new thing, and all tags are 3 characters)
ARWM (All regular weapon materials)
Silver +14
Iron +2 (override)
Types:
(Descriptor, low level bound, high level bound, affect of descriptor,
Damage multiplier)
Broken 1 4 -2 *1
Flawed 2 8 -1 *1
- 3 12 0 (- means no descriptor) *1
Good 5 18 *1
(etc)
*/
//The master item file list lists every item file which must be included in the game.
//This function will load all the items into memory.
int itemParser(std::string pathToMasterItemFileList)
{
FileIO inputFileNameList;
inputFileNameList.textOpenFile(pathToMasterItemFileList, false);
bool fileIsGood = true; int returnInt = 0; std::string inputLine;
//Item file reading
while(fileIsGood){
returnInt = inputFileNameList.readLine(&inputLine);
if (returnInt<1){ return 0; }
}
FileIO inputFile;
}