Пример #1
0
def addDummyClientCharacter3():
    DA = DataAccess()
    attacks = []
    a1perks = []
    a1perks.append(ClientPerk('15', DA.getPerkDetails(15).name, '1',''))
    a1perks.append(ClientPerk('10', DA.getPerkDetails(10).name,'1',''))
    a1flaws = []
    a1flaws.append(ClientFlaw('12', DA.getFlawDetails(12).name, '1',''))
    a1flaws.append(ClientFlaw('11', DA.getPerkDetails(11).name, '1',''))
    attacks.append(ClientAttack('Bomba', a1perks, a1flaws, '7', '7',
                            '15', 'Oh Yeah'))
    a2perks = []
    a2perks.append(ClientPerk('6', DA.getPerkDetails(6).name, '1',''))
    a2perks.append(ClientPerk('1', DA.getPerkDetails(1).name, '1',''))
    a2flaws = []
    a2flaws.append(ClientFlaw('1', DA.getFlawDetails(1).name, '1',''))
    a2flaws.append(ClientFlaw('4', DA.getFlawDetails(4).name, '1',''))
    attacks.append(ClientAttack('StarScream', a2perks, a2flaws, '7', '2',
                            '15', 'does double damage if unseen by target'))
    abilities = []
    abilities.append(ClientAbility('17', DA.getAbilityDetails(17).name, '+3', ''))
    abilities.append(ClientAbility('1', DA.getAbilityDetails(1).name, '+1', ''))
    abilities.append(ClientAbility('30', DA.getAbilityDetails(30).name, '+5', ''))
    weaknesses = []
    weaknesses.append(ClientWeakness('21', DA.getWeaknessDetails(21).name, '-3',''))
    weaknesses.append(ClientWeakness('24', DA.getWeaknessDetails(24).name,'-1',''))
    weaknesses.append(ClientWeakness('20', DA.getWeaknessDetails(20).name,'-5','(Eye Sight)'))

    Leon = ClientCharacter('*****@*****.**', 'Amy', '', abilities,
                 weaknesses, attacks, '5', '40', '50',
                 '22', 'Born on in the USA', 'Dress', 'Exited',
                 '', '', '')

    CDA.addClientCharacter(Leon)
Пример #2
0
def addDummyClientCharacter2():
    DA = DataAccess()
    attacks = []
    a1perks = []
    a1perks.append(ClientPerk('1', DA.getPerkDetails(1).name, '1',''))
    a1perks.append(ClientPerk('16', DA.getPerkDetails(16).name,'1',''))
    a1flaws = []
    a1flaws.append(ClientFlaw('2', DA.getFlawDetails(2).name, '1',''))
    a1flaws.append(ClientFlaw('14', DA.getPerkDetails(14).name, '1',''))
    attacks.append(ClientAttack('Fan of Blades', a1perks, a1flaws, '5', '4',
                            '0', 'throws 6 blades infront of him in a cone'))
    a2perks = []
    a2perks.append(ClientPerk('3', DA.getPerkDetails(3).name, '1',''))
    a2perks.append(ClientPerk('5', DA.getPerkDetails(5).name, '1',''))
    a2flaws = []
    a2flaws.append(ClientFlaw('5', DA.getFlawDetails(5).name, '1',''))
    a2flaws.append(ClientFlaw('8', DA.getFlawDetails(8).name, '1',''))
    attacks.append(ClientAttack('Backstab', a2perks, a2flaws, '7', '2',
                            '15', 'does double damage if unseen by target'))
    abilities = []
    abilities.append(ClientAbility('7', DA.getAbilityDetails(7).name, '+3', ''))
    abilities.append(ClientAbility('13', DA.getAbilityDetails(13).name, '+1', ''))
    abilities.append(ClientAbility('32', DA.getAbilityDetails(32).name, '+5', ''))
    weaknesses = []
    weaknesses.append(ClientWeakness('2', DA.getWeaknessDetails(2).name, '-3',''))
    weaknesses.append(ClientWeakness('14', DA.getWeaknessDetails(14).name,'-1',''))
    weaknesses.append(ClientWeakness('28', DA.getWeaknessDetails(28).name,'-5','(Eye Sight)'))

    Leon = ClientCharacter('*****@*****.**', 'Leon', '', abilities,
                 weaknesses, attacks, '4', '35', '70',
                 '25', 'Born on the Streets', 'Cloaked', 'Sullen',
                 '', '', '')

    CDA.addClientCharacter(Leon)
Пример #3
0
def addDummyClientCharacter4():
    DA = DataAccess()
    attacks = []
    a1perks = []
    a1perks.append(ClientPerk('11', DA.getPerkDetails(11).name, '1',''))
    a1perks.append(ClientPerk('10', DA.getPerkDetails(10).name,'1',''))
    a1flaws = []
    a1flaws.append(ClientFlaw('5', DA.getFlawDetails(5).name, '1',''))
    a1flaws.append(ClientFlaw('1', DA.getPerkDetails(1).name, '1',''))
    attacks.append(ClientAttack('Fan of Codex', a1perks, a1flaws, '5', '4',
                            '0', 'Says Hi to Codex'))
    a2perks = []
    a2perks.append(ClientPerk('1', DA.getPerkDetails(1).name, '1',''))
    a2perks.append(ClientPerk('3', DA.getPerkDetails(3).name, '1',''))
    a2flaws = []
    a2flaws.append(ClientFlaw('15', DA.getFlawDetails(15).name, '1',''))
    a2flaws.append(ClientFlaw('3', DA.getFlawDetails(3).name, '1',''))
    attacks.append(ClientAttack('Backstab', a2perks, a2flaws, '7', '2',
                            '15', 'does double damage if unseen by target'))
    abilities = []
    abilities.append(ClientAbility('17', DA.getAbilityDetails(17).name, '+3', ''))
    abilities.append(ClientAbility('3', DA.getAbilityDetails(3).name, '+1', ''))
    abilities.append(ClientAbility('2', DA.getAbilityDetails(2).name, '+5', ''))
    weaknesses = []
    weaknesses.append(ClientWeakness('21', DA.getWeaknessDetails(21).name, '-3',''))
    weaknesses.append(ClientWeakness('1', DA.getWeaknessDetails(1).name,'-1',''))
    weaknesses.append(ClientWeakness('2', DA.getWeaknessDetails(2).name,'-5','(Eye Sight)'))

    Leon = ClientCharacter('*****@*****.**', 'Jacob', '', abilities,
                 weaknesses, attacks, '9', '10', '10',
                 '1', 'Smells Funny', 'Looks Funny', 'Funny',
                 '', '', '')

    CDA.addClientCharacter(Leon)
Пример #4
0
def updateDummyClientCharacter4(char_id):
    DA = DataAccess()
    attacks = []
    a1perks = []
    a1perks.append(ClientPerk('1', DA.getPerkDetails(11).name, '1',''))
    a1perks.append(ClientPerk('2', DA.getPerkDetails(10).name,'1',''))
    a1flaws = []
    a1flaws.append(ClientFlaw('1', DA.getFlawDetails(5).name, '1',''))
    a1flaws.append(ClientFlaw('2', DA.getPerkDetails(1).name, '1',''))
    attacks.append(ClientAttack('Sleep', a1perks, a1flaws, '5', '4',
                            '0', 'Take A Nap'))
    a2perks = []
    a2perks.append(ClientPerk('4', DA.getPerkDetails(1).name, '1',''))
    a2perks.append(ClientPerk('3', DA.getPerkDetails(3).name, '1',''))
    a2flaws = []
    a2flaws.append(ClientFlaw('4', DA.getFlawDetails(15).name, '1',''))
    a2flaws.append(ClientFlaw('3', DA.getFlawDetails(3).name, '1',''))
    attacks.append(ClientAttack('Backstab', a2perks, a2flaws, '7', '2',
                            '15', 'does double damage if unseen by target'))
    abilities = []
    abilities.append(ClientAbility('1', DA.getAbilityDetails(17).name, '+1', ''))
    abilities.append(ClientAbility('2', DA.getAbilityDetails(3).name, '+1', ''))
    abilities.append(ClientAbility('3', DA.getAbilityDetails(2).name, '+1', ''))
    weaknesses = []
    weaknesses.append(ClientWeakness('1', DA.getWeaknessDetails(21).name, '-5',''))
    weaknesses.append(ClientWeakness('2', DA.getWeaknessDetails(1).name,'-5',''))
    weaknesses.append(ClientWeakness('3', DA.getWeaknessDetails(2).name,'-5',''))

    Leon = ClientCharacter('*****@*****.**', 'Jacobugath', '', abilities,
                 weaknesses, attacks, '1', '10', '10',
                 '1', 'Mighty Warrior', 'Looks Like Godzilla', 'Sleepy',
                 '', '', '')

    CDA.updateClientCharacter(Leon, char_id)
Пример #5
0
    def getClientCharacter(self, char_id):
        DA = DataAccess()
        char = DA.getCharacter(char_id)
        ability_list = []
        for ab in DA.getCharAbilities(char.id):
            ability_list.append(ClientAbility(ab.ability_id, DA.getAbilityDetails(ab.ability_id).name,
                                              ab.ability_value, ab.ability_note))

        weakness_list = []
        for wk in DA.getCharWeaknesses(char.id):
            weakness_list.append(ClientWeakness(wk.weakness_id,DA.getWeaknessDetails(wk.weakness_id).name,
                                                wk.weakness_value, wk.weakness_note))

        attack_list = []
        for at in DA.getCharAttacks(char.id):
            perks = []
            for pk in DA.getAttackPerks(at.id):
                perks.append(ClientPerk(pk.perk_id, DA.getPerkDetails(pk.perk_id).name, pk.multiplier, pk.note))
            flaws = []
            for fl in DA.getAttackFlaws(at.id):
                flaws.append(ClientFlaw(fl.flaw_id, DA.getFlawDetails(fl.flaw_id).name, fl.multiplier, fl.note))
            attack_list.append(ClientAttack(at.name, perks, flaws, at.roll,
                                            at.dx, at.end, at.note))

        cchar = ClientCharacter(char.user_id, char.name, char.combat_notes,
                            ability_list, weakness_list, attack_list,
                            char.defense, char.health, char.endurance, char.tv,
                            char.background, char.appearance, char.personality,
                            char.other_notes, char.portrait_url, char.icon_url)
        cchar.id = char_id
        return cchar