Starting item and battle stuff
This commit is contained in:
+7
-3
@@ -20,8 +20,12 @@ rows = {}
|
||||
|
||||
with open(args.csv, newline="", encoding="utf-8") as f:
|
||||
reader = csv.DictReader(f)
|
||||
if "id" not in reader.fieldnames or "type" not in reader.fieldnames:
|
||||
raise ValueError("CSV must have 'id' and 'type' columns")
|
||||
if (
|
||||
"id" not in reader.fieldnames or
|
||||
"type" not in reader.fieldnames or
|
||||
"name" not in reader.fieldnames
|
||||
):
|
||||
raise ValueError("CSV must have 'id', 'type', and 'name' columns")
|
||||
for row in reader:
|
||||
item_id, item_type = row["id"], row["type"]
|
||||
if item_id not in item_ids:
|
||||
@@ -85,7 +89,7 @@ for i in item_ids:
|
||||
f" [{id_enum(i)}] = {{",
|
||||
f" .id = {id_enum(i)},",
|
||||
f" .type = {type_enum(row['type'])},",
|
||||
f" .name = \"{i}\",",
|
||||
f" .name = \"item.{row['name']}.name\",",
|
||||
" },",
|
||||
]
|
||||
out += [
|
||||
|
||||
Reference in New Issue
Block a user