acd3caa9 by Barry

Added default player json rather than having it in the main file.

1 parent 7f12eb43
{
"name": null,
"room": null,
"inventory": {},
"prompt": "hp %hp mp %mp> ",
"aliases": {},
"hp": 100,
"mp": 100,
"maxhp": 100,
"maxmp": 100,
"maxsta": 10,
"sta": 10,
"aa": "1d2",
"mpr": 0.25,
"star": 0.4
}
\ No newline at end of file
......@@ -98,16 +98,7 @@ while True:
# The dictionary key is the player's id number. We set their room to
# None initially until they have entered a name
# Try adding more player stats - level, gold, inventory, etc
players[id] = {
"name": None,
"room": None,
"inventory": {},
"prompt": "hp %hp mp %mp> ",
"aliases": {},
"hp": 100,
"mp": 100,
"sta": 10,
}
players[id] = utils.load_object_from_file("defaultplayer.json")
with open('welcome.txt', 'r', encoding='utf-8') as f:
for line in f:
mud.send_message(id, line, "\r")
......
{"name": "test", "room": "Tavern", "inventory": {"candle": 1}, "prompt": "%hp> ", "aliases": {}, "hp": 953, "mp": 100, "sta": 10}
\ No newline at end of file
{"name": "test", "room": "Tavern", "inventory": {"candle": 1}, "prompt": "%hp> ", "aliases": {}, "hp": 953, "mp": 100, "sta": 10, "aa": "1d2", "mpr": 0.25, "star": 0.4, "maxhp": 953, "maxmp": 100, "maxsta": 10}
\ No newline at end of file
......
{"cricket": {"max": 1, "active": [{"hp": 100, "mp": 1.0, "sta": 3.950000000000027, "maxhp": 100, "maxmp": 10, "maxsta": 10, "action": "attack", "target": "test"}]}}
\ No newline at end of file
{"cricket": {"max": 1, "active": [{"hp": 100, "mp": 2.0, "sta": 5.550000000000028, "maxhp": 100, "maxmp": 10, "maxsta": 10, "action": "attack", "target": "test"}]}}
\ No newline at end of file
......