def u(self): l = [] if self.spell: l.append(uT("Spell: {}".format(self.spell.name))) elif self.is_open(): l.append(uT("Spell: -------")) else: l.append(uT("Spell: XXXXXXX")) if self.opened: l.append(uT("Opened Breach")) return uA(uF(uP(l),'top'),'opened') else: l.append(uB("Open: {} Ae".format(self.costOpen), self.open_)) l.append(uB("Turn: {} Ae".format(self.costTurn), self.turn_)) return uPad(uF(uP(l),'top'),left=1,right=1)
def u(self): mc = uC([ ('weight',2,uT(str(self.world.turn_order))), ('weight', 10, uP([(500,self.deck.u())])), urwid.Padding(urwid.BigText(str(self.life), urwid.font.HalfBlock5x4Font()), 'right', width='clip',right=1), ]) m = uLineB(uA(uF(mc),'default'), title=self.name) return m
def u(self): lb, lp = [], [] for idx, d in enumerate(self.buyzone): if len(d) == 0: lb.append(uT("{} - Empty".format(idx))) else: tipus = d[0] lb.append(uT( "{} -> ({}) Cost: {} -- Name: {} -- Action: {}".format(idx + 1, len(d), tipus.cost, tipus.name, tipus.action.txt))) for p in self.players: lp.append(uA(p.u(),"active") if self.activePlayer == p else p.u()) lBuy = uF(uT("NO BUY DECKS"),'middle') if len(lb) == 0 else uLB(lb) cPlayers = uF(uT("NO PLAYERS"),'middle') if len(lp) == 0 else uC(lp) bMonster = uF(uT("NO MONSTER"),'middle') if w.monster is None else (uA(w.monster.u(),'active') if w.monster == self.activePlayer else w.monster.u()) full = uP([("weight", 1, bMonster), (10, lBuy), ("weight", 2, uLineB(cPlayers,title="Gravehold: {}".format(self.gravehold)))]) p = uC([("weight", 4, full), ("weight", 1, w.log)]) return p
def __init__(self): self.monster = None self.players = [] self.buyzone = [] self.name = "Prova" self.activePlayer = None self.allCards = {} self.log = uLB([uT("")]) self.status = CMONSTER self.turn_order = [] self.gravehold = 30 for c in all_cards: self.allCards[c] = Card(c)
def u(self): cb = uC([ b.u() for b in self.breaches ]) i = uLB(urwid.SimpleFocusListWalker([ uT("Name: {}".format(self.name)), uT("Life: {}".format(self.life)), uT("Aether: {}".format(self.aether)), uT("Charges: {}/{} Cost: {}".format(self.charges, self.maxCharges, self.costCharges)), uT("Action: {}".format(self.action)), uT("Deck: {} cards".format(len(self.pdeck))) ]) ) p1 = uP([self.playZone.u(), self.phand.u(self.play_)]) cp = uC([("weight", 3, p1), ("weight", 1, uLineB(self.pdiscard.u_narrow(), title="{} cards".format(len(self.pdiscard))))]) p = uLineB(uA(uP([(5 , cb), ("weight", 1, i), ("weight", 2, cp)]),"default"), title=self.name) return p
def log(txt): w.log.body.contents.append(uT(txt)) w.log.focus_position = len(w.log.body.contents) - 1
def u_narrow(self): l = [] for c in self: l.append(uT(str(c.name))) return uLB(l)