예제 #1
0
def weap_condition_post(entry, body, cells):

    weapon_id = entry.weapon_id
    condition_type = entry.condition_type
    condition = entry.condition
    condition_null = entry.condition_null
    condition1 = entry.condition1
    condition2 = entry.condition2
    damage_value = entry.damage_value
    damage = entry.damage

    condition = get_name(Condition, condition)
    condition_null = get_name(Condition, condition_null)
    condition1 = get_name(Condition, condition1)
    condition2 = get_name(Condition, condition2)

    damage_value = integer_convert(damage_value)

    updown_select = [{'type': 1, 'name': 'Up'}, {'type': -1, 'name': 'Down'}]
    damage = selects(damage, updown_select)

    vcells = vcell('active', 40, [condition, 'Active'])
    vcells = vcell('change', 60, [condition1, 'to', condition2], vcells)
    vcells = vcell('damage', 40, [damage_value, 'Condition', damage], vcells)
    vcells = vcell('null', 40, [condition_null, 'Nullified'], vcells)
    cells = vcell_add('Condition Effect', condition_type, vcells, cells)

    body = send(cells, body)

    cells.clear()

    return (body)
예제 #2
0
def equip_belt_post(entry, body, cells):

    equip_id = entry.equip_id
    feature = entry.feature
    weapon = entry.weapon
    equipment = entry.equipment
    cost = entry.cost
    belt_item_type = entry.belt_item_type

    feature = get_name(Feature, feature)
    weapon = get_name(Weapon, weapon)
    equipment = get_name(Equipment, equipment)

    cost = str(cost)

    vcells = vcell('equip', 30, [equipment])
    vcells = vcell('weapon', 30, [weapon], vcells)
    vcells = vcell('feature', 30, [feature], vcells)
    cells = vcell_add('Item', belt_item_type, vcells, cells)
    cells = cell('Cost', 10, [cost], cells)
    body = send(cells, body)

    cells.clear()

    print('\n\n')
    print(cost)
    print('\n')

    return (body)
예제 #3
0
def equip_opposed_post(entry, body, cells):

    equip_id = entry.equip_id
    effect = entry.effect
    feature = entry.feature
    dc = entry.dc
    skill_type = entry.skill_type
    skill = entry.skill
    check = entry.check
    when = entry.when
    condition1 = entry.condition1
    condition2 = entry.condition2

    effect = name(EquipEffect, effect)
    feature = name(Feature, feature)
    skill_type = get_name(Skill, skill_type)
    skill = get_name(SkillBonus, skill)
    check = get_name(Check, check)
    condition1 = get_name(Condition, condition1)
    condition2 = get_name(Condition, condition2)

    dc = integer_convert(dc)

    when_select = [{
        'type': '',
        'name': 'When'
    }, {
        'type': 'before',
        'name': 'Before Use'
    }, {
        'type': 'after',
        'name': 'After Use'
    }]
    when = selects(when, when_select)

    cells = cell('Effect', 15, [effect])
    cells = cell('Feature', 15, [feature], cells)
    cells = cell('DC', 6, [dc], cells)
    cells = cell('Skill', 16, [skill_type], cells)
    cells = cell('Enhanced Skill', 20, [skill], cells)
    cells = cell('Check', 14, [check], cells)
    cells = cell('Required Condition', 18, [condition1], cells)
    cells = cell('Result Condition', 18, [condition2], cells)
    cells = cell('When', 11, [when], cells)

    body = send(cells, body)

    cells.clear()

    return (body)
예제 #4
0
def primary_exist(check_type,
                  check_table,
                  opposed_table,
                  column,
                  id,
                  power=False):
    error_msgs = errors['error_msgs']
    error = False

    check_convert = db_integer(Check, check_type)
    check_title = get_name(Check, check_convert)

    if check_type == 'x':
        attribute = getattr(check_table, column)
        the_filter = attribute == id
        if power == False:
            check = db.session.query(check_table).filter(
                the_filter, check_table.primary == True).first()
        else:
            check = db.session.query(check_table).filter(
                the_filter, check_table.primary == True,
                check_table.extra_id == None).first()
        if check is None:
            error = True
            message = 'You set this base powers check to Variable Check but you never set a primary check for the base power with the Variable Check Form.  Either create a primary check for the base power with the variable check form or make a different selection on the base powers Check Type field.'
            error_msgs.append(message)
    if check_type == '2' or check_type == '7':
        attribute = getattr(check_table, column)
        the_filter = attribute == id
        if power == False:
            check = db.session.query(opposed_table).filter(
                the_filter, opposed_table.primary == True).first()
        else:
            check = db.session.query(opposed_table).filter(
                the_filter, opposed_table.primary == True,
                opposed_table.extra_id == None).first()
        if check is None:
            error = True
            message = 'You set this base powers check to ' + check_title + ' Check but you never set a primary check for the base power with the Opponent Check Form.  Either create a primary check for the base power with the Opponent check form or make a different selection on the base powers Check Type field.'
            error_msgs.append(message)

    errors['error_msgs'] = error_msgs
    if error:
        errors['error'] = error

    return (errors)
예제 #5
0
def equip_modifiers_post(entry, body, cells):

    equip_id = entry.equip_id
    feature = entry.feature
    effect = entry.effect
    bonus = entry.bonus
    bonus_type = entry.bonus_type
    penalty = entry.penalty
    penalty_type = entry.penalty_type
    trigger = entry.trigger
    bonus_effect = entry.bonus_effect
    penalty_effect = entry.penalty_effect
    environment = entry.environment
    environment_other = entry.environment_other
    sense = entry.sense
    mod_range = entry.mod_range
    subsense = entry.subsense
    cover = entry.cover
    conceal = entry.conceal
    maneuver = entry.maneuver
    weapon_melee = entry.weapon_melee
    weapon_ranged = entry.weapon_ranged
    tools = entry.tools
    condition = entry.condition
    power = entry.power
    consequence = entry.consequence
    creature = entry.creature
    creature_other = entry.creature_other
    emotion = entry.emotion
    emotion_other = entry.emotion_other
    conflict = entry.conflict
    profession = entry.profession
    profession_other = entry.profession_other
    bonus_trait_type = entry.bonus_trait_type
    bonus_trait = entry.bonus_trait
    bonus_trait = variable_trait(bonus_trait, bonus_trait_type)
    bonus_check = entry.bonus_check
    bonus_check_range = entry.bonus_check_range
    bonus_conflict = entry.bonus_conflict
    penalty_trait_type = entry.penalty_trait_type
    penalty_trait = entry.penalty_trait
    penalty_trait = variable_trait(penalty_trait, penalty_trait_type)
    penalty_check = entry.penalty_check
    penalty_check_range = entry.penalty_check_range
    penalty_conflict = entry.penalty_conflict
    bonus_active_defense = entry.bonus_active_defense
    bonus_conflict_defend = entry.bonus_conflict_defend
    penalty_active_defense = entry.penalty_active_defense
    penalty_conflict_defend = entry.penalty_conflict_defend
    multiple = entry.multiple
    multiple_count = entry.multiple_count
    lasts = entry.lasts
    skill = entry.skill
    light = entry.light

    bonus_trait = trait_select(bonus_trait, bonus_trait_type)
    penalty_trait = trait_select(penalty_trait, penalty_trait_type)

    bonus = integer_convert(bonus)
    penalty = integer_convert(penalty)
    multiple_count = integer_convert(multiple_count)
    lasts = integer_convert(lasts)

    modifier_type = [{
        'type': '',
        'name': 'Type'
    }, {
        'type': 'up',
        'name': 'Up to'
    }, {
        'type': 'value',
        'name': 'Exact'
    }, {
        'type': 'rank',
        'name': 'Per Rank'
    }, {
        'type': '-1',
        'name': 'Rank - 1'
    }]
    bonus_type = selects(bonus_type, modifier_type)
    penalty_type = selects(penalty_type, modifier_type)

    multiple_select = [{
        'type': '',
        'name': 'If Multiple'
    }, {
        'type': 'together',
        'name': 'All Work Together'
    }, {
        'type': 'round',
        'name': 'Choose for Round'
    }, {
        'type': 'turn',
        'name': 'Choose for Turn'
    }, {
        'type': 'pick',
        'name': 'Pick 1'
    }, {
        'type': 'rank',
        'name': '1 Per Rank'
    }]
    multiple = selects(multiple, multiple_select)

    environment = get_name(Environment, environment)
    sense = get_name(Sense, sense)
    mod_range = get_name(Ranged, mod_range)
    subsense = get_name(SubSense, subsense)
    cover = get_name(Cover, cover)
    conceal = get_name(Conceal, conceal)
    maneuver = get_name(Maneuver, maneuver)
    weapon_melee = get_name(WeaponType, weapon_melee)
    weapon_ranged = get_name(WeaponType, weapon_ranged)
    condition = get_name(Condition, condition)
    power = get_name(Power, power)
    consequence = get_name(Consequence, consequence)
    creature = get_name(Creature, creature)
    emotion = get_name(Emotion, emotion)
    conflict = get_name(ConflictAction, conflict)
    profession = get_name(Job, profession)
    bonus_conflict = get_name(ConflictAction, bonus_conflict)
    penalty_conflict = get_name(ConflictAction, penalty_conflict)
    skill = get_name(Skill, skill)
    light = get_name(Light, light)
    bonus_check = get_name(Check, bonus_check)
    bonus_check_range = get_name(Ranged, bonus_check_range)
    penalty_check = get_name(Check, penalty_check)
    penalty_check_range = get_name(Ranged, penalty_check_range)
    effect = name(EquipEffect, effect)
    feature = name(Feature, feature)

    bonus_active_defense = variable_value('trait', bonus_effect,
                                          bonus_active_defense)
    bonus_conflict_defend = variable_value('conflict', bonus_effect,
                                           bonus_conflict_defend)
    penalty_active_defense = variable_value('trait', penalty_effect,
                                            penalty_active_defense)
    penalty_conflict_defend = variable_value('conflict', penalty_effect,
                                             penalty_conflict_defend)

    modifier_trigger = [{
        'type': '',
        'name': 'Trigger'
    }, {
        'type': 'environment',
        'name': 'Environment'
    }, {
        'type': 'cover',
        'name': 'Cover'
    }, {
        'type': 'conceal',
        'name': 'Concealment'
    }, {
        'type': 'sense',
        'name': 'Sense'
    }, {
        'type': 'subsense',
        'name': 'Subsense'
    }, {
        'type': 'condition',
        'name': 'Condition'
    }, {
        'type': 'profession',
        'name': 'Characters Profession'
    }, {
        'type': 'creature',
        'name': 'Creature'
    }, {
        'type': 'power',
        'name': 'Power'
    }, {
        'type': 'emotion',
        'name': 'Emotion'
    }, {
        'type': 'consequence',
        'name': 'Consequence'
    }, {
        'type': 'range',
        'name': 'Range'
    }, {
        'type': 'critical',
        'name': 'Critical Attempt'
    }, {
        'type': 'conflict',
        'name': 'Conflict Action'
    }, {
        'type': 'maneuver',
        'name': 'Maneuver'
    }, {
        'type': 'tools',
        'name': 'Tool Requirement'
    }, {
        'type': 'ranged',
        'name': 'Ranged Weapon'
    }, {
        'type': 'melee',
        'name': 'Melee Weapon'
    }]

    cells = cell('Feature', 11, [feature])
    cells = cell('Effect', 11, [effect], cells)
    cells = cell('Bonus', 8, [bonus], cells)
    cells = cell('Type', 8, [bonus_type], cells)
    vcells = vcell('effect', 15, ['Effect Modifier'])
    vcells = vcell('attack', 12, ['Attack Bonus'], vcells)
    vcells = vcell('damage', 13, ['Damage Bonus'], vcells)
    vcells = vcell('defense', 16, ['Active Defenses'], vcells)
    vcells = vcell('trait', 18, [bonus_trait], vcells)
    word = string(', Range:', [bonus_check_range])
    vcells = vcell('check', 29, [bonus_check, word, bonus_check_range], vcells)
    vcells = vcell('conflict', 16, [bonus_conflict], vcells)
    cells = vcell_add('Bonus Effect', bonus_effect, vcells, cells)

    cells = check_cell('Active', 8, bonus_active_defense, cells)
    cells = check_cell('Only Active', 11, bonus_conflict_defend, cells)

    cells = cell('Penalty', 8, [penalty], cells)
    cells = cell('Type', 8, [penalty_type], cells)

    vcells = vcell('effect', 15, ['Effect Modifier'])
    vcells = vcell('attack', 12, ['Attack Bonus'], vcells)
    vcells = vcell('damage', 13, ['Damage Bonus'], vcells)
    vcells = vcell('defense', 16, ['Active Defenses'], vcells)
    vcells = vcell('trait', 18, [penalty_trait], vcells)
    word = string(', Range:', [penalty_check_range])
    vcells = vcell('check', 29, [penalty_check, word, penalty_check_range],
                   vcells)
    vcells = vcell('conflict', 16, [penalty_conflict], vcells)

    cells = vcell_add('Affects', penalty_effect, vcells, cells)

    cells = check_cell('Active', 8, penalty_active_defense, cells)
    cells = check_cell('Only Active', 11, penalty_conflict_defend, cells)

    vcells = vcell('environment', 20, [environment])
    vcells = vcell('cover', 20, [cover], vcells)
    vcells = vcell('conceal', 20, [conceal], vcells)
    vcells = vcell('sense', 20, [sense], vcells)
    vcells = vcell('subsense', 20, [subsense], vcells)
    vcells = vcell('condition', 20, [condition], vcells)
    vcells = vcell('profession', 20, [profession], vcells)
    vcells = vcell('creature', 20, [creature], vcells)
    vcells = vcell('power', 20, [power], vcells)
    vcells = vcell('emotion', 20, [emotion], vcells)
    vcells = vcell('consequence', 20, [consequence], vcells)
    vcells = vcell('range', 20, [mod_range], vcells)
    vcells = vcell('critical', 20, ['Critical Attempt'], vcells)
    vcells = vcell('conflict', 20, [conflict], vcells)
    vcells = vcell('maneuver', 20, [maneuver], vcells)
    vcells = vcell('tools', 20, [tools], vcells)
    vcells = vcell('ranged', 20, [weapon_ranged], vcells)
    vcells = vcell('melee', 20, [weapon_melee], vcells)
    vcells = vcell('skill', 20, [skill], vcells)
    vcells = vcell('light', 20, [light], vcells)
    cells = vcell_add('Trigger', trigger, vcells, cells)

    body = send(cells, body)

    cells.clear()

    return (body)