🔥 monster and spell files no longer part

This commit is contained in:
Nikolaj Danger
2020-08-03 15:00:54 +02:00
parent 83a93145db
commit cd1eff01a0
4 changed files with 82 additions and 1 deletions

View File

@ -17,3 +17,5 @@ And much more!!! (not really. That's pretty much all it can do. See help files i
## Setup
Running gwendolyn.py will help you set up. You will need a bot token on hand, which you should paste into your terminal when prompted.
You will need to populate monsters.json and spells.json with monsters and spells. The files are created in the resources folder when running the program.

View File

@ -26,7 +26,7 @@ def monsterFunc(command):
# Opens "mensters.json"
data = json.load(open('resources/monsters.json', encoding = "utf8"))
for monster in data:
if str(command) == monster["name"]:
if "name" in monster and str(command) == monster["name"]:
logThis("Found it!")
# Looks at the information about the monster and returns that information

View File

@ -158,6 +158,29 @@ def makeFiles():
finally:
f.close()
# Creates monsters.json if it doesn't exist
try:
f = open("resources/monsters.json","r")
except:
logThis("monsters.json didn't exist. Making it now.")
with open("resources/lookupExamples.json") as f:
data = json.load(f)["monster"]
with open("resources/monsters.json","w") as f:
json.dump(data,f,indent = 4)
finally:
f.close()
# Creates spells.json if it doesn't exist
try:
f = open("resources/spells.json","r")
except:
logThis("spells.json didn't exist. Making it now.")
with open("resources/lookupExamples.json") as f:
data = json.load(f)["spell"]
with open("resources/spells.json","w") as f:
json.dump(data,f,indent = 4)
finally:
f.close()
# Creates destinyPoints.txt if it doesn't exist
try:

View File

@ -0,0 +1,56 @@
{
"monster" : [
{
"name": "Bandit",
"size": "Medium",
"type": "humanoid",
"subtype": "any race",
"alignment": "any non-lawful alignment",
"armor_class": 12,
"hit_points": 11,
"hit_dice": "2d8",
"speed": "30 ft.",
"strength": 11,
"dexterity": 12,
"constitution": 12,
"intelligence": 10,
"wisdom": 10,
"charisma": 10,
"damage_vulnerabilities": "",
"damage_resistances": "",
"damage_immunities": "",
"condition_immunities": "",
"senses": "passive Perception 10",
"languages": "any one language (usually Common)",
"challenge_rating": "1/8",
"actions": [
{
"name": "Scimitar",
"desc": "Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) slashing damage.",
"attack_bonus": 3,
"damage_dice": "1d6",
"damage_bonus": 1
},
{
"name": "Light Crossbow",
"desc": "Ranged Weapon Attack: +3 to hit, range 80 ft./320 ft., one target. Hit: 5 (1d8 + 1) piercing damage.",
"attack_bonus": 3,
"damage_dice": "1d8",
"damage_bonus": 1
}
]
}
],
"spell": {
"Fireball" : {
"casting_time" : "1 action",
"components" : "V, S, M (a tiny ball of bat guano and sulfur)",
"description" : "A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that arent being worn or carried. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd.",
"duration" : "Instantaneous",
"level" : "3rd",
"range" : "150 feet",
"school" : "Evocation",
"ritual" : false
}
}
}