def average_agendas_scored_to_win(cards, identity=None, **kwargs): points_to_win = 7 if identity.name == "Harmony Medtech: Biomedical Pioneer": points_to_win = 6 agendas = data.get_cards_of_type('agenda', cards) num_agendas = data.get_total_cards(agendas) total_agenda_points = data.sum_over_attr('agendapoints', agendas, convert_type=int) points_per_agenda = float(total_agenda_points) / float(num_agendas) num_scored_to_win = float(points_to_win) / points_per_agenda if int(num_scored_to_win) == num_scored_to_win: return int(num_scored_to_win) return round(num_scored_to_win, 2)
def average_actions_to_score_winning_agendas(cards, identity=None, **kwargs): points_to_win = 7 if identity.name == "Harmony Medtech: Biomedical Pioneer": points_to_win = 6 agendas = data.get_cards_of_type('agenda', cards) print '^'*20 for card in agendas: print card.name, card.actions, card.agendapoints print '^'*20 num_agendas = data.get_total_cards(agendas) total_actions = data.sum_over_attr('actions', agendas, convert_type=int) total_points = data.sum_over_attr('agendapoints', agendas, convert_type=int) ratio = points_to_win / float(total_points) #actions_per_agenda = float(total_actions) / num_agendas average_actions_to_score = float(total_actions) * ratio if average_actions_to_score == int(average_actions_to_score): return int(average_actions_to_score) return round(average_actions_to_score, 2)
def average_actions_to_score_winning_agendas(cards, identity=None, **kwargs): points_to_win = 7 if identity.name == "Harmony Medtech: Biomedical Pioneer": points_to_win = 6 agendas = data.get_cards_of_type('agenda', cards) print '^' * 20 for card in agendas: print card.name, card.actions, card.agendapoints print '^' * 20 num_agendas = data.get_total_cards(agendas) total_actions = data.sum_over_attr('actions', agendas, convert_type=int) total_points = data.sum_over_attr('agendapoints', agendas, convert_type=int) ratio = points_to_win / float(total_points) #actions_per_agenda = float(total_actions) / num_agendas average_actions_to_score = float(total_actions) * ratio if average_actions_to_score == int(average_actions_to_score): return int(average_actions_to_score) return round(average_actions_to_score, 2)
def upgrade(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('upgrade', cards))
def asset(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('asset', cards))
def agenda(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('agenda', cards))
def draw_rate_of_income_cards(cards, full_deck=None, **kwargs): num_cards = data.get_total_cards(full_deck) income_cards = data.get_money_making_cards(cards) num_income_cards = data.get_total_cards(income_cards) ratio = num_income_cards / float(num_cards) return get_percent_from_decimal(ratio)
def number_of_ice_that_ends_runs(cards, **kwargs): ice = data.get_ice(cards) end_run_ice = data.advanced_deck_search(ice, exact_text=["end the run"]) return data.get_total_cards(end_run_ice)
def total_as_ratio(cards, **kwargs): deck = kwargs['full_deck'] set_total = data.get_total_cards(cards) total = deck.total_cards ratio = float(set_total) / float(total) return get_percent_from_decimal(ratio)
def average_net_income_from_instant_cards(cards, **kwargs): cards = data.get_money_making_cards(cards) total_income = data.get_net_income_from_cards(cards, instant=True) num_income_cards = data.get_total_cards(cards) return round(float(total_income) / num_income_cards, 2)
def net_income_draw_rate(cards, full_deck=None, **kwargs): income_cards = data.get_money_making_cards(cards, instant=True) total_net_income = data.sum_over_attr('net_income', income_cards) total_cards = data.get_total_cards(full_deck) net_income_draw_rate = float(total_net_income) / total_cards return round(net_income_draw_rate, 2)
def icebreaker(cards, **kwargs): return data.get_total_cards(data.get_cards_of_subtype('icebreaker', cards))
def hardware(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('hardware', cards))
def ice(cards, **kwargs): return data.get_total_cards(data.get_ice(cards))
def operation(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('operation', cards))
def event(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('event', cards))
def program(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('program', cards))
def resource(cards, **kwargs): return data.get_total_cards(data.get_cards_of_type('resource', cards))
def total_cards(cards, **kwargs): return data.get_total_cards(cards)