Esempio n. 1
0
    def __init__(
                    self,
                    x,
                    y,
                    value,
                    bg_colour=(23,32,43),
                    w=0,
                    h=0,
                    display_text=True,
                    click_event=lambda:True,
                    display=False,
                    hover_event=lambda:True,
                ):
        AbstractComponent.__init__(
                                    self,
                                    x,
                                    y,
                                    w,
                                    h,
                                    click_event,
                                    hover_event,
                                )

        self.bg_colour = bg_colour
        self.value = value
        self.display_text = display_text
        self.display = display
Esempio n. 2
0
 def __init__(self, x, y, cards, boardstate):
     AbstractComponent.__init__(self, x, y, 0, 0)
     self.rows = G_SETTINGS['spread_default_rows']
     self.cols = G_SETTINGS['spread_default_cols']
     self.padding = G_SETTINGS['spread_default_padding']
     self.boardstate = boardstate
     self.display = False
Esempio n. 3
0
 def __init__(self, x, y):
     AbstractComponent.__init__(
         self,
         x,
         y,
         G_SETTINGS['card_w'],
         G_SETTINGS['card_h'],
     )
Esempio n. 4
0
 def __init__(self,x,y,item_keys,item_values):
     AbstractComponent.__init__(
                                 self,
                                 x,
                                 y,
                                 0,
                                 0
                             )
     self._build_list(item_keys,item_values)
Esempio n. 5
0
 def __init__(self, game):
     AbstractComponent.__init__(
         self,
         SETTINGS['top_left_x'],
         SETTINGS['top_left_y'],
         SETTINGS['window_x_size'],
         SETTINGS['window_y_size'],
     )
     self.bg_colour = (0, 0, 0)
     self.t_spread = None
     self.t_hero_hud = None
     self._setup(game)
Esempio n. 6
0
    def __init__(self,x,y,boardstate):
        AbstractComponent.__init__(self,x,y,0,0)
        self.boardstate = boardstate
        self.hero = boardstate.hero
        self._build_hud()

        self.last_roll = {
                        "base_total":0,
                        "dice":(0,0),
                        "dice_mod":0,
                        "elemental_mod":0,
                        "total":0,
                    }
Esempio n. 7
0
 def __init__(self, x, y, card, boardstate):
     AbstractComponent.__init__(
         self,
         x,
         y,
         G_SETTINGS['card_w'],
         G_SETTINGS['card_h'],
     )
     self.card = card
     self.bg_colour = G_SETTINGS['card_turned_bg_colour']
     self._init_card()
     self.flipped = False
     self.boardstate = boardstate
Esempio n. 8
0
 def _draw(self,screen,rm):
     AbstractComponent._draw(self,screen,rm)
     if self.display_text:
         text = rm.font.render(str(self.value()),1,(255,255,255))
         screen.blit(text,(self.x,self.y))
Esempio n. 9
0
 def __init__(self, x, y, boardstate):
     AbstractComponent.__init__(self, x, y, 0, 0)
     self.boardstate = boardstate
     self._build_hud()
Esempio n. 10
0
    def _step(self, mousestate):
        AbstractComponent._step(self, mousestate)

        for k, v in self.actions.items():
            if not self.card.is_action_enabled(k):
                self.actions[k].bg_colour = (32, 32, 32)
Esempio n. 11
0
    def _step(self, mousestate, game):
        AbstractComponent._step(self, mousestate)

        if game.cur_state.is_signal("new_floor"):
            self._new_spread(game)
            game.cur_state.reset_signal("new_floor")