Exemple #1
0
 def __init__(self,owner,item_power,item_colour=libtcod.green,bar_colour=libtcod.dark_green):
     count_to = int( 30 - 10*item_power )
     self.bar = HBar(None, None, bar_colour, libtcod.dark_grey, True, False, str(self), str.ljust)
     self.bar.is_visible = False
     Item.__init__(self,owner,item_power,item_colour)
     CountUp.__init__(self,count_to,count_to)
     TurnTaker.__init__(self,100,False)
     self.is_chargable = True
Exemple #2
0
 def __init__(self, pos):
     Floor.__init__(self, pos)
     Talker.__init__(self)
     Shouter.__init__(self, 30)
     TurnTaker.__init__(self,0)
     Trap.__init__(self)
     self.add_phrases(None,["** BORK! BORK! **","** BEEEEEEE! **"],0.9,True)
     self.show_probability = 0.05
Exemple #3
0
 def __init__(self, pos):
     Floor.__init__(self, pos)
     Talker.__init__(self)
     Shouter.__init__(self, 30)
     TurnTaker.__init__(self, 0)
     Trap.__init__(self)
     self.add_phrases(None, ["** BORK! BORK! **", "** BEEEEEEE! **"], 0.9,
                      True)
     self.show_probability = 0.05
Exemple #4
0
 def __init__(self, pos):
     Tile.__init__(self, pos, Door.CLOSED['symbol'], Door.CLOSED['colour'], Door.CLOSED['walkcost'], Door.CLOSED['transparency'])
     CountUp.__init__(self, Door.CLOSED['timer'])
     TurnTaker.__init__(self,5)
     self.unseen_symbol = Door.CLOSED['symbol'] # always shows as closed when can't be seen
     self.state = Door.CLOSED
     self.bar = HBar(Position(pos.x-1,pos.y-1),3,Door.CLOSED['barcolour'],libtcod.darkest_grey)
     self.bar.max_value = self.count_to-1
     self.bar.timeout = 5.0
     self._trying_to_open = False
Exemple #5
0
    def __init__(self,owner,item_power,valid_slot,item_colour=libtcod.cyan,bar_colour=libtcod.dark_cyan):
        self.bar = HBar(None, None, bar_colour, libtcod.dark_grey, True, False, str(self), str.ljust)
        self.bar.is_visible = False

        SlotItem.__init__(self,owner,item_power,valid_slot,item_colour,bar_colour)
        count_to = int( 50 + 100*item_power )
        CountUp.__init__(self,count_to)
        TurnTaker.__init__(self,100,False)

        self.is_active = False
        self.is_chargable = True
Exemple #6
0
 def __init__(self, pos):
     Tile.__init__(self, pos, Door.CLOSED['symbol'], Door.CLOSED['colour'],
                   Door.CLOSED['walkcost'], Door.CLOSED['transparency'])
     CountUp.__init__(self, Door.CLOSED['timer'])
     TurnTaker.__init__(self, 5)
     self.unseen_symbol = Door.CLOSED[
         'symbol']  # always shows as closed when can't be seen
     self.state = Door.CLOSED
     self.bar = HBar(Position(pos.x - 1, pos.y - 1), 3,
                     Door.CLOSED['barcolour'], libtcod.darkest_grey)
     self.bar.max_value = self.count_to - 1
     self.bar.timeout = 5.0
     self._trying_to_open = False
Exemple #7
0
    def __init__(self, pos=None):
        Mappable.__init__(self, pos, '@', libtcod.white)
        StatusEffect.__init__(self)
        TurnTaker.__init__(self, 1)
        HasInventory.__init__(
            self, 3,
            (SlotItem.HEAD_SLOT, SlotItem.BODY_SLOT, SlotItem.FEET_SLOT))
        LightSource.__init__(self, 2, 0.1)
        self.items = [None, None, None]
        self.slot_items = {
            SlotItem.HEAD_SLOT: None,
            SlotItem.BODY_SLOT: None,
            SlotItem.FEET_SLOT: None,
        }
        self.turns = 0
        self.evidence = []
        self.levels_seen = 1

        # init items (must be done this way to invoke any pickup triggers)
        #  - inv items
        self.pickup(Item.random(None, self, 2, 1.5))
        self.pickup(Item.random(None, self, 1))
        #  - slot items
        self.pickup(NightVisionGoggles(self))
        self.pickup(NinjaSuit(self))
        self.pickup(RunningShoes(self))

        self.KEYMAP = {
            'k': self.move_n,
            'j': self.move_s,
            'h': self.move_w,
            'l': self.move_e,
            'y': self.move_nw,
            'u': self.move_ne,
            'b': self.move_sw,
            'n': self.move_se,
            '.': self.do_nothing,
            '1': self.use_item1,
            '2': self.use_item2,
            '3': self.use_item3,
            '4': self.use_head,
            '5': self.use_body,
            '6': self.use_feet,
            'Q': sys.exit,
            'R': self.reset_game,
            ' ': self.interact,
            'd': self.drop,
            'L': self.debug_lighting,
        }
Exemple #8
0
    def __init__(self,pos=None):
        Mappable.__init__(self,pos,'@',libtcod.white)
        StatusEffect.__init__(self)
        TurnTaker.__init__(self,1)
        HasInventory.__init__(self,3,(SlotItem.HEAD_SLOT,SlotItem.BODY_SLOT,SlotItem.FEET_SLOT))
        LightSource.__init__(self,2,0.1)
        self.items = [None,None,None]
        self.slot_items = {
            SlotItem.HEAD_SLOT: None,
            SlotItem.BODY_SLOT: None,
            SlotItem.FEET_SLOT: None,
            }
        self.turns = 0
        self.evidence = []
        self.levels_seen = 1
        
        # init items (must be done this way to invoke any pickup triggers)
        #  - inv items
        self.pickup(Item.random(None,self,2,1.5))
        self.pickup(Item.random(None,self,1))
        #  - slot items
        self.pickup(NightVisionGoggles(self))
        self.pickup(NinjaSuit(self))
        self.pickup(RunningShoes(self))

        self.KEYMAP = {
            'k': self.move_n,
            'j': self.move_s,
            'h': self.move_w,
            'l': self.move_e,
            'y': self.move_nw,
            'u': self.move_ne,
            'b': self.move_sw,
            'n': self.move_se,
            '.': self.do_nothing,
            '1': self.use_item1,
            '2': self.use_item2,
            '3': self.use_item3,
            '4': self.use_head,
            '5': self.use_body,
            '6': self.use_feet,
            'Q': sys.exit,
            'R': self.reset_game,
            ' ': self.interact,
            'd': self.drop,
            'L': self.debug_lighting,
            }
Exemple #9
0
 def __init__(self,pos,symbol,colour):
     Mappable.__init__(self,pos,symbol,colour)
     TurnTaker.__init__(self,10)
     StatusEffect.__init__(self)