Browse Source

Just add classes and items to the lists

master
Noëlle 3 years ago
parent
commit
9250488324
1 changed files with 31 additions and 8 deletions
  1. 31
    8
      koboldgen.py

+ 31
- 8
koboldgen.py View File

@@ -165,6 +165,11 @@ class Character:
{"id": 13, "name": "Cloak of Desorption", "description": "The cloak starts out black. As an Event, you can cause a gas to evaporate from the cloak, leaving it a dingy gray and healing 1 Body to anyone within ten feet of you. The cloak becomes black again after a nap.", "reusable": True},
{"id": 14, "name": "Cloak of Food Portions", "description": "Wearing this cloak causes it to flare out at the base, making the wearer resemble a pyramid. In conversations regarding food the wearer can add +2 to Brains rolls when trying to convince others to alter their diets. This can be done once per nap. Considering how many large things tend to snack on kobolds, this has been found to actually be quite useful.", "reusable": True},
{"id": 15, "name": "Huge Goggles", "description": "If you take Body damage, roll 1d6; on a 6, the lenses of the Goggles break until you take a nap.", "reusable": True},
{"id": 123, "name": "Shortbow of the Watch", "description": "Choose a single target. You get +1 to Body damage against that target and +1 to Brain rolls to track that target. Activating this is not an Event.", "reusable": True},
{"id": 124, "name": "Hammer of Thunderbolts", "description": "You get +1 Body damage on any successful or partially successful attack with this weapon. You can also throw it at a target or surface, which will stun any creature within 30 feet of the impact for 1d6 Events.", "reusable": True},
{"id": 125, "name": "Eldritch Cannon", "description": "You conjure a small cannon that can produce a single spell effect of your choice as an Event.", "reusable": True},
{"id": 126, "name": "Staff of Lightning", "description": "As an Event, create a lightning bolt from the tip of the staff that travels 30 feet in a straight line and deals 2 Body damage to any target in its path.", "reusable": True},
{"id": 127, "name": "Voyager Staff", "description": "Any spell you cast has +1 damage. In addition, as an Event, you can move up to 50 feet in any direction - even through walls and other solid surfaces.", "reusable": True}
]
CAREERS = [ {"id": 0, "name": "Soldier/Guard"},
{"id": 1, "name": "Pilot"},
@@ -178,7 +183,12 @@ class Character:
{"id": 9, "name": "Cook"},
{"id": 10, "name": "Cartographer"},
{"id": 11, "name": "Inventor"},
{"id": 12, "name": "Merchant"}
{"id": 12, "name": "Merchant"},
{"id": 123, "name": "Ranger"},
{"id": 124, "name": "Barbarian"},
{"id": 125, "name": "Artificer"},
{"id": 126, "name": "Druid"},
{"id": 127, "name": "Wizard"}
]

def __init__(self, name=None, career=None, stats=None, gadget=None):
@@ -188,7 +198,7 @@ class Character:
elif isinstance(career, str):
self.career = career
elif isinstance(career, int) and career < len(Character.CAREERS):
self.career = [x for x in Character.CAREERS if x["id"] == career][0]["name"]
self.career = [x for x in Character.CAREERS if x["id"] == career][0]
else:
self.career = ""
self.stats = stats if stats != None else []
@@ -521,11 +531,11 @@ class Campaign:
self.params = Plot()
self.art = "an" if self.params.loc_desc[0] in ["a","e","i","o","u"] else "a"
self.characters = []
self.characters.append(Character("Niwri", "Hunter", [3,4,4,3], "Shortbow of the Watch"))
self.characters.append(Character("Zax", "Barbarian", [1, 6, 2, 5], "Hammer of Thunderbolts"))
self.characters.append(Character("Chroma", "Artificer", [4, 2, 5, 3], "Eldritch Cannon"))
self.characters.append(Character("Zenosha", "Druid", [3, 3, 5, 3], "Staff of Lightning"))
self.characters.append(Character("Snax", "Wizard", [2, 4, 5, 1], "Voyager Staff"))
self.characters.append(Character("Niwri", 123, [3,4,4,3], 123))
self.characters.append(Character("Zax", 124, [1, 6, 2, 5], 124))
self.characters.append(Character("Chroma", 125, [4, 2, 5, 3], 125))
self.characters.append(Character("Zenosha", 126, [3, 3, 5, 3], 126))
self.characters.append(Character("Snax", 127, [2, 4, 5, 1], 127))
# self.print_params()
# self.print_chars()
return
@@ -845,6 +855,18 @@ class Campaign:
if html:
print(f"</div>\n<br clear='all'>\n")

def print_password(self, html=False):
pw = self.generate_key()
if html:
out = (
f"<div id='password'>"
f"<span>Permalink to this campaign:</span><br>"
f"<span><a href='http://node.noelle.codes/kobold?pw={pw.replace(' ', '')}'>{pw}</a></span>"
f"</div>"
)
else:
print(f"Password: {pw}")

def decode(self, pwd):
pass

@@ -875,11 +897,12 @@ if __name__ == "__main__":
cmp = Campaign(fromPW = True, pw=args.password)
cmp.print_params(html=html)
cmp.print_chars(html=html)
cmp.print_password(html=html)
elif args.campaign:
cmp = Campaign(args.campaign)
cmp.print_params(html=html)
cmp.print_chars(html=html)
print(cmp.generate_key())
cmp.print_password(html=html)
elif args.params:
cmp = Campaign(makeChars=False)
cmp.print_params(html=html)

Loading…
Cancel
Save