Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landmine and boodytrap igronre explosive data from json #63

Open
Firestorm01X2 opened this issue Sep 18, 2020 · 1 comment
Open

Landmine and boodytrap igronre explosive data from json #63

Firestorm01X2 opened this issue Sep 18, 2020 · 1 comment
Labels

Comments

@Firestorm01X2
Copy link
Collaborator

Firestorm01X2 commented Sep 18, 2020

Describe the bug

Connected issue from cdda:
CleverRaven/Cataclysm-DDA#37724

I believe you should check function trapfunc::landmine() at src/trapfunc.cpp:L605
It clearly uses same explosion() function but uses preset values so I think that landmine probably does not use JSON set values at all.

Also (used workaround - adquate values were set): #60

Confirmed. Landmine triggers:

Cataclysm-BN\src\trapfunc.cpp

bool trapfunc::landmine( const tripoint &p, Creature *c, item * )
{
    // tiny animals are too light to trigger land mines
    if( c != nullptr && c->get_size() == MS_TINY ) {
        return false;
    }
    if( c != nullptr ) {
        c->add_msg_player_or_npc( m_bad, _( "You trigger a land mine!" ),
                                  _( "<npcname> triggers a land mine!" ) );
    }
    explosion_handler::explosion( p, 18, 0.5, false, 8 );
    g->m.remove_trap( p );
    return true;
}
bool trapfunc::boobytrap( const tripoint &p, Creature *c, item * )
{
    if( c != nullptr ) {
        c->add_msg_player_or_npc( m_bad, _( "You trigger a booby trap!" ),
                                  _( "<npcname> triggers a booby trap!" ) );
    }
    explosion_handler::explosion( p, get_basic_explosion_data() );
    g->m.remove_trap( p );
    return true;
}

Explosive triggers with hardcoded values

Steps To Reproduce

  1. Change boody trap or landmine explsion ddata from json (json/traps.json)
  2. Observe the result

Explosion power and other stats stays the same

Expected behavior

Explosion power and other stats are changed

Screenshots

Versions and configuration

Additional context

@Coolthulhu
Copy link
Member

The values are specifically vehicle_data.
It's not a bug that they aren't used by the "walk on" function, though it may be a good idea to extract the explosion data to main trap structure, remove it from vehicle data (keep do_explosion, though - this would trigger the main explosion for vehicles), then have the explosion function use this new explosion data field.

@scarf005 scarf005 added the bug label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants