2024-06-23 11:57:26 +00:00
|
|
|
from marshmallow import Schema, fields, validate
|
|
|
|
|
2024-06-23 17:30:13 +00:00
|
|
|
chartype_field = fields.String(
|
|
|
|
required=True,
|
2024-06-23 23:47:38 +00:00
|
|
|
validate=validate.OneOf(["human", "humanoid", "mutant", "cyborg"]),
|
2024-06-23 17:30:13 +00:00
|
|
|
description='The characters type of being'
|
|
|
|
)
|
|
|
|
|
2024-06-24 08:35:29 +00:00
|
|
|
conscore_field = fields.Integer(
|
|
|
|
required=True,
|
|
|
|
default=10,
|
|
|
|
validate=validate.Range(min=3, max=18),
|
|
|
|
description='The constitution score of the character'
|
|
|
|
)
|
|
|
|
|
2024-06-23 11:57:26 +00:00
|
|
|
|
2024-06-24 07:57:35 +00:00
|
|
|
class MutationSchema(Schema):
|
2024-06-24 08:35:29 +00:00
|
|
|
conscore = conscore_field
|
2024-06-24 07:57:35 +00:00
|
|
|
intscore = fields.Integer(
|
|
|
|
required=True,
|
2024-06-24 08:35:29 +00:00
|
|
|
validate=validate.Range(min=3, max=18),
|
2024-06-24 07:57:35 +00:00
|
|
|
description='The characters intelligence score'
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class HPSchema(Schema):
|
|
|
|
chartype = chartype_field
|
2024-06-24 08:35:29 +00:00
|
|
|
conscore = conscore_field
|
2024-06-24 07:57:35 +00:00
|
|
|
|
|
|
|
|
2024-06-23 11:57:26 +00:00
|
|
|
class DiceSchema(Schema):
|
2024-06-24 07:57:35 +00:00
|
|
|
quantity = fields.Int(
|
|
|
|
required=True,
|
|
|
|
default=1,
|
|
|
|
validate=validate.Range(min=1),
|
|
|
|
description='The number of dice to roll'
|
|
|
|
)
|
|
|
|
geometry = fields.Int(
|
|
|
|
required=True,
|
|
|
|
default=2,
|
|
|
|
validate=validate.Range(min=2),
|
|
|
|
description='The number of sides on each die'
|
|
|
|
)
|
|
|
|
discard_lowest = fields.Bool(required=True, default=False, description='Drop the lowest score')
|
2024-06-23 11:57:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CharacterSchema(Schema):
|
2024-06-23 17:30:13 +00:00
|
|
|
chartype = chartype_field
|
|
|
|
|
|
|
|
|
|
|
|
class AbilitySchema(Schema):
|
|
|
|
chartype = chartype_field
|
|
|
|
ability = fields.String(
|
|
|
|
required=False,
|
|
|
|
default="generic",
|
|
|
|
validate=validate.OneOf(
|
|
|
|
["m-strength", "p-strength", "intelligence", "charisma", "constitution", "dexterity", "all"]),
|
|
|
|
description='One of the six character attributes from the character sheet'
|
2024-06-23 11:57:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-06-24 20:00:40 +00:00
|
|
|
class CheckSchema(Schema):
|
|
|
|
ability_score = fields.Integer(
|
|
|
|
required=True,
|
|
|
|
default=10,
|
|
|
|
validate=validate.Range(min=3, max=21),
|
|
|
|
description='The score of the ability to be checked against'
|
|
|
|
)
|
|
|
|
multiplier = fields.Integer(
|
|
|
|
required=True,
|
|
|
|
default=4,
|
|
|
|
validate=validate.Range(min=2, max=8),
|
|
|
|
description='Sets the threshold for the check. In general, the higher the multiplier, the higher the '
|
|
|
|
'likelihood of success. Range: 2 - 7'
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-06-23 11:57:26 +00:00
|
|
|
class EncounterSchema(Schema):
|
|
|
|
terrain = fields.String(
|
|
|
|
required=True,
|
2024-06-23 23:47:38 +00:00
|
|
|
default="clear",
|
2024-06-23 11:57:26 +00:00
|
|
|
validate=validate.OneOf(["clear", "mountains", "forest", "desert", "watery", "ruins", "deathlands"]),
|
|
|
|
description='The terrain traversed at the time of the encounter roll'
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class MentalAttackSchema(Schema):
|
|
|
|
ams = fields.Integer(
|
|
|
|
required=True,
|
|
|
|
validate=validate.Range(min=3, max=18),
|
|
|
|
description='The Attackers Mental Strength'
|
|
|
|
)
|
|
|
|
dms = fields.Integer(
|
|
|
|
required=True,
|
|
|
|
validate=validate.Range(min=3, max=18),
|
|
|
|
description='The Defenders Mental Strength'
|
|
|
|
)
|
|
|
|
modifier = fields.Integer(
|
|
|
|
required=False,
|
|
|
|
default=0,
|
|
|
|
validate=validate.Range(min=-100, max=100),
|
|
|
|
description='Roll modifier for mental attack'
|
|
|
|
)
|
2024-06-29 14:40:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PhysicalAttackSchema(Schema):
|
|
|
|
weapon_attack = fields.Boolean(
|
|
|
|
required=True,
|
|
|
|
default=True,
|
|
|
|
description="Is the attacker using a weapon? If so, To-Hit is based on weapon class."
|
|
|
|
)
|
|
|
|
dac = fields.Integer(
|
|
|
|
required=True,
|
|
|
|
min=1,
|
|
|
|
max=10,
|
|
|
|
default=1,
|
|
|
|
description='The defenders armour class. This is needed for both weapon attacks and non-weapon attacks'
|
|
|
|
)
|
|
|
|
awc = fields.Integer(
|
|
|
|
required=False,
|
|
|
|
min=1,
|
|
|
|
max=16,
|
|
|
|
default=1,
|
|
|
|
description='The attackers weapon class. This is needed for weapon attacks only.'
|
|
|
|
)
|
|
|
|
ahd = fields.Integer(
|
|
|
|
required=False,
|
|
|
|
min=1,
|
|
|
|
max=16,
|
|
|
|
default=1,
|
|
|
|
description='The attackers hit dice count. This is needed for non-weapon attacks only.'
|
|
|
|
)
|
|
|
|
modifier = fields.Integer(
|
|
|
|
required=False,
|
|
|
|
min=-100,
|
|
|
|
max=100,
|
|
|
|
default=0,
|
|
|
|
description='The roll modifier to be applied to the hit roll.'
|
|
|
|
)
|