Skip to content

Commit 1f39fdb

Browse files
committed
sunday
1 parent 913c1f8 commit 1f39fdb

31 files changed

+198
-267
lines changed

CharActor/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
from typing import Union as _Union
22
from .__log__ import logger, log
3-
from ._charactor import dicts as _dicts
3+
from ._charactor.dicts import load_all_dicts, load_dict, load_list
44
from ._charactor import create, BaseCharacters as _BaseCharacters, character_bank
55
from ._objects._items import _Armory, _Goods
66

77
log('Initializing CharActor.')
88
log('Initializing character bank.')
99

10+
1011
class _Catalogues:
1112
log('Initializing catalogues.')
1213
Armory = None
1314
Goods = None
15+
1416
def __init__(self):
1517
self.Armory = _Armory()
1618
self.Goods = _Goods()
17-
18-
def get(self, item_name: str = None, grid = None, cell = None):
19+
20+
def get(self, item_name: str = None, grid=None, cell=None):
1921
if item_name is None:
2022
return
2123
if None not in [grid, cell] and isinstance(cell, str):
@@ -26,11 +28,12 @@ def get(self, item_name: str = None, grid = None, cell = None):
2628
elif item_name in self.Goods:
2729
return self.Goods.get(item_name, grid, cell)
2830
else:
29-
print(f'Item {item_name} not found in catalogues.')
31+
print(f'Item {item_name} not in catalogues.')
3032
return None
3133

34+
3235
log('Creating catalogue instance.')
33-
36+
3437
Catalogues = _Catalogues()
3538

36-
del log, logger
39+
del log, logger

CharActor/__log__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import time
12
import logging as _logging
23

4+
date = time.strftime('%Y-%m-%d', time.localtime())
5+
36
_logging.addLevelName(99, 'CHARACTOR')
47
logger = _logging.getLogger('CHARACTOR')
5-
file_handler = _logging.FileHandler('logs/charactor.log', 'w')
8+
file_handler = _logging.FileHandler(f'logs/{date}.log', 'w')
69
formatter = _logging.Formatter('%(asctime)s - %(message)s')
710
file_handler.setFormatter(formatter)
811
file_handler.setLevel(99)

CharActor/_charactor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .actor import create, BaseCharacters, character_bank
22
from . import dicts
3-
from .dicts import load_all_dicts, load_dict, load_list
3+
from .dicts import load_all_dicts, load_dict, load_list

CharActor/_charactor/actor/_actor/base_actor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,10 @@ def _init_inventory(self):
460460
self.inventory.add_item(item[0])
461461
elif item in ['Leather Armor', 'Light Leather', 'Scale Mail', 'Chain Mail', 'Plate Mail', 'Tunic']:
462462
log(f'Building armor set: {item} ')
463-
for piece in Armory.armor_manifest:
464-
piece_ = Armory[piece]
463+
for piece_ in Armory.items.values():
464+
piece_ = piece_()
465465
if piece_.set_name == item:
466+
piece_ = piece_()
466467
log(f'{piece_.name} found in Armory')
467468
self._add_and_equip_piece(piece_)
468469
if isinstance(piece_.slot, list):

CharActor/_charactor/dicts/backgrounds.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,13 @@
343343
"skills":null,
344344
"tools":null,
345345
"languages":null,
346-
"equipment":null,
346+
"equipment":[
347+
"Common Clothes",
348+
[
349+
10,
350+
"Gold Piece"
351+
]
352+
],
347353
"special":null
348354
}
349355
}

CharActor/_charactor/dicts/general_items.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
"quest_item": false,
303303
"relic": false
304304
},
305-
"Lock and Key": {
305+
"Lock And Key": {
306306
"item_id": 19,
307307
"name": "Lock and Key",
308308
"category": "TOOLS",
@@ -942,7 +942,7 @@
942942
"quest_item": false,
943943
"relic": false
944944
},
945-
"Flint and Steel": {
945+
"Flint And Steel": {
946946
"item_id": 51,
947947
"name": "Flint and Steel",
948948
"category": "TOOLS",

CharActor/_charactor/dicts/weapons.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@
919919
"HEAVY"
920920
]
921921
},
922-
"Short-bow": {
922+
"Shortbow": {
923923
"name": "Short-bow",
924924
"item_id": 164,
925925
"slot": "MAIN_HAND",
@@ -953,7 +953,7 @@
953953
"LIGHT"
954954
]
955955
},
956-
"Crossbow, light": {
956+
"Crossbow, Light": {
957957
"name": "Crossbow, light",
958958
"item_id": 165,
959959
"slot": "MAIN_HAND",
@@ -988,7 +988,7 @@
988988
"TWO_HANDED"
989989
]
990990
},
991-
"Crossbow, hand": {
991+
"Crossbow, Hand": {
992992
"name": "Crossbow, hand",
993993
"item_id": 166,
994994
"slot": "MAIN_HAND",
@@ -1022,7 +1022,7 @@
10221022
"LIGHT"
10231023
]
10241024
},
1025-
"Crossbow, heavy": {
1025+
"Crossbow, Heavy": {
10261026
"name": "Crossbow, heavy",
10271027
"item_id": 167,
10281028
"slot": "MAIN_HAND",

CharActor/_grid_object/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.
-236 Bytes
Binary file not shown.
-215 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)