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

Fix (workaround) for Landmine does almost no damage #62

Merged
merged 3 commits into from
Sep 18, 2020
Merged

Fix (workaround) for Landmine does almost no damage #62

merged 3 commits into from
Sep 18, 2020

Conversation

Firestorm01X2
Copy link
Collaborator

@Firestorm01X2 Firestorm01X2 commented Sep 18, 2020

Fix (workaround) for Landmine does almost no damage

Summary

Bugfixes #60

Purpose of change

Fixes #60

Describe the solution

Connected issue:
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.

Confirmed. Landmine triggers:

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;
}

Explosive triggers with hardcoded values.

For now lets set explosion data to adequaete values. Used values from greande explosion.
Applied to boody trap as well.

Describe alternatives you've considered

Testing

  1. Set a mine
  2. Step on a mine
  3. Observe damage. It should be comparable to grenade explosion. Previosly it barely did any damage due bug.

Additional context

Fix (workaround) for Landmine does almost no damage
src/trapfunc.cpp Outdated
g->m.remove_trap( p );
return true;
}

explosion_data get_basic_explosion_data()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functions only used in one file should be declared static.
You may need to move it above the places it is invoked in.

firestorm01x2 added 2 commits September 18, 2020 17:28
to static
fix
fix
@Coolthulhu Coolthulhu merged commit 9e415dd into cataclysmbnteam:upload Sep 18, 2020
@Firestorm01X2 Firestorm01X2 deleted the mine-fix branch September 19, 2020 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Landmine does almost no damage
2 participants