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 Bio magnet description and on-hit messages #35255

Merged
merged 2 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/json/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
"id": "bio_magnet",
"type": "bionic",
"name": "Electromagnetic Unit",
"description": "Surgically embedded in your right hand is a powerful electromagnet, allowing you to indiscriminately pull all nearby magnetic objects towards you. Unlucky bystanders might be injured or killed by flying objects.",
"description": "Surgically embedded in your right hand is a powerful electromagnet, allowing you to use your own strength to pull all nearby magnetic objects towards you. Unlucky bystanders might be injured or killed by flying objects.",
"occupied_bodyparts": [ [ "HAND_R", 3 ] ],
"act_cost": "10 kJ"
},
Expand Down
8 changes: 4 additions & 4 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,13 @@ bool player::activate_bionic( int b, bool eff_only )
// Remember all items that will be affected, then affect them
// Don't "snowball" by affecting some items multiple times
std::vector<std::pair<item, tripoint>> affected;
const auto weight_cap = weight_capacity();
const units::mass weight_cap = weight_capacity();
for( const tripoint &p : g->m.points_in_radius( pos(), 10 ) ) {
if( p == pos() || !g->m.has_items( p ) || g->m.has_flag( "SEALED", p ) ) {
continue;
}

auto stack = g->m.i_at( p );
map_stack stack = g->m.i_at( p );
for( auto it = stack.begin(); it != stack.end(); it++ ) {
if( it->weight() < weight_cap &&
it->made_of_any( affected_materials ) ) {
Expand All @@ -609,15 +609,15 @@ bool player::activate_bionic( int b, bool eff_only )
}

g->refresh_all();
for( const auto &pr : affected ) {
for( const std::pair<item, tripoint> &pr : affected ) {
projectile proj;
proj.speed = 50;
proj.impact = damage_instance::physical( pr.first.weight() / 250_gram, 0, 0, 0 );
// make the projectile stop one tile short to prevent hitting the player
proj.range = rl_dist( pr.second, pos() ) - 1;
proj.proj_effects = {{ "NO_ITEM_DAMAGE", "DRAW_AS_LINE", "NO_DAMAGE_SCALING", "JET" }};

auto dealt = projectile_attack( proj, pr.second, pos(), 0 );
dealt_projectile_attack dealt = projectile_attack( proj, pr.second, pos(), 0, this );
g->m.add_item_or_charges( dealt.end_point, pr.first );
}

Expand Down