Example #1
0
def do_milestone_rune(c, mile):
  """Give out 30/N points for the Nth time a player finds a rune, and also give out banners."""
  # Check if this player already found this kind of rune. Remember the db
  # is already updated, so for the first rune the count will be 1.
  rune = loaddb.extract_rune(mile['milestone'])
  num_rune = query.player_count_runes(c, mile['name'], rune)
  rune_points = (30 + num_rune - 1) / num_rune
  assign_points(c, "rune:" + rune, mile['name'], rune_points)
  player = mile['name']
  runes_found = query.player_count_distinct_runes(c, player)
  if runes_found == crawl.NRUNES:
    banner.award_banner(c, player, 'ashenzari', 3)
  elif runes_found >= 5:
    banner.award_banner(c, player, 'ashenzari', 2)
  if rune == 'golden' and num_rune == 1:
    banner.award_banner(c, player, 'fedhas', 2)
  if nemelex.is_nemelex_choice(mile['char'], mile['time']):
    ban = 'nemelex:' + mile['char']
    banner.award_banner(c, player, ban, 2)
  if not query.did_reach_d14(c, player, mile['start'], mile['time']):
    if mile['urune'] == 4:
      assign_points(c, 'vow_of_courage', player, 25)
      banner.award_banner(c, player, 'the_shining_one', 3)
    elif mile['urune'] >= 2:
      banner.award_banner(c, player, 'the_shining_one', 2)
    else:
      banner.award_banner(c, player, 'the_shining_one', 1)
  if not query.game_did_visit_lair(c, mile['name'], mile['start'], mile['time']):
    banner.award_banner(c, mile['name'], 'kikubaaqudgha', 2)
  if query.time_from_str(mile['time']) - query.time_from_str(mile['start']) <= datetime.timedelta(hours=27):
    banner.award_banner(c, mile['name'], 'vehumet', 1)
  if query.is_unbeliever(c, mile):
    banner.award_banner(c, mile['name'], 'lugonu', 2)
Example #2
0
def do_milestone_rune(c, mile):
  """Give out 30/N points for the Nth time a player finds a rune, and also give out banners."""
  # Check if this player already found this kind of rune. Remember the db
  # is already updated, so for the first rune the count will be 1.
  rune = loaddb.extract_rune(mile['milestone'])
  num_rune = query.player_count_runes(c, mile['name'], rune)
  rune_points = (30 + num_rune - 1) / num_rune
  assign_points(c, "rune:" + rune, mile['name'], rune_points)
  player = mile['name']
  runes_found = query.player_count_distinct_runes(c, player)
  if runes_found == crawl.NRUNES:
    banner.award_banner(c, player, 'ashenzari', 3)
  elif runes_found >= 5:
    banner.award_banner(c, player, 'ashenzari', 2)
  if rune == 'golden' and num_rune == 1:
    banner.award_banner(c, player, 'fedhas', 2)
  if nemelex.is_nemelex_choice(mile['char'], mile['time']):
    ban = 'nemelex:' + mile['char']
    banner.award_banner(c, player, ban, 2)
  if not query.did_reach_d14(c, player, mile['start'], mile['time']):
    if mile['urune'] >= 4:
      banner.award_banner(c, player, 'the_shining_one', 3)
    elif mile['urune'] >= 2:
      banner.award_banner(c, player, 'the_shining_one', 2)
    else:
      banner.award_banner(c, player, 'the_shining_one', 1)
Example #3
0
def do_milestone_rune(c, mile):
  """Give out 30/N points for the Nth time a player finds a rune, and also give out banners."""
  # Check if this player already found this kind of rune. Remember the db
  # is already updated, so for the first rune the count will be 1.
  rune = loaddb.extract_rune(mile['milestone'])
  num_rune = query.player_count_runes(c, mile['name'], rune)
  rune_points = (30 + num_rune - 1) / num_rune
  assign_points(c, "rune:" + rune, mile['name'], rune_points)
  player = mile['name']
  runes_found = query.player_count_distinct_runes(c, player)
  if mile['dur'] <= 4860:
    banner.award_banner(c, mile['name'], 'makhleb', 2)
  if runes_found == crawl.NRUNES:
    banner.award_banner(c, player, 'ashenzari', 3)
  elif runes_found >= 5:
    banner.award_banner(c, player, 'ashenzari', 2)
  if rune == 'golden' and num_rune == 1:
    banner.award_banner(c, player, 'fedhas', 2)
  if nemelex.is_nemelex_choice(mile['char'], mile['time']):
    ban = 'nemelex:' + mile['char']
    banner.award_banner(c, player, ban, 2)
  if not query.did_enter_branch(c, 'Depths', player, mile['start'], mile['time']):
    if mile['urune'] == 6:
      assign_points(c, 'vow_of_courage', player, 25)
      banner.award_banner(c, player, 'the_shining_one', 3)
    elif mile['urune'] >= 4:
      banner.award_banner(c, player, 'the_shining_one', 2)
  #if query.time_from_str(mile['time']) - query.time_from_str(mile['start']) <= datetime.timedelta(hours=27):
  #  banner.award_banner(c, mile['name'], 'oldbanner', 1)
  if query.is_unbeliever(c, mile):
    banner.award_banner(c, mile['name'], 'trog', 2)
  if mile['urune'] == 1:
    if rune != 'slimy':
      if mile['potionsused'] == 0 and mile['scrollsused'] == 0:
        banner.award_banner(c, mile['name'], 'vehumet', 3)
Example #4
0
def do_milestone_rune(c, mile):
  """Give out 24/N points for the Nth time a player finds a rune, and also give out banners."""
  # Check if this player already found this kind of rune. Remember the db
  # is already updated, so for the first rune the count will be 1.
  rune = loaddb.extract_rune(mile['milestone'])
  num_rune = query.player_count_runes(c, mile['name'], rune)
  rune_points = (24 + num_rune - 1) / num_rune
  assign_points(c, "rune:" + rune, mile['name'], rune_points)
  player = mile['name']
  runes_found = query.player_count_distinct_runes(c, player)
  if mile['dur'] <= 4860:
    banner.award_banner(c, mile['name'], 'makhleb', 2)
  if runes_found == crawl.NRUNES:
    banner.award_banner(c, player, 'ashenzari', 3)
  elif runes_found >= 5:
    banner.award_banner(c, player, 'ashenzari', 2)
  if rune == 'golden' and num_rune == 1:
    banner.award_banner(c, player, 'fedhas', 2)
  if rune == 'silver' and num_rune == 1:
    banner.award_banner(c, player, 'gozag', 2)

  # The abyssal rune is the only rune that the player can get before the iron
  # rune for Avarice 3.
  if rune == 'iron' and mile['urune'] <= 2:
    other_rune_branches = ['Vaults', 'Shoals', 'Snake', 'Spider', 'Swamp', 'Slime', 'Pan', 'Coc', 'Geh', 'Tar']
    eligible = True
    for br in other_rune_branches:
      if query.did_enter_branch(c, br, player, mile['start'], mile['time']):
        eligible = False
        break
    if eligible:
      assign_points(c, 'avarice', player, 25, False)
      banner.award_banner(c, player, 'gozag', 3)

  if nemelex.is_nemelex_choice(mile['char'], mile['time']):
    ban = 'nemelex:' + mile['char']
    banner.award_banner(c, player, ban, 2)
  if not query.did_enter_branch(c, 'Depths', player, mile['start'], mile['time']):
    if mile['urune'] == 6:
      assign_points(c, 'vow_of_courage', player, 25, False)
      banner.award_banner(c, player, 'the_shining_one', 3)
    elif mile['urune'] >= 4:
      banner.award_banner(c, player, 'the_shining_one', 2)
  #if query.time_from_str(mile['time']) - query.time_from_str(mile['start']) <= datetime.timedelta(hours=27):
  #  banner.award_banner(c, mile['name'], 'oldbanner', 1)
  if query.is_unbeliever(c, mile):
    banner.award_banner(c, mile['name'], 'trog', 2)
  if mile['urune'] == 1:
    if rune != 'slimy' and rune != 'abyssal':
      if mile['potionsused'] == 0 and mile['scrollsused'] == 0:
        assign_points(c, 'ascetic', player, 25, False)
        banner.award_banner(c, mile['name'], 'ru', 3)
    if mile['xl'] < 14:
      if not query.did_sacrifice(c, 'experience', mile['name'], mile['start'], mile['time']):
        banner.award_banner(c, mile['name'], 'vehumet', 2)
Example #5
0
def do_milestone_rune(c, mile):
    """Give out 24/N points for the Nth time a player finds a rune, and also give out banners."""
    # Check if this player already found this kind of rune. Remember the db
    # is already updated, so for the first rune the count will be 1.
    rune = loaddb.extract_rune(mile["milestone"])
    num_rune = query.player_count_runes(c, mile["name"], rune)
    rune_points = (24 + num_rune - 1) / num_rune
    assign_points(c, "rune:" + rune, mile["name"], rune_points)
    player = mile["name"]
    runes_found = query.player_count_distinct_runes(c, player)
    if mile["dur"] <= 4860:
        banner.award_banner(c, mile["name"], "makhleb", 2)
    if runes_found == crawl.NRUNES:
        banner.award_banner(c, player, "ashenzari", 3)
    elif runes_found >= 5:
        banner.award_banner(c, player, "ashenzari", 2)
    if rune == "golden" and num_rune == 1:
        banner.award_banner(c, player, "fedhas", 2)
    if rune == "silver" and num_rune == 1:
        banner.award_banner(c, player, "gozag", 2)

    # The abyssal rune is the only rune that the player can get before the iron
    # rune for Avarice 3.
    if rune == "iron" and mile["urune"] <= 2:
        other_rune_branches = ["Vaults", "Shoals", "Snake", "Spider", "Swamp", "Slime", "Pan", "Coc", "Geh", "Tar"]
        eligible = True
        for br in other_rune_branches:
            if query.did_enter_branch(c, br, player, mile["start"], mile["time"]):
                eligible = False
                break
        if eligible:
            assign_points(c, "avarice", player, 25, False)
            banner.award_banner(c, player, "gozag", 3)

    if nemelex.is_nemelex_choice(mile["char"], mile["time"]):
        ban = "nemelex:" + mile["char"]
        banner.award_banner(c, player, ban, 2)
    if not query.did_enter_branch(c, "Depths", player, mile["start"], mile["time"]):
        if mile["urune"] == 6:
            assign_points(c, "vow_of_courage", player, 25, False)
            banner.award_banner(c, player, "the_shining_one", 3)
        elif mile["urune"] >= 4:
            banner.award_banner(c, player, "the_shining_one", 2)
    # if query.time_from_str(mile['time']) - query.time_from_str(mile['start']) <= datetime.timedelta(hours=27):
    #  banner.award_banner(c, mile['name'], 'oldbanner', 1)
    if query.is_unbeliever(c, mile):
        banner.award_banner(c, mile["name"], "trog", 2)
    if mile["urune"] == 1:
        if rune != "slimy" and rune != "abyssal":
            if mile["potionsused"] == 0 and mile["scrollsused"] == 0:
                assign_points(c, "ascetic", player, 25, False)
                banner.award_banner(c, mile["name"], "ru", 3)
        if mile["xl"] < 14:
            if not query.did_sacrifice(c, "experience", mile["name"], mile["start"], mile["time"]):
                banner.award_banner(c, mile["name"], "vehumet", 2)
Example #6
0
def do_milestone_rune(c, mile):
  """Give out banners for certain special rune finds."""
  # Check if this player already found this kind of rune. Remember the db
  # is already updated, so for the first rune the count will be 1.
  rune = loaddb.extract_rune(mile['milestone'])
  num_rune = query.player_count_runes(c, mile['name'], rune)
  player = mile['name']
  runes_found = query.player_count_distinct_runes(c, player)
  if mile['dur'] <= 4860:
    banner.award_banner(c, mile['name'], 'makhleb', 2)
  if runes_found == crawl.NRUNES:
    banner.award_banner(c, player, 'ashenzari', 3)
  elif runes_found >= 5:
    banner.award_banner(c, player, 'ashenzari', 2)
  if rune == 'golden' and num_rune == 1:
    banner.award_banner(c, player, 'fedhas', 2)
  if rune == 'silver' and num_rune == 1:
    banner.award_banner(c, player, 'gozag', 2)
  did_ecu = query.did_use_ecumenical_altar(c, mile['name'], mile['start'],
		mile['time'])
  did_renounce = query.did_renounce_god(c, mile['name'], mile['start'],
			mile['time'])
  if (did_ecu and not did_renounce):
    banner.award_banner(c, player, 'hepliaklqana', 2)

  # The abyssal rune is the only rune that the player can get before the iron
  # rune for Avarice 3.
  if rune == 'iron' and mile['urune'] <= 2:
    other_rune_branches = ['Vaults', 'Shoals', 'Snake', 'Spider', 'Swamp', 'Slime', 'Pan', 'Coc', 'Geh', 'Tar']
    eligible = True
    for br in other_rune_branches:
      if query.did_enter_branch(c, br, player, mile['start'], mile['time']):
        eligible = False
        break
    if eligible:
      banner.award_banner(c, player, 'gozag', 3)

  if nemelex.is_nemelex_choice(mile['char'], mile['time']):
    banner.award_banner(c, player, 'nemelex', 2)
  if not query.did_enter_branch(c, 'Depths', player, mile['start'], mile['time']):
    if mile['urune'] == 6:
      banner.award_banner(c, player, 'the_shining_one', 3)
    elif mile['urune'] >= 4:
      banner.award_banner(c, player, 'the_shining_one', 2)
  #if query.time_from_str(mile['time']) - query.time_from_str(mile['start']) <= datetime.timedelta(hours=27):
  #  banner.award_banner(c, mile['name'], 'oldbanner', 1)
  if query.is_unbeliever(c, mile):
    banner.award_banner(c, mile['name'], 'trog', 2)
  if rune != 'slimy' and rune != 'abyssal':
    if mile['potionsused'] == 0 and mile['scrollsused'] == 0:
      banner.award_banner(c, mile['name'], 'ru', 3)
  if mile['urune'] == 1:
    if mile['xl'] < 14:
      if not query.did_sacrifice(c, 'experience', mile['name'], mile['start'], mile['time']) and not query.did_worship_god(c, 'Hepliaklqana',
                      mile['name'], mile['start'], mile['time']) and not mile['race'] == 'Felid':
        banner.award_banner(c, mile['name'], 'vehumet', 2)

  if mile['br'] in [ 'Shoals', 'Slime', 'Snake', 'Spider', 'Swamp'] and mile['turn'] - query.branch_end_turn(c, mile['br'], mile['name'], mile['start']) <= 810:
      banner.award_banner(c, mile['name'], 'uskayaw', 1)
  if rune == 'silver' and mile['turn'] - query.branch_end_turn(c, 'Vaults', mile['name'], mile['start']) <= 540:
      banner.award_banner(c, mile['name'], 'uskayaw', 2)
Example #7
0
def do_milestone_rune(c, mile):
  """Give out 24/N points for the Nth time a player finds a rune, and also give out banners."""
  # Check if this player already found this kind of rune. Remember the db
  # is already updated, so for the first rune the count will be 1.
  rune = loaddb.extract_rune(mile['milestone'])
  num_rune = query.player_count_runes(c, mile['name'], rune)
  rune_points = (24 + num_rune - 1) / num_rune
  assign_points(c, "rune:" + rune, mile['name'], rune_points)
  player = mile['name']
  runes_found = query.player_count_distinct_runes(c, player)
  if mile['dur'] <= 4860:
    banner.award_banner(c, mile['name'], 'makhleb', 2)
  if runes_found == crawl.NRUNES:
    banner.award_banner(c, player, 'ashenzari', 3)
  elif runes_found >= 5:
    banner.award_banner(c, player, 'ashenzari', 2)
  if rune == 'golden' and num_rune == 1:
    banner.award_banner(c, player, 'fedhas', 2)
  if rune == 'silver' and num_rune == 1:
    banner.award_banner(c, player, 'gozag', 2)
  did_ecu = query.did_use_ecumenical_altar(c, mile['name'], mile['start'],
		mile['time'])
  did_renounce = query.did_renounce_god(c, mile['name'], mile['start'],
			mile['time'])
  if (did_ecu and not did_renounce):
    banner.award_banner(c, player, 'hepliaklqana', 2)

  # The abyssal rune is the only rune that the player can get before the iron
  # rune for Avarice 3.
  if rune == 'iron' and mile['urune'] <= 2:
    other_rune_branches = ['Vaults', 'Shoals', 'Snake', 'Spider', 'Swamp', 'Slime', 'Pan', 'Coc', 'Geh', 'Tar']
    eligible = True
    for br in other_rune_branches:
      if query.did_enter_branch(c, br, player, mile['start'], mile['time']):
        eligible = False
        break
    if eligible:
      assign_points(c, 'avarice', player, 25, False)
      banner.award_banner(c, player, 'gozag', 3)

  if nemelex.is_nemelex_choice(mile['char'], mile['time']):
    ban = 'nemelex:' + mile['char']
    banner.award_banner(c, player, ban, 2)
  if not query.did_enter_branch(c, 'Depths', player, mile['start'], mile['time']):
    if mile['urune'] == 6:
      assign_points(c, 'vow_of_courage', player, 25, False)
      banner.award_banner(c, player, 'the_shining_one', 3)
    elif mile['urune'] >= 4:
      banner.award_banner(c, player, 'the_shining_one', 2)
  #if query.time_from_str(mile['time']) - query.time_from_str(mile['start']) <= datetime.timedelta(hours=27):
  #  banner.award_banner(c, mile['name'], 'oldbanner', 1)
  if query.is_unbeliever(c, mile):
    banner.award_banner(c, mile['name'], 'trog', 2)
  if mile['urune'] == 1:
    if rune != 'slimy' and rune != 'abyssal':
      if mile['potionsused'] == 0 and mile['scrollsused'] == 0:
        assign_points(c, 'ascetic', player, 25, False)
        banner.award_banner(c, mile['name'], 'ru', 3)
    if mile['xl'] < 14:
      if not query.did_sacrifice(c, 'experience', mile['name'], mile['start'], mile['time']):
        banner.award_banner(c, mile['name'], 'vehumet', 2)