Exemplo n.º 1
0
    def _win(self):
        with get_session() as s:
            ktyp_id = get_ktyp(s, "winning").id

        return type_coerce(
            and_(Game.ktyp_id != None, Game.ktyp_id == ktyp_id,
                 Game.end <= self.end), Integer)
Exemplo n.º 2
0
    def _fifteenrune(self):
        with get_session() as s:
            ktyp_id = get_ktyp(s, "winning").id

        return type_coerce(and_(
            Game.ktyp_id != None,
            Game.ktyp_id == ktyp_id,
            Game.end <= self.end,
            self._rune(15)), Integer)
Exemplo n.º 3
0
    def _sub40k(self):
        with get_session() as s:
            ktyp_id = get_ktyp(s, "winning").id

        return type_coerce(func.ifnull(and_(
            Game.ktyp_id == ktyp_id,
            Game.end <= self.end,
            ~self._valid_milestone().filter(
                Milestone.turn >= 40000).exists()
        ), 0), Integer)
Exemplo n.º 4
0
    def _nolairwin(self):
        with get_session() as s:
            ktyp_id = get_ktyp(s, "winning").id
            brenter = get_verb(s, "br.enter").id
            lair = get_place_from_string(s, "Lair:1").id

        return type_coerce(and_(Game.ktyp_id != None, 
            Game.ktyp_id == ktyp_id,
            Game.end <= self.end,
            ~self._valid_milestone().filter(
                Milestone.verb_id == brenter,
                Milestone.place_id == lair).exists()), Integer)