Go to the documentation of this file.
24 : m_treasures(treasures), m_archetypes(archetypes), m_tracker(tracker) {
54 if (sscanf(cp,
"arch %s", variable)) {
60 }
else if (strncmp(cp,
"artifact ", 9) == 0) {
67 }
else if (sscanf(cp,
"list_magic_value %d", &
value)) {
68 t->list_magic_value = (uint8_t)
value;
69 }
else if (sscanf(cp,
"list_magic_adjustment %d", &
value)) {
70 t->list_magic_adjustment = (int8_t)
value;
71 }
else if (sscanf(cp,
"list %s", variable)) {
77 }
else if (sscanf(cp,
"change_name %s", variable))
79 else if (sscanf(cp,
"change_title %s", variable))
81 else if (sscanf(cp,
"change_slaying %s", variable))
83 else if (sscanf(cp,
"chance %d", &
value))
84 t->chance = (uint8_t)
value;
85 else if (sscanf(cp,
"nrof %d", &
value))
87 else if (sscanf(cp,
"magic %d", &
value))
89 else if (!strcmp(cp,
"yes"))
91 else if (!strcmp(cp,
"no"))
93 else if (!strcmp(cp,
"end"))
95 else if (!strcmp(cp,
"more")) {
116 if (*
buf ==
'#' || *
buf ==
'\0')
119 if (sscanf(
buf,
"treasureone %s",
name) || sscanf(
buf,
"treasure %s",
name)) {
128 if (!strncmp(
buf,
"treasureone", 11)) {
129 for (
t = tl->
items;
t != NULL;
t =
t->next) {
130 if (
t->next_yes ||
t->next_no) {
131 LOG(
llevError,
"Treasure %s is one item, but on treasure %s\n", tl->
name,
t->item ?
t->item->name :
t->name);
132 LOG(
llevError,
" the next_yes or next_no field is set\n");
size_t bufferreader_current_line(BufferReader *br)
void LOG(LogLevel logLevel, const char *format,...)
TreasureLoader(Treasures *treasures, Archetypes *archetypes, AssetsTracker *tracker)
treasure * get_empty_treasure(void)
treasure * loadTreasure(BufferReader *reader, const std::string &filename)
AssetsTracker * m_tracker
T * define(const Key &name, T *asset)
sstring add_string(const char *str)
Archetypes * m_archetypes
virtual void assetDefined(const archetype *asset, const std::string &filename)
void fatal(enum fatal_error err)
void free_string(sstring str)
virtual void load(BufferReader *reader, const std::string &filename) override
char * bufferreader_next_line(BufferReader *br)