Reference¶
coc_gen¶
Occupations.
- coc_gen.get_investgator_class(ruleset)¶
Get an investgator class that implements the given ruleset.
- Parameters:
ruleset (str) – The ruleset you want to follow. All can be found in RULESETS.
- Raises:
NotImplementedError – The ruleset
- Returns:
A subclass of Investigator
- Return type:
coc_gen.base_classes¶
Base classes that can be specialised to implement different rulesets.
- class coc_gen.base_classes.Investigator(locale=None, sex=None, name=None, basevalues=None, occupation=None, skills=None)¶
An Investigator.
See __init__() for creation options
- __init__(locale=None, sex=None, name=None, basevalues=None, occupation=None, skills=None)¶
Create an Investigator.
- Parameters:
locale (str, optional) – The locale the Investigator is active in. Sent to Faker that is used to create their name. More info: https://faker.readthedocs.io/en/stable/#localization. Defaults to None.
sex (str, optional) – Sex of the Investigator, if None random. Defaults to None.
name (str, optional) – Name of the Investigator, if None random according to the locale. Defaults to None.
basevalues (dict[str,int], optional) – Basevalues of the Investigator, if None random. Defaults to None.
occupation (str, optional) – Occupation of the Investigator, if None random. Defaults to None.
skills (dict[str,int], optional) – _description_. Defaults to None.
- property as_dict: dict¶
Return a dict that describes the investigator, sutable to use in from_dict().
- Returns:
dict – _description_
- property build: int¶
The build of the investigator.
- Returns:
a static value
- Return type:
int
- property damage_bonus: str¶
The damage bonus of the investigator.
- Returns:
A dice or static value
- Return type:
str
- classmethod from_dict(d)¶
Create an investigator from a dict in the format returned by as_dict().
- Parameters:
d (dict) – The dict
- Return type:
- Returns:
Investigator – The investigator
- class coc_gen.base_classes.Occupation(name, skill_points, credit_range, occupation_skills)¶
An Occupation.
- __init__(name, skill_points, credit_range, occupation_skills)¶
Create an Occupation.
- Parameters:
name (str) – Name of the occupation
skill_points (str) – The number of skill points the Occupation gets (for syntax see calc_skillpoints())
credit_range (tuple[int,int]) – Min and max credit range for the occupation
occupation_skills (list[str]) – list of possible skill
- calc_skillpoint(basevalues)¶
Calculate the skillpoint for this occupation with the given base values.
- The syntax of the occupations skill point settings are something like:
“UTB×2+STY×2” or “UTB×4” ie. multiplication of a base values with integers and then optional addition addition
- Parameters:
basevalues (dict[str,int]) – The base values of the character that have the occupation.
- Returns:
the calculated skill points
- Return type:
int
- get_skill_instance()¶
Get a instance of skills for the occupation.
Any skills that are a key to the special_skills dictionary are replaced with a random skill from the keys item. The returned skills are in a random order.
- Returns:
_description_
- Return type:
list[str]
- class coc_gen.base_classes.Skill(name, default_value)¶
A CoC skill, with name and a default value.
- __init__(name, default_value)¶
Create a Skill.
- Parameters:
name (str) – Name of the skill
default_value (str) – A string describing the default value of the skill. See instance_value() for format of the string
- get_value(value)¶
Get a specific skill value.
- Parameters:
value (int) – the specific value to get
- Returns:
The skill value
- Return type:
- instance_value(base_values)¶
Instanciate a default value for the skill.
- Parameters:
base_values (dict[str, int]) – Base values to use for the calculation of the default value
- Returns:
The skill value
- Return type:
- class coc_gen.base_classes.SkillValue(skill, value)¶
A specific value of a skill.
The skill can be accessed via skill and the value via value It is ordered via the value (also against integers) It supports addition and subtraction with other SkillValue:s and integers.
- __init__(skill, value)¶
Create a specific value for a skill.
- Parameters:
skill (Skill) – The skill
value (int) – The value
- property fifth_value: int¶
The fifth value.
- Returns:
the fifth value
- Return type:
int
- property half_value: int¶
The half value.
- Returns:
the half value
- Return type:
int
- coc_gen.base_classes.random() x in the interval [0, 1). ¶
coc_gen.cli¶
Command line interface.
coc_gen.coc_swe¶
Ruleset for Call of Cthulhu Sverige.
- class coc_gen.coc_swe.SweInvestigator(locale=None, sex=None, name=None, basevalues=None, occupation=None, skills=None)¶
An Investigator in Call of Cathulu Sverige.
- class coc_gen.coc_swe.SweOccupation(name, skill_points, credit_range, occupation_skills)¶
An Occupation.
coc_gen.coc_eng¶
Rulesets for Call of Cthulhu clasic and modern.
- class coc_gen.coc_eng.ModernInvestigator(locale=None, sex=None, name=None, basevalues=None, occupation=None, skills=None)¶
An Investigator in Call of Cathulu set in the modern era.
- class coc_gen.coc_eng.ModernOccupation(name, skill_points, credit_range, occupation_skills)¶
An Occupation in a modern setting.
- class coc_gen.coc_eng.TwentiesInvestigator(locale=None, sex=None, name=None, basevalues=None, occupation=None, skills=None)¶
An Investigator in Call of Cathulu set in the twenties.
- class coc_gen.coc_eng.TwentiesOccupation(name, skill_points, credit_range, occupation_skills)¶
An Occupation in the Classic setting.