Beispiel #1
0
def bomb_beetle_corpse_tick(object=None, context=None):
    if object is None:
        return
    object.bomb_timer -= 1
    if object.bomb_timer > 2:
        object.color = libtcod.black
    elif object.bomb_timer > 1:
        object.color = libtcod.darkest_red
    elif object.bomb_timer > 0:
        object.color = libtcod.red
    elif object.bomb_timer <= 0:
        ui.message('The bomb beetle corpse explodes!', libtcod.orange)
        ui.render_explosion(object.x, object.y, 1, libtcod.yellow,
                            libtcod.flame)
        main.create_fire(object.x, object.y, 10)
        for tile in main.adjacent_tiles_diagonal(object.x, object.y):
            if libtcod.random_get_int(0, 0, 3) != 0:
                main.create_fire(tile[0], tile[1], 10)
                main.melt_ice(tile[0], tile[1])
            monster = main.get_objects(tile[0], tile[1],
                                       lambda o: o.fighter is not None)
            if len(monster) > 0:
                monster[0].fighter.take_damage(main.roll_dice('22d3'))
                if monster[0].fighter is not None:
                    monster[0].fighter.apply_status_effect(effects.burning())
        object.destroy()
Beispiel #2
0
def firebomb(actor, target, context):
    (x, y) = context['origin']
    ui.render_projectile((actor.x, actor.y), (x, y),
                         spells.essence_colors['fire'], chr(7))
    ui.render_explosion(x, y, 1, libtcod.yellow, libtcod.flame)
    if actor is player.instance or fov.player_can_see(x, y):
        ui.message('The firebomb explodes!', spells.essence_colors['fire'])
    for f in target:
        if combat.attack_magical(
                actor.fighter, f,
                'ability_fire_bomb') == 'hit' and f.fighter is not None:
            f.fighter.apply_status_effect(effects.burning())
Beispiel #3
0
def fireball(actor, target, context):
    (x, y) = context['origin']
    if actor is not player.instance and not fov.monster_can_see_tile(
            actor, x, y):
        return 'cancelled'
    ui.message('The fireball explodes!', libtcod.flame)
    ui.render_explosion(x, y, 1, libtcod.yellow, libtcod.flame)
    for obj in target:
        combat.attack_magical(actor.fighter, obj, 'ability_fireball')
        if obj.fighter is not None:
            obj.fighter.apply_status_effect(effects.burning())

    for _x in range(x - 1, x + 2):
        for _y in range(y - 1, y + 2):
            main.melt_ice(_x, _y)
Beispiel #4
0
def flame_breath(actor, target, context):
    for tile in target:
        main.melt_ice(tile[0], tile[1])
        t = main.current_map.tiles[tile[0]][tile[1]]
        if t.flammable or main.roll_dice('1d2') == 1:
            main.create_fire(tile[0], tile[1], 12)

        for obj in main.current_map.fighters:
            if obj.x == tile[0] and obj.y == tile[1]:
                combat.attack_magical(actor.fighter, obj,
                                      'ability_flame_breath')
                if obj.fighter is not None:
                    obj.fighter.apply_status_effect(effects.burning(),
                                                    context['save_dc'], actor)

    return 'success'
Beispiel #5
0
def on_hit_burn(attacker, target, damage):
    if target.fighter is None:
        return
    if libtcod.random_get_int(0, 1, 10) <= 7:
        target.fighter.apply_status_effect(effects.burning())