from flask_restx import fields

# Common fields
chartype_field = fields.String(
    required=True,
    default="human",
    description='Character type. Allowed values: "human", "humanoid", "mutant", "cyborg"'
)

conscore_field = fields.Integer(
        required=True,
        default=10,
        min=3,
        max=18,
        description='The characters constitution score'
)

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'
    )
}

# Mutations Model
mutation_model = {
    'conscore': conscore_field,
    'intscore': fields.Integer(
        required=True,
        default=10,
        min=3,
        max=21,
        description='The characters intelligence score'
    )
}
# Dice model
dice_model = {
    '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'),
    'discard_lowest': fields.Boolean(required=False, default=False, description='Drop the lowest score')
}

# Ability model
ability_model = {
    'chartype': chartype_field,
    'ability': fields.String(
        required=False,
        default="all",
        description='The ability to roll. Not required. Valid options: "m-strength", "p-strength", '
                    '"intelligence", "charisma", "constitution", "dexterity", "all". Defaults to "all".'),
}

# Hp model
hp_model = {
    'chartype': chartype_field,
    'conscore': conscore_field
}

ma_model = {
    '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'),
}

character_model = {
    'chartype': chartype_field,
}

encounter_model = {
    'terrain': fields.String(
        required=True,
        default="clear",
        description='The terrain being traversed by the party when the encounter roll is made. Valid values are: '
                    '"clear", "mountains", "forest", "desert", "watery", "ruins", "deathlands"'
    )
}
