Esempio n. 1
0
 def __get_monster(self, _monster_level):
     if _monster_level < 4:
         rnd = randrange(0, 8)
     else:
         rnd = randrange(4, 20)
         
     if rnd in range(0,2):
         return MonsterFactory.get_monster_by_name(self.dm,'rabid dog', 0, 0)
     elif rnd in range(2,4):
         return MonsterFactory.get_monster_by_name(self.dm,'junkie', 0, 0)
     elif rnd in range(4,6):
         return MonsterFactory.get_monster_by_name(self.dm,'extra large cockroach', 0, 0)
     elif rnd in range(6,8):
         return MonsterFactory.get_monster_by_name(self.dm,'mutant rat', 0, 0)
     elif rnd in range(8,10):
         return MonsterFactory.get_monster_by_name(self.dm,'dust head', 0, 0)
     elif rnd in range(10,12):
         return MonsterFactory.get_monster_by_name(self.dm,'mutant mutt', 0, 0)
     elif rnd in range(12,14):
         return MonsterFactory.get_monster_by_name(self.dm,'damaged security bot', 0, 0)
     elif rnd in range(14,17):
         return MonsterFactory.get_monster_by_name(self.dm,'mutant', 0, 0)
     elif rnd in range(17,19):
         return MonsterFactory.get_monster_by_name(self.dm,'reanimated mailroom clerk', 0, 0)
     else:
         return MonsterFactory.get_monster_by_name(self.dm,'surveillance drone', 0, 0)
Esempio n. 2
0
def place_medical_lab_monsters(dm, room, level):
    _bot = MonsterFactory.get_monster_by_name(dm, 'docbot', 0 ,0)
    place_monster(room, level, _bot)
    
    for j in range(randrange(1,4)):
        _bot = MonsterFactory.get_monster_by_name(dm, 'security bot', 0 ,0)
        place_monster(room, level, _bot)
Esempio n. 3
0
def place_repair_shop_bots(dm, room, level):
    _num_of_bots = int(len(room) * 0.66) 
    _bot = MonsterFactory.get_monster_by_name(dm,'repair bot', 0, 0)
    place_monster(room, level, _bot)
    
    for j in range(_num_of_bots):
        if len(room) == 0: break
        
        _roll = randrange(12)
        if _roll < 5:
            _name = 'damaged security bot'
        elif _roll < 8: 
            _name = 'security bot'
        elif _roll < 9:
            _name = 'roomba'
        elif _roll < 10:
            _name = 'incinerator'
        elif _roll < 11:
            _name = 'surveillance drone'
        else:
            _name = 'repair bot'
        
        _bot = MonsterFactory.get_monster_by_name(dm, _name, 0, 0)
        _bot.curr_hp = int(_bot.curr_hp * (0.5 + random()/4))
        place_monster(room, level, _bot)
Esempio n. 4
0
 def add_monster(self, monster=''):
     rnd = randrange(0,3)
     if rnd == 0:
         _m = MonsterFactory.get_monster_by_name(self.dm,'turkey vulture',0, 0) 
     elif rnd == 1:
         _m = MonsterFactory.get_monster_by_name(self.dm,'junkie', 0, 0)
     else:
         _m = MonsterFactory.get_monster_by_name(self.dm,'rabid dog', 0, 0)
     GameLevel.add_monster(self, _m)
Esempio n. 5
0
 def make_ambush_building(self, building):
     _top_wall = self.lvl_length
     _bottom_wall = 0
     _left_wall = self.lvl_width
     _right_wall = 0
     
     for _sqr in building:
         if _sqr[0] < _top_wall:
             _top_wall = _sqr[0]
         if _sqr[0] > _bottom_wall:
             _bottom_wall = _sqr[0]
         if _sqr[1] < _left_wall:
             _left_wall = _sqr[1]
         if _sqr[1] > _right_wall:
             _right_wall = _sqr[1]
         if _sqr[2].get_type() == DOOR:
             _door = (_sqr[0], _sqr[1])
         
     _gt = MonsterFactory.get_monster_by_name(self.dm, "gun turret", 0, 0)
     # We want to make the gun turret either straight across from the 
     # door or at right angles.
     if _door[0] == _top_wall:
         self.add_monster_to_dungeon(_gt, _bottom_wall - 1, _door[1])
     elif _door[0] == _bottom_wall:
         self.add_monster_to_dungeon(_gt, _top_wall + 1, _door[1])
     elif _door[1] == _left_wall:
         self.add_monster_to_dungeon(_gt, _door[0], _right_wall - 1)
     elif _door[1] == _right_wall:
         self.add_monster_to_dungeon(_gt, _door[0], _left_wall + 1)
Esempio n. 6
0
 def __get_monster(self):
     _rnd =  randrange(0,28)
     if _rnd in range(0,3):
         _name = 'reanimated maintenance worker'
     elif _rnd in range(3,6):
         _name = 'reanimated unionized maintenance worker'
     elif _rnd in range(6,7):
         _name = 'roomba'
     elif _rnd in range(7,10):
         _name = 'wolvog'
     elif _rnd in range(10,13):
         _name = 'pigoon'
     elif _rnd in range(13,16):
         _name = 'beastman'
     elif _rnd in range(16,18):
         _name = 'security bot'
     elif _rnd in range(18,20):
         _name = 'incinerator'
     elif _rnd in range(20,22):
         _name = 'mq1 predator'
     elif _rnd in range(22,24):
         _name = 'reanimated scientist'
     elif _rnd in range(24,26):
         _name = 'reanimated mathematician'
     else:
         _name = 'ninja'
     
     return MonsterFactory.get_monster_by_name(self.dm, _name, 0, 0)
Esempio n. 7
0
def make_moreau_room(dm, room, level):
    place_terminal(room, level)
    place_monster(room, level, MoreauBot6000(dm,0,0))
    
    for j in range(randrange(1,4)):
        place_monster(room, level, MonsterFactory.get_monster_by_name(dm,'beastman',0,0))
        
    for j in range(randrange(1,4)):
        _box = get_moreau_box()
        place_item(room, level, _box)
Esempio n. 8
0
def place_minor_armoury_monster(dm, room, level):
    _roll = randrange(7)
    if _roll < 5:
        _name = 'security bot'
    elif _roll < 6: 
        _name = 'mq1 predator'
    else:
        _name = 'ninja'
    
    _m = MonsterFactory.get_monster_by_name(dm, _name, 0, 0)
    place_monster(room, level, _m)
Esempio n. 9
0
 def make_repair_shop(self, building):
     _doc = MonsterFactory.get_monster_by_name(self.dm, "repair bot", 0, 0)
     place_monster(building, self, _doc)
     
     for j in range(randrange(2)):
         _ed = MonsterFactory.get_monster_by_name(self.dm, "ed-209", 0, 0)
         place_monster(building, self, _ed)
     for j in range(randrange(1,4)):
         _sb = MonsterFactory.get_monster_by_name(self.dm, "security bot", 0, 0)
         place_monster(building, self, _sb)
     
     _if = ItemFactory()
     for j in range(randrange(1,4)):
         _roll = randrange(10)
         if _roll < 7:
             _item = _if.get_stack('battery', 3, True)
         elif _roll < 9:
             _item = _if.gen_item('targeting wizard')
         else:
             _item = _if.gen_item('icannon')
         place_item(building, self, _item)
Esempio n. 10
0
 def __get_monster(self):
     _rnd =  randrange(0,23)
     if _rnd in range(0,3):
         return MonsterFactory.get_monster_by_name(self.dm,'reanimated maintenance worker',0,0)
     elif _rnd in range(3,6):
         return MonsterFactory.get_monster_by_name(self.dm,'reanimated unionized maintenance worker',0,0)
     elif _rnd in range(6,7):
         return MonsterFactory.get_monster_by_name(self.dm,'roomba',0,0)
     elif _rnd in range(7,10):
         return MonsterFactory.get_monster_by_name(self.dm,'wolvog',0,0)
     elif _rnd in range(10,13):
         return MonsterFactory.get_monster_by_name(self.dm,'pigoon',0,0)
     elif _rnd in range(13,16):
         return MonsterFactory.get_monster_by_name(self.dm,'beastman',0,0)
     elif _rnd in range(16,18):
         return MonsterFactory.get_monster_by_name(self.dm,'security bot',0,0)
     elif _rnd in range(18,20):
         return MonsterFactory.get_monster_by_name(self.dm,'incinerator',0,0)
     elif _rnd in range(20,22):
         return MonsterFactory.get_monster_by_name(self.dm,'mq1 predator',0,0)
     else:
         return MonsterFactory.get_monster_by_name(self.dm,'ninja',0,0)
Esempio n. 11
0
 def __get_monster(self):
     _rnd =  randrange(0, 16)
     if _rnd in range(0, 2):
         _name = 'reanimated unionized maintenance worker'
     elif _rnd in range(2, 4):
         _name = 'wolvog'
     elif _rnd in range(4, 6):
         _name = 'security bot'
     elif _rnd in range(5, 6):
         _name = 'mq1 predator'        
     elif _rnd in range(6,7):
         _name = 'ninja'
     elif _rnd in range(7,9):
         _name = 'beastman'
     elif _rnd in range(9, 12):
         _name = 'cyborg soldier'
     elif _rnd in range(12, 14):
         _name = 'cyborg sergeant'
     else:
         _name = 'ed-209'
         
     return MonsterFactory.get_monster_by_name(self.dm, _name, 0, 0)
Esempio n. 12
0
 def make_barracks(self, building):
     for j in range(randrange(2,4)):
         _cy = MonsterFactory.get_monster_by_name(self.dm, "cyborg soldier", 0, 0)
         place_monster(building, self, _cy)
     
     _if = ItemFactory()
     _box = Items.Box('footlocker')
     for j in range(randrange(3)):
         _roll = randrange(6)
         if _roll == 0:
             _box.add_item(_if.get_stack('shotgun shell', 6, True))
         elif _roll == 1:
             _box.add_item(_if.get_stack('grenade', 4, True))
         elif _roll == 2:
             _box.add_item(_if.get_stack('stimpak', 3, True))
         elif _roll == 3:
             _box.add_item(_if.get_stack('machine gun clip', 3, True))
         elif _roll == 4:
             _box.add_item(_if.get_stack('9mm clip', 3, True))
         else:
             _box.add_item(_if.get_stack('medkit', 3, True))
     place_item(building, self, _box)
Esempio n. 13
0
    def __get_monster(self):
        if self.level_num == 1:
            _monster = choice([0, 0, 1, 1, 2, 2, 3])
        elif self.level_num < 3:
            _monster = choice([0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5])
        elif self.level_num < 7:
            _monster = choice ([1, 2, 3, 3, 4, 4, 5, 5])
        elif self.level_num < 9:
            _monster = choice([3, 4, 4, 5, 5, 6, 6, 7, 7, 8])
        elif self.level_num <= 10:
            _monster = choice([4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10])
        elif self.level_num >= 11:
            _monster = choice([4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10])
             
        if _monster == 0:
            _name = 'grid bug'
        elif _monster == 1:
            _name = 'belligerent process'
        elif _monster == 2:
            _name = 'script kiddie'
        elif _monster == 3:
            _name = 'two bit hacker'
        elif _monster == 4:
            _name = 'pensky antiviral mark I'
        elif _monster == 5:
            _name = 'troll'
        elif _monster == 6:
            _name = 'lolcat'
        elif _monster == 7:
            _name = 'ceiling cat'
        elif _monster == 8:
            _name = 'console cowboy'
        elif _monster == 9:
            _name = 'silk warrior'
        elif _monster == 10:
            _name = 'naive garbage collector'

        return MonsterFactory.get_monster_by_name(self.dm, _name, 0, 0)
Esempio n. 14
0
def place_science_lab_monsters(dm, room, level):
    _count = 0  
    for _floor in room:
        _roll = randrange(1,8)
        if _roll == 1:
            _name = 'mutant'
        elif _roll == 2:
            _name = 'reanimated maintenance worker'
        elif _roll == 3:
            _name = 'reanimated unionized maintenance worker'
        elif _roll == 4:
            _name = 'pigoon'
        elif _roll == 5:
            _name = 'wolvog'
        elif _roll == 6:
            _name = 'enhanced mole'
        elif _roll == 7:
            _name = 'reanimated scientist'
            
        _m = MonsterFactory.get_monster_by_name(dm, _name, _floor[0], _floor[1])
        level.add_monster_to_dungeon(_m, _floor[0], _floor[1])

        _count += 1
        if _count > 20: break
Esempio n. 15
0
 def __get_monster(self):
     rnd = randrange(0,32)
     if rnd in range(0,5):
         return MonsterFactory.get_monster_by_name(self.dm,'extra large cockroach',0,0)
     elif rnd in range(5,9):
         return MonsterFactory.get_monster_by_name(self.dm,'dust head',0,0)
     elif rnd in range(9,13):
         return MonsterFactory.get_monster_by_name(self.dm,'enhanced mole',0,0)
     elif rnd in range(13,15):
         return MonsterFactory.get_monster_by_name(self.dm,'giant bat',0,0)
     elif rnd in range(15,17):
         return MonsterFactory.get_monster_by_name(self.dm,'roomba',0,0)
     elif rnd in range(18,21):
         return MonsterFactory.get_monster_by_name(self.dm,'damaged security bot',0,0)
     elif rnd in range(22,24):
         return MonsterFactory.get_monster_by_name(self.dm,'reanimated maintenance worker',0,0)
     elif rnd in range(24,26):
         return MonsterFactory.get_monster_by_name(self.dm,'mutant',0,0)
     elif rnd in range(26,28):
         return MonsterFactory.get_monster_by_name(self.dm,'reanimated unionized maintenance worker',0,0)
     elif rnd in range(28,30):
         return MonsterFactory.get_monster_by_name(self.dm,'reanimated scientist',0,0)
     else:
         return MonsterFactory.get_monster_by_name(self.dm,'incinerator',0,0)
Esempio n. 16
0
 def add_pack(self, monster_name, low, high, r, c):
     for j in range(randrange(low,high+1)):
         _sqr = self.get_nearest_clear_space(r,c)
         if _sqr != None:
             _monster = MonsterFactory.get_monster_by_name(self.dm, monster_name, _sqr[0], _sqr[1])  
             self.add_monster_to_dungeon(_monster, _sqr[0], _sqr[1])
Esempio n. 17
0
 def dispatch_security_bots(self):
     for x in range(randrange(1,6)):
         GameLevel.add_monster(self, MonsterFactory.get_monster_by_name(self.dm,'damaged security bot',0,0))