2024-06-22 10:29:05 +00:00
|
|
|
from flask_restx import fields
|
|
|
|
|
|
|
|
# Common fields
|
2024-06-22 13:22:39 +00:00
|
|
|
chartype_field = fields.String(
|
2024-06-24 07:57:35 +00:00
|
|
|
required=True,
|
2024-06-23 23:47:38 +00:00
|
|
|
default="human",
|
2024-06-24 08:35:29 +00:00
|
|
|
description='Character type. Allowed values: "human", "humanoid", "mutant", "cyborg"'
|
|
|
|
)
|
2024-06-22 10:29:05 +00:00
|
|
|
|
2024-06-24 08:35:29 +00:00
|
|
|
conscore_field = fields.Integer(
|
2024-06-24 07:57:35 +00:00
|
|
|
required=True,
|
2024-06-24 08:35:29 +00:00
|
|
|
default=10,
|
2024-06-24 07:57:35 +00:00
|
|
|
min=3,
|
|
|
|
max=18,
|
|
|
|
description='The characters constitution score'
|
2024-06-24 08:35:29 +00:00
|
|
|
)
|
|
|
|
|
2024-06-24 20:00:40 +00:00
|
|
|
check_model = {
|
|
|
|
'ability_score': fields.Integer(
|
|
|
|
required=True,
|
|
|
|
default=10,
|
|
|
|
min=3,
|
|
|
|
max=21,
|
|
|
|
description='The score of the ability to check against'
|
|
|
|
),
|
|
|
|
'multiplier': fields.Integer(
|
|
|
|
required=True,
|
|
|
|
default=4,
|
|
|
|
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-24 08:35:29 +00:00
|
|
|
# Mutations Model
|
|
|
|
mutation_model = {
|
|
|
|
'conscore': conscore_field,
|
2024-06-24 07:57:35 +00:00
|
|
|
'intscore': fields.Integer(
|
|
|
|
required=True,
|
2024-06-24 08:41:56 +00:00
|
|
|
default=10,
|
2024-06-24 07:57:35 +00:00
|
|
|
min=3,
|
|
|
|
max=21,
|
|
|
|
description='The characters intelligence score'
|
|
|
|
)
|
|
|
|
}
|
2024-06-22 10:29:05 +00:00
|
|
|
# Dice model
|
|
|
|
dice_model = {
|
2024-06-24 08:49:58 +00:00
|
|
|
'quantity': fields.Integer(required=True, default=1, description='The number of dice to roll'),
|
|
|
|
'geometry': fields.Integer(required=True, default=2, description='The number of sides on each die'),
|
2024-06-22 10:29:05 +00:00
|
|
|
'discard_lowest': fields.Boolean(required=False, default=False, description='Drop the lowest score')
|
|
|
|
}
|
|
|
|
|
|
|
|
# Ability model
|
|
|
|
ability_model = {
|
2024-06-23 17:30:13 +00:00
|
|
|
'chartype': chartype_field,
|
2024-06-23 17:44:55 +00:00
|
|
|
'ability': fields.String(
|
|
|
|
required=False,
|
|
|
|
default="all",
|
2024-06-24 08:56:49 +00:00
|
|
|
description='The ability to roll. Not required. Valid options: "m-strength", "p-strength", '
|
|
|
|
'"intelligence", "charisma", "constitution", "dexterity", "all". Defaults to "all".'),
|
2024-06-22 10:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Hp model
|
|
|
|
hp_model = {
|
|
|
|
'chartype': chartype_field,
|
2024-06-24 08:35:29 +00:00
|
|
|
'conscore': conscore_field
|
2024-06-22 10:29:05 +00:00
|
|
|
}
|
2024-06-22 13:22:39 +00:00
|
|
|
|
2024-06-29 14:40:39 +00:00
|
|
|
|
|
|
|
pa_model = {
|
|
|
|
'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.'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-06-23 11:13:42 +00:00
|
|
|
ma_model = {
|
2024-06-25 21:26:04 +00:00
|
|
|
'ams': fields.Integer(
|
|
|
|
required=True,
|
|
|
|
min=3,
|
|
|
|
max=18,
|
|
|
|
default=10,
|
|
|
|
description='Attacker Mental Strength'
|
|
|
|
),
|
|
|
|
'dms': fields.Integer(
|
|
|
|
required=True,
|
|
|
|
min=3,
|
|
|
|
max=18,
|
|
|
|
default=10,
|
|
|
|
description='Defender Mental Strength'
|
|
|
|
),
|
|
|
|
'modifier': fields.Integer(
|
|
|
|
required=False,
|
|
|
|
min=-100,
|
|
|
|
max=100,
|
|
|
|
default=0,
|
|
|
|
description='Modifier For Mental Attack Roll'),
|
2024-06-23 11:13:42 +00:00
|
|
|
}
|
|
|
|
|
2024-06-22 13:22:39 +00:00
|
|
|
character_model = {
|
|
|
|
'chartype': chartype_field,
|
|
|
|
}
|
2024-06-22 22:56:55 +00:00
|
|
|
|
|
|
|
encounter_model = {
|
|
|
|
'terrain': fields.String(
|
|
|
|
required=True,
|
|
|
|
default="clear",
|
2024-06-24 08:41:56 +00:00
|
|
|
description='The terrain being traversed by the party when the encounter roll is made. Valid values are: '
|
|
|
|
'"clear", "mountains", "forest", "desert", "watery", "ruins", "deathlands"'
|
2024-06-22 22:56:55 +00:00
|
|
|
)
|
|
|
|
}
|