예제 #1
0
파일: views.py 프로젝트: AtnesNess/the-tale
def game_page(context):

    battle = Battle1x1Prototype.get_by_account_id(context.account.id)

    if battle and battle.state.is_PROCESSING:
        return dext_views.Redirect(url('game:pvp:'))

    clan = None
    if context.account.clan_id is not None:
        clan = ClanPrototype.get_by_id(context.account.clan_id)

    cards = sorted(list(EFFECTS.values()),
                   key=lambda x: (x.TYPE.rarity.value, x.TYPE.text))

    return dext_views.Page('game/game_page.html',
                           content={
                               'map_settings': map_settings,
                               'game_settings': game_settings,
                               'EQUIPMENT_SLOT': EQUIPMENT_SLOT,
                               'current_map_version': map_info_storage.version,
                               'clan': clan,
                               'CARDS': cards,
                               'resource': context.resource,
                               'hero': context.account_hero,
                               'ABILITY_TYPE': ABILITY_TYPE
                           })
예제 #2
0
 def test_availability_filter(self):
     for availability in relations.AVAILABILITY.records:
         texts = [
             card.TYPE.text for card in list(EFFECTS.values())
             if card.TYPE.availability == availability
         ]
         self.check_html_ok(self.request_html(url('guide:cards:')),
                            texts=texts)
예제 #3
0
 def test_rarity_filter(self):
     for rarity in relations.RARITY.records:
         texts = [
             card.TYPE.text for card in list(EFFECTS.values())
             if card.TYPE.rarity == rarity
         ]
         self.check_html_ok(self.request_html(url('guide:cards:')),
                            texts=texts)
예제 #4
0
파일: views.py 프로젝트: Alkalit/the-tale
def game_page(context):

    battle = Battle1x1Prototype.get_by_account_id(context.account.id)

    if battle and battle.state.is_PROCESSING:
        return dext_views.Redirect(url('game:pvp:'))

    clan = None
    if context.account.clan_id is not None:
        clan = ClanPrototype.get_by_id(context.account.clan_id)

    cards = sorted(EFFECTS.values(), key=lambda x: (x.TYPE.rarity.value, x.TYPE.text))

    return dext_views.Page('game/game_page.html',
                           content={'map_settings': map_settings,
                                    'game_settings': game_settings,
                                    'EQUIPMENT_SLOT': EQUIPMENT_SLOT,
                                    'current_map_version': map_info_storage.version,
                                    'clan': clan,
                                    'CARDS': cards,
                                    'resource': context.resource,
                                    'hero': context.account_hero} )
예제 #5
0
 def test_simple(self):
     texts = [card.TYPE.text for card in list(EFFECTS.values())]
     self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
예제 #6
0
 def test_availability_filter(self):
     for availability in relations.AVAILABILITY.records:
         texts = [card.TYPE.text for card in EFFECTS.values() if card.TYPE.availability == availability]
         self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
예제 #7
0
 def test_rarity_filter(self):
     for rarity in relations.RARITY.records:
         texts = [card.TYPE.text for card in EFFECTS.values() if card.TYPE.rarity == rarity]
         self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
예제 #8
0
 def test_simple(self):
     texts = [card.TYPE.text for card in EFFECTS.values()]
     self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)