Cataclysm-dda: Ability to toss grenades down stairs or drop them on stairs to allow them to fall to Z level below

Created on 17 May 2020  路  3Comments  路  Source: CleverRaven/Cataclysm-DDA

You can blind toss around corners using throw and peek, but you can not toss items up or down stairs. The ability to toss objects, like a grenade, down stairs, or up them would be realistic and could open up a lot of other tactical options especially with a dark basement and a road flare.

Describe the solution you'd like

Peek down stairs, bring up the throw menu, and be able to toss an object, like a grenade. Obviously there may be a penalty to throwing accuracy as you are not actually down the stairs, your simply taking a peek and then guessing as to how much force you need.

Describe alternatives you've considered

Dropping an item on stairs that go down allows them to fall to that Z level.

Ranged Z-levels stale

Most helpful comment

(just an exercise in code-diving, not sure if useful)
I believe, looking at the code that handles this (game.cpp:5769):

void game::peek()
{
    const cata::optional<tripoint> p = choose_direction( _( "Peek where?" ), true );
    if( !p ) {
        refresh_all();
        return;
    }

    if( p->z != 0 ) {
        const tripoint old_pos = u.pos();
        vertical_move( p->z, false );

        if( old_pos != u.pos() ) {
            look_around();
            vertical_move( p->z * -1, false );
            draw_ter();
        }
        wrefresh( w_terrain );
        draw_panels();
        return;
    }

    if( m.impassable( u.pos() + *p ) ) {
        return;
    }

    peek( u.pos() + *p );
}

The game explicitly handles vertical peeking as it used to before blind throw, you would just look above and not affect anything, so I suppose this was by design choice.
If vertical blind throwing were to be allowed, a check if z-levels are turned on must be added as well, otherwise you'd throw your grenade downstairs, it would freeze in time, and next time you went downstairs, kaboom.

Personally, I think peeking vertically shouldn't allow you to blind throw, as it is kind of a different action than peeking arond a corner: how do you peek up a ladder if not climbing it enough that you can see upstairs? ..that is regular climbing, IMO. Perhaps throwing DOWNstairs would make more sense, but that would depend on the shape of the stairs.

A solution would be to allow players to throw things vertically (like, tossing a grenade onto the roof), but that sounds like a big can of worms to implement, with trajectories, obstacles and all.

All 3 comments

(just an exercise in code-diving, not sure if useful)
I believe, looking at the code that handles this (game.cpp:5769):

void game::peek()
{
    const cata::optional<tripoint> p = choose_direction( _( "Peek where?" ), true );
    if( !p ) {
        refresh_all();
        return;
    }

    if( p->z != 0 ) {
        const tripoint old_pos = u.pos();
        vertical_move( p->z, false );

        if( old_pos != u.pos() ) {
            look_around();
            vertical_move( p->z * -1, false );
            draw_ter();
        }
        wrefresh( w_terrain );
        draw_panels();
        return;
    }

    if( m.impassable( u.pos() + *p ) ) {
        return;
    }

    peek( u.pos() + *p );
}

The game explicitly handles vertical peeking as it used to before blind throw, you would just look above and not affect anything, so I suppose this was by design choice.
If vertical blind throwing were to be allowed, a check if z-levels are turned on must be added as well, otherwise you'd throw your grenade downstairs, it would freeze in time, and next time you went downstairs, kaboom.

Personally, I think peeking vertically shouldn't allow you to blind throw, as it is kind of a different action than peeking arond a corner: how do you peek up a ladder if not climbing it enough that you can see upstairs? ..that is regular climbing, IMO. Perhaps throwing DOWNstairs would make more sense, but that would depend on the shape of the stairs.

A solution would be to allow players to throw things vertically (like, tossing a grenade onto the roof), but that sounds like a big can of worms to implement, with trajectories, obstacles and all.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

Was this page helpful?
0 / 5 - 0 ratings