コード例 #1
0
ファイル: banner.py プロジェクト: Chrishoney/dcss_tourney
def assign_top_player_banners(c):
  rows = query_rows_with_ties(c, '''SELECT name, score_full
                            FROM players
                           WHERE score_full > 0''',
                           'score_full', 3, 1)
  def do_banner(r, nth):
    award_banner(c, r[0], '1top_player', 100*(1+nth), temp=True)
    return True
  query.do_place_numeric(rows, do_banner)
コード例 #2
0
ファイル: banner.py プロジェクト: crawl/dcss_tourney
def assign_top_clan_banners(c):
  rows = query_rows_with_ties(c, '''SELECT owner, total_score
                            FROM teams
                           WHERE total_score > 0''',
                           'total_score', 3, 1)
  def do_banner(r, nth):
    award_clan_banner(c, r[0], '2top_clan', 10*(1+nth))
    return True
  query.do_place_numeric(rows, do_banner)
コード例 #3
0
ファイル: banner.py プロジェクト: crawl/dcss_tourney
def assign_top_clan_banners(c):
    rows = query_rows_with_ties(
        c, '''SELECT owner, total_score
                            FROM teams
                           WHERE total_score > 0''', 'total_score', 3, 1)

    def do_banner(r, nth):
        award_clan_banner(c, r[0], '2top_clan', 10 * (1 + nth))
        return True

    query.do_place_numeric(rows, do_banner)
コード例 #4
0
ファイル: banner.py プロジェクト: crawl/dcss_tourney
def assign_top_player_banners(c):
    rows = query_rows_with_ties(
        c, '''SELECT name, score_full
                            FROM players
                           WHERE score_full > 0''', 'score_full', 3, 1)

    def do_banner(r, nth):
        award_banner(c, r[0], '1top_player', 100 * (1 + nth), temp=True)
        return True

    query.do_place_numeric(rows, do_banner)
コード例 #5
0
ファイル: banner.py プロジェクト: Chrishoney/dcss_tourney
def assign_top_clan_banners(c):
  rows = query_rows_with_ties(c, '''SELECT owner, total_score
                            FROM teams
                           WHERE total_score > 0''',
                           'total_score', 3, 1)
  def do_banner(r, nth):
    award_clan_banner(c, r[0], '2top_clan', 10*(1+nth))
    return True
  query.do_place_numeric(rows, do_banner)
  def do_saint(r, prestige):
    for player in query.get_saints(c, r[0]):
      award_banner(c, player, 'beogh', prestige, temp=True)
  rows = query_rows_with_ties(c, '''SELECT owner, total_score
                            FROM teams
                           WHERE total_score > 0''',
                           'total_score', 5, 1)
  for r in rows:
    do_saint(r, 3)
  rows = query_rows_with_ties(c, '''SELECT owner, total_score
                            FROM teams
                           WHERE total_score > 0''',
                           'total_score', 20, 1)
  for r in rows:
    do_saint(r, 2)