Esempio n. 1
0
// need to have a version where there is no player defined, possibly. That way shrapnel works as intended
void game::draw_bullet( const tripoint &t, const int i, const std::vector<tripoint> &trajectory,
                        const char bullet )
{
    // TODO: signature and impl could be changed to eliminate these params

    ( void )i;        //unused
    ( void )trajectory; //unused

    if( !use_tiles ) {
        draw_bullet_curses( m, t, bullet, nullptr );
        return;
    }

    if( !is_point_visible( t ) ) {
        return;
    }

    static const std::string bullet_unknown  {};
    static const std::string bullet_normal   {"animation_bullet_normal"};
    static const std::string bullet_flame    {"animation_bullet_flame"};
    static const std::string bullet_shrapnel {"animation_bullet_shrapnel"};

    const std::string &bullet_type =
        ( bullet == '*' ) ? bullet_normal
        : ( bullet == '#' ) ? bullet_flame
        : ( bullet == '`' ) ? bullet_shrapnel
        : bullet_unknown;

    tilecontext->init_draw_bullet( t, bullet_type );
    bullet_animation().progress();
    tilecontext->void_bullet();
}
Esempio n. 2
0
void game::draw_bullet(Creature const &p, const tripoint &t, int const i,
    std::vector<tripoint> const &trajectory, char const bullet)
{
    if( !u.sees( t ) ) {
        return;
    }

    draw_bullet_curses(w_terrain, u, m, t, bullet, &trajectory[i], p.is_player());
}
Esempio n. 3
0
// need to have a version where there is no player defined, possibly. That way shrapnel works as intended
void game::draw_bullet(Creature const &p, const tripoint &t, int const i,
                       std::vector<tripoint> const &trajectory, char const bullet)
{
    //TODO signature and impl could be changed to eliminate these params

    (void)i;          //unused
    (void)trajectory; //unused

    if( !u.sees( t ) ) {
        return;
    }

    if (!use_tiles) {
        draw_bullet_curses(w_terrain, u, m, t, bullet, nullptr, p.is_player());
        return;
    }

    static std::string const bullet_unknown  {};
    static std::string const bullet_normal   {
        "animation_bullet_normal"
    };
    static std::string const bullet_flame    {
        "animation_bullet_flame"
    };
    static std::string const bullet_shrapnel {
        "animation_bullet_shrapnel"
    };

    std::string const &bullet_type =
        (bullet == '*') ? bullet_normal
        : (bullet == '#') ? bullet_flame
        : (bullet == '`') ? bullet_shrapnel
        : bullet_unknown;

    tilecontext->init_draw_bullet( t, bullet_type );
    wrefresh(w_terrain);

    if( p.is_player() ) {
        draw_animation_delay();
    }

    tilecontext->void_bullet();
}
Esempio n. 4
0
void game::draw_bullet( const tripoint &t, const int i, const std::vector<tripoint> &trajectory,
                        const char bullet )
{
    draw_bullet_curses( m, t, bullet, &trajectory[i] );
}