Пример #1
0
    def setUpClass(cls):
        # called once at beginning 
        print('setUpClass()')

        # create gym instance 
        cls.gym = gym.Gym()

        # initialize gym member instances (member ID's 0-7)
        cls.connor = member.Member('Connor')
        cls.vanessa = member.Member('Vanessa')
        cls.tina = member.Member('Tina')
        cls.joe = member.Member('Joe')
        cls.seth = member.Member('Seth')
        cls.scott = member.Member('Scott')
        cls.mary = member.Member('Mary')
        cls.max = member.Member('Max')

        # initialize gym equipment instances 
        cls.benchPress = equipment.Equipment('Bench Press', 'Weight Training')
        cls.inclineBench = equipment.Equipment('Incline Bench', 'Weight Training')
        cls.declineBench = equipment.Equipment('Decline Bench', 'Weight Training')
        cls.kettleBells = equipment.Equipment('Kettle Bells', 'Weight Training')
        cls.treadmill1 = equipment.Equipment('Treadmill', 'Cardio')
        cls.treadmill2 = equipment.Equipment('Treadmill', 'Cardio')
        cls.rowMachine = equipment.Equipment('Row Machine', 'Cardio')
        cls.resistanceBands = equipment.Equipment('Resistance Bands', 'Stretching')
        cls.wobbleBoard = equipment.Equipment('Wobble Board', 'Balance')

        # add member instances to gym member set 
        cls.gym.add_member(cls.connor)
        cls.gym.add_member(cls.vanessa)
        cls.gym.add_member(cls.tina)
        cls.gym.add_member(cls.joe)
        cls.gym.add_member(cls.seth)
        cls.gym.add_member(cls.scott)
        cls.gym.add_member(cls.mary)
        cls.gym.add_member(cls.max)

        # add equipment instances to gym equipment set 
        cls.gym.add_equipment(cls.benchPress)
        cls.gym.add_equipment(cls.inclineBench)
        cls.gym.add_equipment(cls.declineBench)
        cls.gym.add_equipment(cls.kettleBells)
        cls.gym.add_equipment(cls.treadmill1)
        cls.gym.add_equipment(cls.treadmill2)
        cls.gym.add_equipment(cls.rowMachine)
        cls.gym.add_equipment(cls.resistanceBands)
        cls.gym.add_equipment(cls.wobbleBoard)
Пример #2
0
 def generate_entities(self, surface, type):
     if type == DEBUG:
         self.entities.append(Dummy(mymath.Vector2(200, 200)))
         self.entities.append(WeaponStand(equipment.Equipment().equipPrimary("Short Bow"), mymath.Vector2(50, 50)))
     if type == "BOSS":
         self.entities.append(Dummy(mymath.Vector2(200, 200)))
         self.entities.append(Dummy(mymath.Vector2(400, 400)))
         self.entities.append(Dummy(mymath.Vector2(200, 400)))
         self.entities.append(Dummy(mymath.Vector2(400, 200)))
         self.entities.append(Boss(mymath.Vector2(300, 300)))
Пример #3
0
    def __init__(self, name, hp, atk):
        self.name = name
        self.hp = hp
        self.atk = atk
        self.alive = True
        self.max_hp = hp
        self.skills = ['heal', 'smite', 'smash']
        self.party = None
        self.equipment = equipment.Equipment()
        self.inventory = None

        self.recalc_attr()
Пример #4
0
    def decode_equipment(self, file, x, y):
        item_dict = Decoder.decode(self, file)

        equipment_component = equipment.Equipment(
            slot=item_dict['slot'],
            power_bonus=item_dict['power_bonus'],
            dexterity_bonus=item_dict['dexterity_bonus'],
            max_hp_bonus=item_dict['max_hp_bonus'],
            accuracy_bonus=item_dict['accuracy_bonus'])

        color = vars(libtcod)[item_dict['color']]
        item = object.Object(x,
                             y,
                             item_dict['char'],
                             item_dict['name'],
                             color=color,
                             always_visible=True,
                             equipment=equipment_component)
        return item
Пример #5
0
    def doSmf(self):

        pe = PlanEq()

        if (self.request.get('eqid') != ""):
            pe.equipment = db.get(self.request.get('eqid'))

        elif (self.request.get('eqname') != ""):
            eq = equipment.Equipment()
            eq.name = self.request.get('eqname')
            eq.put()
            pe.equipment = eq
        try:
            pe.quantity = int(self.request.get('quant'))
        except (ValueError):
            pe.quantity = 0

        pe.comment = self.request.get('comment')

        pe.respWk = db.get(self.request.get('resp'))

        pe.put()
        self.redirect('/planeq')
Пример #6
0
import creature
import equipment

testCreature = creature.Creature("Philllip", 1, 5, 7, 3, 20, 5, 7, 3, 20, None,
                                 None, 2, None, 3)

print("No equipment:")
print(testCreature)

testAxe = equipment.Equipment("Axe of Axiness", None, None, 2, 0, 0, 0, 0, 0,
                              0, 0)
testBoots = equipment.Equipment("Boots of Made-For-Walking", None, None, 0, 1,
                                3, 0, 0, 0, 0, 0)

testCreature.equip(testAxe)
testCreature.equip(testBoots)

print("With equipment:")
print(testCreature)

print("Double-equip:")
testCreature.equip(testAxe)

testCreature.unequip(testBoots)

print(testBoots)
print("\nUnequipped boots:")
print(testCreature)
print(testBoots)

print("Double-unequip:")
Пример #7
0
def init():
    eqp = equipment.Equipment(name=u'Пины HPA-OJ,SPR-OW-1')
    eqp.put()
    eqm = equipment.Equipment(name=u'Микросхемы')
    eqm.put()
    eq = equipment.Equipment(name=u'Резисторы')
    eq.put()
    eql = equipment.Equipment(name=u'ЛОВ ОВ-65')
    eql.put()
    eq = equipment.Equipment(name=u'Тележка подьёмная')
    eq.put()
    eq = equipment.Equipment(
        name=
        u'Криогенные разъемы. Micro-D connector: on sample holder wiring part it is M83513/02-DC 25 pole receptacle, socket, class M, solder type (пары) Криогенные разъемы M83513/01-DC 25 pole plug, pin, class M, solder type (пары)'
    )
    eq.put()

    wk = workers.Worker(surname=u"Вдовин",
                        name=u"Вячеслав",
                        patronymic=u"Фёдорович",
                        email=u'*****@*****.**')
    wk.put()
    wk = workers.Worker(surname=u"Кузнецов",
                        name=u"Леонид",
                        patronymic=u"Сергеевич")
    wk.put()
    wk = workers.Worker(surname=u"Ширяев",
                        name=u"Михаил",
                        patronymic=u"Виссарионович",
                        email=u'*****@*****.**')
    wk.put()
    wk = workers.Worker(surname=u"Соколов")
    wk.put()
    wkk = workers.Worker(surname=u"Коротаев")
    wkk.put()
    wkb = workers.Worker(surname=u"Большаков",
                         name=u"Олег",
                         email=u'*****@*****.**')
    wkb.put()
    wka = workers.Worker(surname=u"Абашин",
                         name=u"Евгений",
                         patronymic=u"Борисович",
                         email=u'*****@*****.**')
    wka.put()
    wksh = workers.Worker(surname=u"Штанюк")
    wksh.put()
    wk = workers.Worker(surname=u"Тарсов")
    wk.put()
    wk = workers.Worker(surname=u"Елисеев")
    wk.put()
    wk = workers.Worker(surname=u"Темнов")
    wk.put()
    wk = workers.Worker(surname=u"Дрягин")
    wk.put()
    wkl = workers.Worker(surname=u"Леснов",
                         email='*****@*****.**',
                         passwd="111111")
    wkl.put()

    tpaymnt = tpay.TypePayment(name=u'Контракт')
    tpaymnt.put()
    tpaymnt = tpay.TypePayment(name=u'Котировка')
    tpaymnt.put()
    tpaymnt = tpay.TypePayment(name=u'Счёт')
    tpaymnt.put()
    tpaymnt = tpay.TypePayment(name=u'Наш долг')
    tpaymnt.put()

    pe = PlanEq.PlanEq(equipment=eqp, quantity=1, comment=u'Набор', respWk=wkk)
    pe.put()
    pe = PlanEq.PlanEq(equipment=eqm, quantity=1, comment=u'Набор', respWk=wkb)
    pe.put()
    pe = PlanEq.PlanEq(equipment=eql, quantity=1, comment=u'Набор', respWk=wka)
    pe.put()

    pr = payer.Payer(name=u'ОКБ РВТ')
    pr.put()
    pr = payer.Payer(name=u'Гиком')
    pr.put()
    pr = payer.Payer(name=u'ЛКН(НГТУ)')
    pr.put()

    vd = vendor.Vendor(name=u'ООО "Абтроникс"')
    vd.put()
    vd = vendor.Vendor(name=u'ООО "Миком"')
    vd.put()
    vd = vendor.Vendor(name=u'ЗАО "Радэком"')
    vd.put()
    vd = vendor.Vendor(name=u'ООО "Рубикон"')
    vd.put()
    vd = vendor.Vendor(name=u'ОКБ РВТ')
    vd.put()
    vd = vendor.Vendor(name=u'ООО "Торговый Дом Паллет Тракс"')
    vd.put()

    grpa = workers.Group(name=u"Администраторы")
    grpa.put()
    grpw = workers.Group(name=u"Работники")
    grpw.put()
    grp = workers.Group(name=u"Ответственные")
    grp.put()
    grp = workers.Group(name=u"Внешние службы")
    grp.put()
    grp = workers.Group(name=u"Студенты")
    grp.put()
    grp = workers.Group(name=u"Аспиранты")
    grp.put()

    usr_grp = workers.UsrGroup(user=wkl, group=grpa)
    usr_grp.put()
Пример #8
0
import equipment

testAxe = equipment.Equipment("Axe of Axiness")
testBoots = equipment.Equipment("Boots of Made-For-Walking", None, None, 0, 1, 3, 0, 0, 0, 0, 0)

print(testAxe)
print(testBoots)