Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Barry
/
esp8266-Mud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
acd3caa9
authored
2018-05-06 18:59:23 -0700
by
Barry
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added default player json rather than having it in the main file.
1 parent
7f12eb43
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
12 deletions
defaultplayer.json
main.py
players/test.json
rooms/tavern_monsters.json
defaultplayer.json
0 → 100644
View file @
acd3caa
{
"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
main.py
View file @
acd3caa
...
...
@@ -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
"
)
...
...
players/test.json
View file @
acd3caa
{
"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
...
...
rooms/tavern_monsters.json
View file @
acd3caa
{
"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
...
...
Please
register
or
sign in
to post a comment