예제 #1
0
def gen_weapon_longsword(level, coords):
    x, y = coords
    bonus = random.randint(1, 2)
    n = random.choice(list(longsword_name_dict.keys()))

    level.world.create_entity(AttackerBonus(attack=bonus),
                              Valuable(100), Item(weight=2, volume=2),
                              Equipment(equip_slot=EquipSlots.WEAPON),
                              Renderable(animation_key="S_WEP_LONGSWORD_" + str(n), depth=constants.DEPTH_ITEM, draw_explored=True),
                              Name(name=longsword_name_dict[n]), Position(x, y)
                              )
예제 #2
0
def place_map_specific(level):
    if level.name == Levels.WATER1:
        for room in level.rooms:
            for i in range(2):
                x = tcod.random_get_int(None, room.left + 1, room.right - 1)
                y = tcod.random_get_int(None, room.top + 1, room.bottom - 1)
                ent = level.first_entity_at_position(Position(x, y))
                if not ent:
                    level.world.create_entity(
                        Position(x, y), Name("Bubble"),
                        Renderable(animation_key="DECOR_STATUE_01",
                                   depth=constants.DEPTH_STRUCTURES,
                                   special_flags=pygame.BLEND_RGBA_ADD))
예제 #3
0
def gen_aquatic_shark_white(level, coords):
    pos = level.world.component_for_player(Position)
    x, y = coords

    level.world.create_entity(Health(20), Position(x, y),
                              Attacker(attack=5, defense=1, hit_chance=90, evasion_chance=30),
                              Name("Great White Shark"), AiChase(pos),
                              Renderable(depth=constants.DEPTH_CREATURE, animation_key="A_AQUATIC_SHARK_WHITE"),
                              Energy(100),
                              BlocksMovement(),
                              Alignment(CreatureAlignment.FOE),
                              Experience(on_death=100),
                              Death(animation_key="S_FLESH_FISH")
                              )
예제 #4
0
def gen_demon_buffla(level, coords):
    pos = level.world.component_for_player(Position)
    x, y = coords

    level.world.create_entity(Health(100), Position(x, y),
                              Attacker(attack=12, defense=4, hit_chance=75, evasion_chance=1),
                              Name("Buffla"), AiChase(pos),
                              Renderable(depth=constants.DEPTH_CREATURE, animation_key="A_DEMON_BUFFLA"),
                              Energy(100),
                              BlocksMovement(),
                              Alignment(CreatureAlignment.FOE),
                              Experience(on_death=1000),
                              Death(animation_key="S_DEAD_DEMON")
                              )
예제 #5
0
def gen_boss_aquatic_kraken(level, coords):
    pos = level.world.component_for_player(Position)
    x, y = coords

    level.world.create_entity(Health(100), Position(x, y),
                              Attacker(attack=12, defense=4, hit_chance=75, evasion_chance=1),
                              Name("The KRAKEN"), AiChase(pos),
                              Renderable(depth=constants.DEPTH_CREATURE, animation_key="A_BOSS_AQUATIC_KRAKEN"),
                              Energy(60),
                              BlocksMovement(),
                              Alignment(CreatureAlignment.FOE),
                              Experience(on_death=10000),
                              Death(animation_key="S_FLESH_FISH")
                              )
예제 #6
0
def gen_aquatic_frog_hypno(level, coords):
    pos = level.world.component_for_player(Position)
    x, y = coords

    level.world.create_entity(Health(20), Position(x, y),
                              Attacker(attack=6, defense=3, hit_chance=80, evasion_chance=20),
                              Name("Hypno Frog"), AiChase(pos),
                              Renderable(depth=constants.DEPTH_CREATURE, animation_key="A_AQUATIC_FROG_HYPNO"),
                              Energy(100),
                              BlocksMovement(),
                              Alignment(CreatureAlignment.FOE),
                              Experience(on_death=100),
                              Death(animation_key="S_FLESH_FISH")
                              )
예제 #7
0
def gen_player(level, coords, player_name):
    x, y = coords
    level.world.add_components_to_player(Player(), Persistent(), Position(x, y),
                                         Name(player_name), Health(100),
                                         Stats(10, 10, 10),
                                         Energy(100),
                                         Renderable(animation_key="A_PLAYER", animation_speed=1.0),
                                         Attacker(attack=666, hit_chance=100, evasion_chance=10, defense=5),
                                         Stats(strength=10, dexterity=10, intelligence=10),
                                         BlocksMovement(),
                                         Alignment(CreatureAlignment.PLAYER),
                                         Experience(),
                                         Container(),
                                         Level(1),
                                         Death(animation_key="S_DEAD_DEMON", custom_death=_death.death_player)
                                         )