updating for new npc generator
This commit is contained in:
parent
6d62f46510
commit
cdbd92397b
|
@ -3,8 +3,7 @@ import collections
|
|||
from pathlib import Path
|
||||
|
||||
from rolltable.tables import RollTable
|
||||
from npc.generator.base import generate_npc
|
||||
|
||||
from npc import random_npc
|
||||
|
||||
Crime = collections.namedtuple('Crime', ['name', 'min_bounty', 'max_bounty'])
|
||||
|
||||
|
@ -39,7 +38,7 @@ class BaseJob:
|
|||
self._name = name
|
||||
self._details = details
|
||||
self._reward = reward
|
||||
self._contact = contact or generate_npc()
|
||||
self._contact = contact or random_npc()
|
||||
self._location = location
|
||||
|
||||
@property
|
||||
|
@ -129,7 +128,7 @@ class Bounty(BaseJob):
|
|||
@property
|
||||
def target(self):
|
||||
if not self._target:
|
||||
self._target = generate_npc()
|
||||
self._target = random_npc()
|
||||
return self._target
|
||||
|
||||
|
||||
|
@ -144,7 +143,7 @@ class Determinant(BaseJob):
|
|||
class Escort(BaseJob):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self._contact = generate_npc()
|
||||
self._contact = random_npc()
|
||||
self._location = generate_location('settlements')
|
||||
self._destination = generate_location('default')
|
||||
self._reward = f"{nearest(random.randint(5, 20), step=5)} GP/day"
|
||||
|
|
|
@ -10,13 +10,16 @@ from site_tools.shell.base import BasePrompt, command
|
|||
from site_tools import campaign
|
||||
from site_tools import jobs
|
||||
|
||||
from npc.generator.base import generate_npc
|
||||
from reckoning.calendar import TelisaranCalendar
|
||||
from reckoning.telisaran import Day
|
||||
from reckoning.telisaran import ReckoningError
|
||||
|
||||
import npc
|
||||
|
||||
BINDINGS = KeyBindings()
|
||||
|
||||
ANCESTRY_PACK, ANCESTRIES = npc.load_ancestry_pack()
|
||||
|
||||
|
||||
class DMShell(BasePrompt):
|
||||
def __init__(self, cache={}):
|
||||
|
@ -203,31 +206,19 @@ class DMShell(BasePrompt):
|
|||
[title]CLI[/title]
|
||||
|
||||
[link]npc --ancestry ANCESTRY[/link]
|
||||
""", completer=WordCompleter(
|
||||
[
|
||||
'human',
|
||||
'dragon',
|
||||
'drow',
|
||||
'dwarf',
|
||||
'elf',
|
||||
'highelf',
|
||||
'halfling',
|
||||
'halforc',
|
||||
'tiefling',
|
||||
'hightiefling',
|
||||
]
|
||||
))
|
||||
""", completer=WordCompleter(list(ANCESTRIES.keys())))
|
||||
def npc(self, parts=[]):
|
||||
"""
|
||||
Generate an NPC commoner
|
||||
"""
|
||||
c = generate_npc(ancestry=parts[0] if parts else None)
|
||||
char = npc.random_npc([parts[0]] if parts else [])
|
||||
self.console.print(char.ancestry.capitalize())
|
||||
self.console.print("\n".join([
|
||||
"",
|
||||
f"{c.description}",
|
||||
f"Personality: {c.personality}",
|
||||
f"Flaw: {c.flaw}",
|
||||
f"Goal: {c.goal}",
|
||||
f"{char.description}",
|
||||
f"Personality: {char.personality}",
|
||||
f"Flaw: {char.flaw}",
|
||||
f"Goal: {char.goal}",
|
||||
"",
|
||||
]))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user