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,
|
|
|
|
validate=validate.OneOf(["human", "humanoid", "mutant", "cyborg", "android"]),
|
|
|
|
description='The characters type of being'
|
|
|
|
)
|
|
|
|
|
2024-06-23 11:57:26 +00:00
|
|
|
|
|
|
|
class DiceSchema(Schema):
|
|
|
|
quantity = fields.Int(required=True, validate=validate.Range(min=1), description='The number of dice to roll')
|
|
|
|
geometry = fields.Int(required=True, validate=validate.Range(min=2), description='The number of sides on each die')
|
|
|
|
discard_lowest = fields.Bool(default=False, description='Drop the lowest score')
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class EncounterSchema(Schema):
|
|
|
|
terrain = fields.String(
|
|
|
|
required=True,
|
|
|
|
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'
|
|
|
|
)
|