Noëlle 4 роки тому
джерело
коміт
221b7eaf4a
1 змінених файлів з 9 додано та 91 видалено
  1. 9
    91
      koboldgen.py

+ 9
- 91
koboldgen.py Переглянути файл

@@ -2,6 +2,7 @@ import random as r
import argparse
import sys
import adversaries
import gear

beg = ["a","e","i","o","u","ba","be","bi","bo","bu","by","y","da","de","di","do","du","dy","fa","fi","fo","fe","fu","ga","ge","gi","go","gu","ka","ke","ki","ko","ku","ky","ma","me","mi","mo","mu","na","ne","ni","no","nu","pa","pe","pi","po","pu","ra","re","ri","ro","ru","ry","sa","se","si","so","su","ta","te","ti","to","tu","ty","wa","we","wi","wo","wy","za","ze","zi","zo","zu","zy"]
mid = beg + ["l","x","n","r"]
@@ -44,74 +45,6 @@ class Plot:
loc2 = ["asteroid","moon","space station","spaceship","ringworld","Dyson sphere","planet","Space Whale","pocket of folded space","time vortex","Reroll"]
miss = ["explore","loot everything not bolted down too securely","find the last group of kobolds who came here","find a rumored secret weapon","find a way to break someone else's secret weapon","claim this place in the name of the Kobold Empire","make friends","rediscover lost technology","find lost magical items","find and defeat a powerful enemy"]
prob = adversaries.prob
# [
# {
# "id": 0,
# "name": "an Undead Sample Pack (swarm of zombies and skeletons)",
# "shortname": "undead",
# "stats": [0,5,2,6],
# },
# {
# "id": 1,
# "name": "a rival band of kobolds",
# "shortname": "kobold rivals",
# "stats": [3,3,4,4],
# },
# {
# "id": 2,
# "name": "a detachment from the Elf Armada",
# "shortname": "elves",
# "stats": [4,3,5,4],
# },
# {
# "id": 3,
# "name": "refugees with parasites. Big parasites",
# "shortname": "refugees",
# "stats": [2,4,0,0],
# },
# {
# "id": 4,
# "name": "an artificial intelligence bent on multi-world domination",
# "shortname": "AI",
# "stats": [4,1,6,3],
# },
# {
# "id": 5,
# "name": "robot spiders",
# "shortname": "spiders",
# "stats": [3,3,2,4],
# },
# {
# "id": 6,
# "name": "semi-intelligent metal eating slime",
# "shortname": "slime",
# "stats": [0,2,1,5],
# },
# {
# "id": 7,
# "name": "a living asteroid that intends to follow the kobolds home like the largest puppy",
# "shortname": "asteroid",
# "stats": [2,3,1,6],
# },
# {
# "id": 8,
# "name": "an old lich that wants everyone to stay off of their 'lawn'",
# "shortname": "lich",
# "stats": [5,2,6,3],
# },
# {
# "id": 9,
# "name": "elder gods hailing from the dark spaces between the stars",
# "shortname": "gods",
# "stats": [0,6,6,6],
# },
# {
# "id": 10,
# "name": "a Flying Brain Monster",
# "shortname": "Flying Brain Monster",
# "stats": [2,3,6,1],
# },
# ]
def __init__(self, loc_desc=None, locIndex=None, battlefield=None, location=None, missIndex=None, oops=None, mission=None, probIndex=None, problem=None, probName=None, secProblem=None, thirdProblem=None):
self.loc_desc = loc_desc if loc_desc != None else Plot.loc1[r.randint(0, len(Plot.loc1)-1)]
@@ -173,28 +106,7 @@ class Plot:

class Character:
# Remember to update gen_gadget() when you add gadgets
GADGETS = [ {"id": 0, "name": "Awesome Dagger of Sneak(?) Attacks", "description": "Yell 'Sneak Attack!' to count a mixed-success Body attack as a success.", "reusable": True},
{"id": 1, "name": "Button of Uselessness", "description": f"This large, red button can be stuck onto any flat surface, horizontal, vertical, or otherwise. A short time after it has been placed, any character (friend or foe) nearby must succeed a Brains roll to avoid pressing the button. Pressing the button does nothing, but this action takes the place of anything that might otherwise be done during an Event if the Brains roll is failed. The button can be pressed {r.randint(1,6)} times before it breaks and no longer compels others to press it.", "reusable": False},
{"id": 2, "name": "Encyclopedia of Stuff I Totally Knew", "description": "Add 2 points to the target number of any uncontested Brains roll, or 1 point to the target number of a contested Brains roll.", "reusable": True},
{"id": 3, "name": "Medkit", "description": "Make a Brains/Order roll to restore 2 lost Body points, or 1 on a Mixed Success. If the character has medical training, restored Body points may be doubled.", "reusable": False},
{"id": 4, "name": "Potion of Healing", "description": "Restore 1 lost Body point. Using counts as an Event but no roll is needed unless it’s contested.", "reusable": False},
{"id": 5, "name": "Tinfoil Helm of Shielding", "description": "Count any Brains damage as a mixed success. If you take Body damage, roll 1d6; on a 6, the Helm is useless until you take a nap.", "reusable": True},
{"id": 6, "name": "Handy Toothbrush", "description": "Scrub the Space Gunk off whatever object you're interacting with to turn a mixed Order success to make that object work into a full success.", "reusable": True},
{"id": 7, "name": "Jar of ... Something", "description": "Throw it (Body/Chaos) at another character to make them spend an Event cleaning it off, or throw it at the floor to make a ten-foot circle of difficult terrain.", "reusable": False},
{"id": 8, "name": "Pocket Sand!", "description": "Yell 'Pocket Sand!' to count a successful Body attack against you as a mixed success.", "reusable": False},
{"id": 9, "name": "The Fabulous Grappling Hook", "description": "As an Event, instantly move 50 feet in any direction. (Make sure you have 50 feet available to move in or take 1 Body damage when you arrive short of that.)", "reusable": True},
{"id": 10, "name": "Pocket Accordion", "description": "Make a Brains/Order or Brains/Chaos roll. On a success, any nearby opponent has -1 Brains during their next event. On a failure, everybody nearby, including you, has -1 Brains on their next event.", "reusable": True},
{"id": 11, "name": "Cloak of Adsorption", "description": "The cloak starts out white. Whenever you are the target of a successful attack, the cloak becomes the color of whatever hit you. If your cloak is already the same color as whatever hit you, the attack becomes a mixed success and the cloak turns black and can no longer absorb colors. The cloak becomes white again after a nap.", "reusable": True},
{"id": 12, "name": "Cloak of Absorption", "description": "The cloak starts out white. You can remove the cloak and lay it over difficult terrain to make it easy terrain; if the terrain is difficult because the ground is wet, the cloak becomes wet and the ground in that area becomes dry. The cloak dries out after a nap.", "reusable": True},
{"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. As an Event, 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, semi-autonomous and semi-intelligent 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}
]
GADGETS = gear.gadgets
# Remember to update gen_career() when you add careers
CAREERS = [ {"id": 0, "name": "Soldier/Guard"},
{"id": 1, "name": "Pilot"},
@@ -231,8 +143,12 @@ class Character:
self.gadget = ""
elif isinstance(gadget, str) or isinstance(gadget, dict):
self.gadget = gadget
if type(self.gadget["description"]) != str:
self.gadget["description"] = self.gadget["description"]()
else:
self.gadget = next((x for x in Character.GADGETS if x["id"] == gadget), "")
if type(self.gadget["description"]) != str:
self.gadget["description"] = self.gadget["description"]()
self.generate()

def generate(self):
@@ -280,8 +196,10 @@ class Character:
self.career = next((x for x in Character.CAREERS if x["id"] == cid), "")

def gen_gadget(self):
gid = r.randint(0,15)
gid = r.randint(0,(len(gear.gadgets) - 5))
self.gadget = [x for x in Character.GADGETS if x["id"] == gid][0]
if type(self.gadget["description"]) != str:
self.gadget["description"] = self.gadget["description"]()

def print_name(self, html=False):
if isinstance(self.career, str):

Завантаження…
Відмінити
Зберегти