diff --git a/data/json/bionics.json b/data/json/bionics.json index f2210580c762..c3aa73ba4845 100644 --- a/data/json/bionics.json +++ b/data/json/bionics.json @@ -813,12 +813,9 @@ "id": "bio_probability_travel", "type": "bionic", "name": { "str": "Probability Travel" }, - "description": "Increases your body's wavelength, allowing you to quantum tunnel through walls, reappearing on the other side. Power drain in standby is minimal, but each tile tunneled through costs 250 bionic power.", + "description": "Increases your body's wavelength, allowing you to quantum tunnel through walls, reappearing on the other side. Activate and select a direction to use. Tunneling costs 100 bionic power per tile traveled through.", "occupied_bodyparts": [ [ "torso", 20 ], [ "arm_l", 2 ], [ "arm_r", 2 ], [ "leg_l", 3 ], [ "leg_r", 3 ], [ "foot_l", 1 ], [ "foot_r", 1 ] ], - "flags": [ "BIONIC_TOGGLED" ], - "act_cost": "3 J", - "react_cost": "3 J", - "time": 1 + "act_cost": "100 kJ" }, { "id": "bio_purifier", diff --git a/data/json/items/bionics.json b/data/json/items/bionics.json index b7c56854682e..169319920aa2 100644 --- a/data/json/items/bionics.json +++ b/data/json/items/bionics.json @@ -709,7 +709,7 @@ "type": "BIONIC_ITEM", "name": { "str": "Probability Travel CBM" }, "looks_like": "bio_int_enhancer", - "description": "Increases the body's wavelength, allowing the user to quantum tunnel through walls, reappearing on the other side. Power drain in standby is minimal, but each tile tunneled through costs 250 bionic power.", + "description": "Increases the body's wavelength, allowing the user to quantum tunnel through walls, reappearing on the other side. Power drain in standby is relatively low, but each tile tunneled through costs 90 bionic power.", "price": 1400000, "difficulty": 11 }, diff --git a/src/avatar_action.cpp b/src/avatar_action.cpp index 8d30e34ef687..df0ba8b522d1 100644 --- a/src/avatar_action.cpp +++ b/src/avatar_action.cpp @@ -385,9 +385,6 @@ bool avatar_action::move( avatar &you, map &m, const tripoint &d ) if( g->walk_move( dest_loc, via_ramp ) ) { return true; } - if( g->phasing_move( dest_loc ) ) { - return true; - } if( veh_closed_door ) { if( !veh1->handle_potential_theft( dynamic_cast( you ) ) ) { return true; diff --git a/src/bionics.cpp b/src/bionics.cpp index 4a87cc4945e0..5d0eb236b062 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -165,6 +165,7 @@ static const bionic_id bio_painkiller( "bio_painkiller" ); static const bionic_id bio_plutdump( "bio_plutdump" ); static const bionic_id bio_power_storage( "bio_power_storage" ); static const bionic_id bio_power_storage_mkII( "bio_power_storage_mkII" ); +static const bionic_id bio_probability_travel( "bio_probability_travel" ); static const bionic_id bio_radscrubber( "bio_radscrubber" ); static const bionic_id bio_reactor( "bio_reactor" ); static const bionic_id bio_remote( "bio_remote" ); @@ -1028,6 +1029,21 @@ bool Character::activate_bionic( int b, bool eff_only ) bio.powered = false; return false; } + + } else if( bio.id == bio_probability_travel ) { + if( const cata::optional pnt = choose_adjacent( _( "Tunnel in which direction?" ) ) ) { + if( g->m.impassable( *pnt ) ) { + add_msg_activate(); + g->phasing_move( *pnt ); + } else { + refund_power(); + add_msg_if_player( m_info, _( "There's nothing to phase through there." ) ); + return false; + } + } else { + refund_power(); + return false; + } } else { add_msg_activate(); } diff --git a/src/game.cpp b/src/game.cpp index e17efd493037..981bbe98b40a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -9942,11 +9942,6 @@ void game::place_player_overmap( const tripoint_abs_omt &om_dest ) bool game::phasing_move( const tripoint &dest_loc, const bool via_ramp ) { - if( !u.has_active_bionic( bionic_id( "bio_probability_travel" ) ) || - u.get_power_level() < 250_kJ ) { - return false; - } - if( dest_loc.z != u.posz() && !via_ramp ) { // No vertical phasing yet return false; @@ -9963,20 +9958,13 @@ bool game::phasing_move( const tripoint &dest_loc, const bool via_ramp ) tunneldist += 1; //Being dimensionally anchored prevents quantum shenanigans. if( u.worn_with_flag( "DIMENSIONAL_ANCHOR" ) || u.has_effect_with_flag( "DIMENSIONAL_ANCHOR" ) ) { - u.add_msg_if_player( m_info, _( "You are repelled by the barrier!" ) ); - u.mod_power_level( -250_kJ ); //cost of tunneling one tile. - return false; - } - if( tunneldist * 250_kJ > - u.get_power_level() ) { //oops, not enough energy! Tunneling costs 250 bionic power per impassable tile - add_msg( _( "You try to quantum tunnel through the barrier but are reflected! Try again with more energy!" ) ); - u.mod_power_level( -250_kJ ); + u.add_msg_if_player( m_info, + _( "You try to quantum tunnel through the barrier, but something holds you back!" ) ); return false; } if( tunneldist > 24 ) { add_msg( m_info, _( "It's too dangerous to tunnel that far!" ) ); - u.mod_power_level( -250_kJ ); return false; } @@ -9985,14 +9973,28 @@ bool game::phasing_move( const tripoint &dest_loc, const bool via_ramp ) } if( tunneldist != 0 ) { + if( ( tunneldist - 1 ) * 100_kJ + > //The first 100 was already taken up by the bionic's activation cost. + u.get_power_level() ) { //oops, not enough energy! Tunneling costs 100 bionic power per impassable tile + if( tunneldist * 100_kJ > + u.get_max_power_level() ) { + add_msg( _( "You try to quantum tunnel through the barrier but bounce off! You don't have enough bionic power capacity to travel that far." ) ); + } else { + add_msg( _( "You try to quantum tunnel through the barrier but are reflected! You need %i bionic power to travel that thickness of material." ), + ( 100 * tunneldist ) ); + } + return false; + } + if( u.in_vehicle ) { m.unboard_vehicle( u.pos() ); } add_msg( _( "You quantum tunnel through the %d-tile wide barrier!" ), tunneldist ); - //tunneling costs 250 bionic power per impassable tile - u.mod_power_level( -( tunneldist * 250_kJ ) ); - u.moves -= 100; //tunneling costs 100 moves + //tunneling costs 100 bionic power per impassable tile, but the first 100 was already drained by activation. + u.mod_power_level( -( ( tunneldist - 1 ) * 100_kJ ) ); + //tunneling costs 100 moves baseline, 50 per extra tile up to a cap of 500 moves + u.moves -= ( 50 + ( tunneldist * 50 ) ); u.setpos( dest ); if( m.veh_at( u.pos() ).part_with_feature( "BOARDABLE", true ) ) {