1ebbbf31 by Barry

Added bonus files for lookup data. Added calcs for new stats.

1 parent ba199cda
[
{
"atk": 0,
"fort": 0,
"ref": 2,
"will": 2
},
{
"atk": 1,
"fort": 0,
"ref": 3,
"will": 3
},
{
"atk": 2,
"fort": 1,
"ref": 3,
"will": 3
},
{
"atk": 3,
"fort": 2,
"ref": 4,
"will": 4
},
{
"atk": 3,
"fort": 1,
"ref": 4,
"will": 4
},
{
"atk": 4,
"fort": 2,
"ref": 5,
"will": 5
},
{
"atk": 5,
"fort": 3,
"ref": 5,
"will": 5
},
{
"atk": 6,
"fort": 2,
"ref": 6,
"will": 6
},
{
"atk": 6,
"fort": 3,
"ref": 6,
"will": 6
},
{
"atk": 7,
"fort": 3,
"ref": 7,
"will": 7
},
{
"atk": 8,
"fort": 3,
"ref": 7,
"will": 7
},
{
"atk": 9,
"fort": 4,
"ref": 8,
"will": 8
},
{
"atk": 9,
"fort": 4,
"ref": 8,
"will": 8
},
{
"atk": 10,
"fort": 4,
"ref": 9,
"will": 9
},
{
"atk": 11,
"fort": 5,
"ref": 9,
"will": 9
},
{
"atk": 12,
"fort": 5,
"ref": 10,
"will": 10
},
{
"atk": 12,
"fort": 5,
"ref": 10,
"will": 10
},
{
"atk": 13,
"fort": 6,
"ref": 11,
"will": 11
},
{
"atk": 14,
"fort": 6,
"ref": 11,
"will": 11
},
{
"atk": 15,
"fort": 6,
"ref": 12,
"will": 12
}
]
\ No newline at end of file
[
{
"atk": 0,
"fort": 2,
"ref": 2,
"will": 0
},
{
"atk": 1,
"fort": 3,
"ref": 3,
"will": 0
},
{
"atk": 2,
"fort": 3,
"ref": 3,
"will": 1
},
{
"atk": 3,
"fort": 4,
"ref": 4,
"will": 1
},
{
"atk": 3,
"fort": 4,
"ref": 4,
"will": 1
},
{
"atk": 4,
"fort": 5,
"ref": 5,
"will": 2
},
{
"atk": 5,
"fort": 5,
"ref": 5,
"will": 2
},
{
"atk": 6,
"fort": 6,
"ref": 6,
"will": 2
},
{
"atk": 6,
"fort": 6,
"ref": 6,
"will": 3
},
{
"atk": 7,
"fort": 7,
"ref": 7,
"will": 3
},
{
"atk": 8,
"fort": 7,
"ref": 7,
"will": 3
},
{
"atk": 9,
"fort": 8,
"ref": 8,
"will": 4
},
{
"atk": 9,
"fort": 8,
"ref": 8,
"will": 4
},
{
"atk": 10,
"fort": 9,
"ref": 9,
"will": 4
},
{
"atk": 11,
"fort": 9,
"ref": 9,
"will": 5
},
{
"atk": 12,
"fort": 10,
"ref": 10,
"will": 5
},
{
"atk": 12,
"fort": 10,
"ref": 10,
"will": 5
},
{
"atk": 13,
"fort": 11,
"ref": 11,
"will": 6
},
{
"atk": 14,
"fort": 11,
"ref": 11,
"will": 6
},
{
"atk": 15,
"fort": 12,
"ref": 12,
"will": 6
}
]
\ No newline at end of file
[
{
"atk": 0,
"fort": 0,
"ref": 0,
"will": 2,
"spells": [2, 0, 0, 0, 0, 0]
},
{
"atk": 1,
"fort": 0,
"ref": 0,
"will": 3,
"spells": [2, 0, 0, 0, 0, 0]
},
{
"atk": 2,
"fort": 1,
"ref": 1,
"will": 3,
"spells": [3, 0, 0, 0, 0, 0]
},
{
"atk": 3,
"fort": 1,
"ref": 1,
"will": 4,
"spells": [3, 2, 0, 0, 0, 0]
},
{
"atk": 3,
"fort": 1,
"ref": 1,
"will": 4,
"spells": [4, 2, 0, 0, 0, 0]
},
{
"atk": 4,
"fort": 2,
"ref": 2,
"will": 5,
"spells": [4, 3, 0, 0, 0, 0]
},
{
"atk": 5,
"fort": 2,
"ref": 2,
"will": 5,
"spells": [4, 3, 2, 0, 0, 0]
},
{
"atk": 6,
"fort": 2,
"ref": 2,
"will": 6,
"spells": [4, 4, 2, 0, 0, 0]
},
{
"atk": 6,
"fort": 3,
"ref": 3,
"will": 6,
"spells": [5, 4, 3, 0, 0, 0]
},
{
"atk": 7,
"fort": 3,
"ref": 3,
"will": 7,
"spells": [5, 4, 3, 2, 0, 0]
},
{
"atk": 8,
"fort": 3,
"ref": 3,
"will": 7,
"spells": [5, 4, 4, 2, 0, 0]
},
{
"atk": 9,
"fort": 4,
"ref": 4,
"will": 8,
"spells": [5, 5, 4, 3, 0, 0]
},
{
"atk": 9,
"fort": 4,
"ref": 4,
"will": 8,
"spells": [5, 5, 4, 3, 2, 0]
},
{
"atk": 10,
"fort": 4,
"ref": 4,
"will": 9,
"spells": [5, 5, 4, 4, 2, 0]
},
{
"atk": 11,
"fort": 5,
"ref": 5,
"will": 9,
"spells": [5, 5, 5, 4, 3, 0]
},
{
"atk": 12,
"fort": 5,
"ref": 5,
"will": 10,
"spells": [5, 5, 5, 4, 3, 2]
},
{
"atk": 12,
"fort": 5,
"ref": 5,
"will": 10,
"spells": [5, 5, 5, 4, 4, 2]
},
{
"atk": 13,
"fort": 6,
"ref": 6,
"will": 11,
"spells": [5, 5, 5, 5, 4, 3]
},
{
"atk": 14,
"fort": 6,
"ref": 6,
"will": 11,
"spells": [5, 5, 5, 5, 5, 4]
},
{
"atk": 15,
"fort": 6,
"ref": 6,
"will": 12,
"spells": [5, 5, 5, 5, 5, 5]
}
]
\ No newline at end of file
[
{
"atk": 0,
"fort": 0,
"ref": 2,
"will": 2
},
{
"atk": 1,
"fort":0,
"ref": 3,
"will": 3
},
{
"atk": 2,
"fort": 1,
"ref": 3,
"will": 3
},
{
"atk": 3,
"fort": 1,
"ref": 4,
"will": 4
},
{
"atk": 3,
"fort": 1,
"ref": 4,
"will": 4
},
{
"atk": 4,
"fort": 2,
"ref": 5,
"will": 5
},
{
"atk": 5,
"fort": 2,
"ref": 5,
"will": 5
},
{
"atk": 6,
"fort": 2,
"ref": 6,
"will": 6
},
{
"atk": 6,
"fort": 3,
"ref": 6,
"will": 6
},
{
"atk": 7,
"fort": 3,
"ref": 7,
"will": 7
},
{
"atk": 8,
"fort": 3,
"ref": 7,
"will": 7
},
{
"atk": 9,
"fort": 4,
"ref": 8,
"will": 8
},
{
"atk": 9,
"fort": 4,
"ref": 8,
"will": 8
},
{
"atk": 10,
"fort": 4,
"ref": 9,
"will": 9
},
{
"atk": 11,
"fort": 5,
"ref": 9,
"will": 9
},
{
"atk": 12,
"fort": 5,
"ref": 10,
"will": 10
},
{
"atk": 12,
"fort": 5,
"ref": 10,
"will": 10
},
{
"atk": 13,
"fort": 6,
"ref": 11,
"will": 11
},
{
"atk": 14,
"fort": 6,
"ref": 11,
"will": 11
},
{
"atk": 15,
"fort": 6,
"ref": 12,
"will": 12
}
]
\ No newline at end of file
[
{
"atk": 1,
"fort": 2,
"ref": 0,
"will": 2
},
{
"atk": 2,
"fort": 3,
"ref": 0,
"will": 3
},
{
"atk": 3,
"fort": 3,
"ref": 1,
"will": 3
},
{
"atk": 4,
"fort": 4,
"ref": 1,
"will": 4
},
{
"atk": 5,
"fort": 4,
"ref": 1,
"will": 4
},
{
"atk": 6,
"fort": 5,
"ref": 2,
"will": 5
},
{
"atk": 7,
"fort": 5,
"ref": 2,
"will": 5
},
{
"atk": 8,
"fort": 6,
"ref": 2,
"will": 6
},
{
"atk": 9,
"fort": 6,
"ref": 3,
"will": 6
},
{
"atk": 10,
"fort": 7,
"ref": 3,
"will": 7
},
{
"atk": 11,
"fort": 7,
"ref": 3,
"will": 7
},
{
"atk": 12,
"fort": 8,
"ref": 4,
"will": 8
},
{
"atk": 13,
"fort": 8,
"ref": 4,
"will": 8
},
{
"atk": 14,
"fort": 9,
"ref": 4,
"will": 9
},
{
"atk": 15,
"fort": 9,
"ref": 5,
"will": 9
},
{
"atk": 16,
"fort": 10,
"ref": 5,
"will": 10
},
{
"atk": 17,
"fort": 10,
"ref": 5,
"will": 10
},
{
"atk": 18,
"fort": 11,
"ref": 6,
"will": 11
},
{
"atk": 19,
"fort": 11,
"ref": 6,
"will": 11
},
{
"atk": 20,
"fort": 12,
"ref": 6,
"will": 12
}
]
\ No newline at end of file
[
{
"atk": 1,
"fort": 2,
"ref": 0,
"will": 2
},
{
"atk": 2,
"fort": 3,
"ref": 0,
"will": 3
},
{
"atk": 3,
"fort": 3,
"ref": 1,
"will": 3
},
{
"atk": 4,
"fort": 4,
"ref": 1,
"will": 4
},
{
"atk": 5,
"fort": 4,
"ref": 1,
"will": 4
},
{
"atk": 6,
"fort": 5,
"ref": 2,
"will": 5
},
{
"atk": 7,
"fort": 5,
"ref": 2,
"will": 5
},
{
"atk": 8,
"fort": 6,
"ref": 2,
"will": 6
},
{
"atk": 9,
"fort": 6,
"ref": 3,
"will": 6
},
{
"atk": 10,
"fort": 7,
"ref": 3,
"will": 7
},
{
"atk": 11,
"fort": 7,
"ref": 3,
"will": 7
},
{
"atk": 12,
"fort": 8,
"ref": 4,
"will": 8
},
{
"atk": 13,
"fort": 8,
"ref": 4,
"will": 8
},
{
"atk": 14,
"fort": 9,
"ref": 4,
"will": 9
},
{
"atk": 15,
"fort": 9,
"ref": 5,
"will": 9
},
{
"atk": 16,
"fort": 10,
"ref": 5,
"will": 10
},
{
"atk": 17,
"fort": 10,
"ref": 5,
"will": 10
},
{
"atk": 18,
"fort": 11,
"ref": 6,
"will": 11
},
{
"atk": 19,
"fort": 11,
"ref": 6,
"will": 11
},
{
"atk": 20,
"fort": 12,
"ref": 6,
"will": 12
}
]
\ No newline at end of file
[
{
"atk": 0,
"fort": 0,
"ref": 0,
"will": 2,
"spells": [2, 0, 0, 0, 0, 0]
},
{
"atk": 1,
"fort": 0,
"ref": 0,
"will": 3,
"spells": [2, 0, 0, 0, 0, 0]
},
{
"atk": 2,
"fort": 1,
"ref": 1,
"will": 3,
"spells": [3, 0, 0, 0, 0, 0]
},
{
"atk": 3,
"fort": 1,
"ref": 1,
"will": 4,
"spells": [3, 2, 0, 0, 0, 0]
},
{
"atk": 3,
"fort": 1,
"ref": 1,
"will": 4,
"spells": [4, 2, 0, 0, 0, 0]
},
{
"atk": 4,
"fort": 2,
"ref": 2,
"will": 5,
"spells": [4, 3, 0, 0, 0, 0]
},
{
"atk": 5,
"fort": 2,
"ref": 2,
"will": 5,
"spells": [4, 3, 2, 0, 0, 0]
},
{
"atk": 6,
"fort": 2,
"ref": 2,
"will": 6,
"spells": [4, 4, 2, 0, 0, 0]
},
{
"atk": 6,
"fort": 3,
"ref": 3,
"will": 6,
"spells": [5, 4, 3, 0, 0, 0]
},
{
"atk": 7,
"fort": 3,
"ref": 3,
"will": 7,
"spells": [5, 4, 3, 2, 0, 0]
},
{
"atk": 8,
"fort": 3,
"ref": 3,
"will": 7,
"spells": [5, 4, 4, 2, 0, 0]
},
{
"atk": 9,
"fort": 4,
"ref": 4,
"will": 8,
"spells": [5, 5, 4, 3, 0, 0]
},
{
"atk": 9,
"fort": 4,
"ref": 4,
"will": 8,
"spells": [5, 5, 4, 3, 2, 0]
},
{
"atk": 10,
"fort": 4,
"ref": 4,
"will": 9,
"spells": [5, 5, 4, 4, 2, 0]
},
{
"atk": 11,
"fort": 5,
"ref": 5,
"will": 9,
"spells": [5, 5, 5, 4, 3, 0]
},
{
"atk": 12,
"fort": 5,
"ref": 5,
"will": 10,
"spells": [5, 5, 5, 4, 3, 2]
},
{
"atk": 12,
"fort": 5,
"ref": 5,
"will": 10,
"spells": [5, 5, 5, 4, 4, 2]
},
{
"atk": 13,
"fort": 6,
"ref": 6,
"will": 11,
"spells": [5, 5, 5, 5, 4, 3]
},
{
"atk": 14,
"fort": 6,
"ref": 6,
"will": 11,
"spells": [5, 5, 5, 5, 5, 4]
},
{
"atk": 15,
"fort": 6,
"ref": 6,
"will": 12,
"spells": [5, 5, 5, 5, 5, 5]
}
]
\ No newline at end of file
......@@ -32,6 +32,7 @@
},
"prompt": "hp %hp mp %mp> ",
"aliases": {},
"level": 1,
"hp": 100,
"mp": 10,
"maxhp": 100,
......
{"name": "test", "password": "6c76899eb15393064b4f4db94805e5862232920b", "room": "town/tavern", "abilities": {"str": 10, "dex": 23, "con": 10, "int": 12, "wis": 10, "cha": 8}, "equipment": {"finger": [null, null], "hand": [null, null], "arm": [null, null], "leg": [null, null], "foot": [null, null], "head": null, "neck": null, "back": null, "body": null, "waist": null}, "inventory": {"bag": [{"expires": 0, "inventory": {"shirt": [{"expires": 0}]}}]}, "prompt": "hp %hp mp %mp> ", "aliases": {}, "hp": 100, "mp": 10, "maxhp": 100, "maxmp": 10, "maxsta": 10, "sta": 10, "aa": "1d2", "mpr": 0.25, "star": 0.4, "weapon": null, "sp": {}, "at": {"kick": {"cost": 5, "dmg": "2d4", "desc": "You unleash a powerful kick"}}, "createstep": 7, "color_enabled": true, "over_13": true, "race": "Android", "theme": "Ace Pilot", "class": "Envoy", "abilitypoints": 0}
\ No newline at end of file
{"name": "test", "password": "6c76899eb15393064b4f4db94805e5862232920b", "room": "town/tavern", "abilities": {"str": 10, "dex": 23, "con": 10, "int": 12, "wis": 10, "cha": 8}, "equipment": {"finger": [null, null], "hand": [null, null], "arm": [null, null], "leg": [null, null], "foot": [null, null], "head": null, "neck": null, "back": null, "body": null, "waist": null}, "inventory": {"bag": [{"expires": 0, "inventory": {"shirt": [{"expires": 0}]}}]}, "prompt": "hp %hp mp %mp> ", "aliases": {}, "hp": 100, "mp": 10, "maxhp": 100, "maxmp": 10, "maxsta": 10, "sta": 10, "aa": "1d2", "mpr": 0.25, "star": 0.4, "weapon": null, "sp": {}, "at": {"kick": {"cost": 5, "dmg": "2d4", "desc": "You unleash a powerful kick"}}, "createstep": 7, "color_enabled": true, "over_13": true, "race": "Android", "theme": "Ace Pilot", "class": "Envoy", "abilitypoints": 0, "baseattack": 0, "fort": 0, "ref": 2, "will": 2}
\ No newline at end of file
......
......@@ -109,46 +109,57 @@ classes = {
"keyability": "cha",
"proficiencies": ["light armor", "basic melee", "grenades", "small arms"],
"skillperlevel": 8,
},
"hp": 6
},
"Mechanic": {
"skills": ["Athletics", "Perception", "Computers", "Physical Science", "Engineering", "Piloting", "Medicine", "Profession"],
"keyability": "int",
"proficiencies": ["light armor", "basic melee", "grenades", "small arms"],
"skillperlevel": 4,
},
"hp": 6
},
"Mystic": {
"skills": ["Bluff", "Medicine", "Culture", "Mysticism", "Diplomacy", "Perception", "Disguise", "Profession", "Intimidate", "Sense Motive", "Life Science", "Survival"],
"keyability": "wis",
"proficiencies": ["light armor", "basic melee", "small arms"],
"skillperlevel": 6,
},
"hp": 6
},
"Operative": {
"skills": ["Acrobatics", "Medicine", "Athletics", "Perception", "Bluff", "Piloting", "Computers", "Profession", "Culture", "Sense Motive", "Disguise", "Sleight of Hand", "Engineering", "Stealth", "Intimidate", "Survival"],
"keyability": "dex",
"proficiencies": ["light armor", "basic melee", "small arms", "sniper weapons"],
"skillperlevel": 8,
},
"hp": 6
},
"Solarian": {
"skills": ["Acrobatics", "Perception", "Athletics", "Physical Science", "Diplomacy", "Profession", "Intimidate", "Sense Motive", "Mysticism", "Stealth"],
"keyability": "cha",
"proficiencies": ["light armor", "basic melee", "advanced melee", "small arms"],
"skillperlevel": 4,
},
"hp": 7
},
"Soldier": {
"skills": ["Acrobatics", "Medicine", "Athletics", "Piloting", "Engineering", "Profession", "Intimidate", "Survival"],
"keyability": "str",
"proficiencies": ["light armor", "heavy armor", "basic melee", "advanced melee", "small arms", "long arms", "heavy weapons", "sniper weapons", "grenades"],
"skillperlevel": 4,
},
"hp": 7
},
"Technomancer": {
"skills": ["Computers", "Physical Science", "Engineering", "Piloting", "Life Science", "Profession", "Mysticism", "Sleight of Hand"],
"keyability": "int",
"proficiencies": ["light armor", "basic melee", "small arms"],
"skillperlevel": 4,
}
"hp": 5
}
}
def get_ability_mod(id, ability):
ability_modifiers = [-5, -4, -4, -3, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8]
return ability_modifiers[players[id]["abilities"][ability]]
def show_prompt(pid):
if "prompt" not in players[pid]:
players[pid]["prompt"] = "> "
......@@ -370,13 +381,29 @@ def handle_character_create(id, command, params):
mud.send_message(id, '%cyanPlease spend all available ability points.')
show_abilities(id)
else:
pclass = classes[players[id]["class"]]
class_bonuses = load_object_from_file('data/{}_bonus.json'.format(players[id]["class"].lower()))
players[id]["baseattack"] = class_bonuses[0]["atk"]
players[id]["fort"] = class_bonuses[0]["fort"]
players[id]["ref"] = class_bonuses[0]["ref"]
players[id]["will"] = class_bonuses[0]["will"]
players[id]["maxhp"] = races[players[id]["race"]]["hp"] + pclass["hp"]
players[id]["hp"] = players[id]["maxhp"]
# Class SP is the same HP, so no need to store both in the classes dict
players[id]["maxsp"] = get_ability_mod(id, "con") + pclass["hp"]
players[id]["sp"] = players[id]["maxsp"]
players[id]["maxrp"] = 1 + get_ability_mod(id, pclass["keyability"])
if players[id]["maxrp"] < 1:
players[id]["maxrp"] = 1
players[id]["rp"] = players[id]["maxrp"]
players[id]["createstep"] = 7
elif not command.isdigit() or int(command) + 1 > len(players[id]["abilities"]) or int(command) < 0:
show_abilities(id)
else:
ability_name = list(players[id]["abilities"])[int(command)]
if players[id]["abilitypoints"] > 0:
if players[id]["abilities"][ability_name] >= 18:
mud.send_message(id, '%cyanYou cannot raise an ability higher than 18 during character creation.')
elif players[id]["abilitypoints"] > 0:
players[id]["abilities"][ability_name] += 1
players[id]["abilitypoints"] -= 1
show_abilities(id)
......@@ -442,12 +469,12 @@ while True:
if id not in players:
continue
# go through all the players in the game
for pid, pl in players.items():
# send each player a message to tell them about the diconnected
# player
if players[pid].get("name") is not None:
mud.send_message(pid, "{} quit the game".format(players[pid]["name"]))
# # go through all the players in the game
# for pid, pl in players.items():
# # send each player a message to tell them about the diconnected
# # player
# if players[pid].get("name") is not None:
# mud.send_message(pid, "{} quit the game".format(players[pid]["name"]))
# remove the player's entry in the player dictionary
if players[id]["name"] is not None:
......