From a1fc49f1fec1f6b6c4b34b7cbf21c8f8b69066dc Mon Sep 17 00:00:00 2001 From: NeviNovat <51816321+NeviNovat@users.noreply.github.com> Date: Tue, 23 Feb 2021 09:54:12 +0200 Subject: [PATCH] Make acetylene torch cut metal walls. (#46255) --- src/activity_handlers.cpp | 4 ++++ src/iuse.cpp | 8 +++++--- src/mapdata.cpp | 4 ++++ src/mapdata.h | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 07b87fc21484a..8deb436a90773 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -2299,6 +2299,10 @@ void activity_handlers::oxytorch_finish( player_activity *act, player *p ) here.ter_set( pos, t_mdoor_frame ); here.spawn_item( pos, itype_steel_plate, rng( 0, 1 ) ); here.spawn_item( pos, itype_steel_chunk, rng( 3, 8 ) ); + } else if( ter == t_wall_metal ) { + here.ter_set( pos, t_scrap_wall_halfway ); + here.spawn_item( pos, itype_steel_plate, rng( 2, 3 ) ); + here.spawn_item( pos, itype_steel_chunk, rng( 12, 20 ) ); } else if( ter == t_window_enhanced || ter == t_window_enhanced_noglass ) { here.ter_set( pos, t_window_empty ); here.spawn_item( pos, itype_steel_plate, rng( 0, 1 ) ); diff --git a/src/iuse.cpp b/src/iuse.cpp index 78c776a6a4c84..c22039c0af03b 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -5015,7 +5015,8 @@ cata::optional iuse::oxytorch( player *p, item *it, bool, const tripoint & t_metal_grate_window_with_curtain_open, t_metal_grate_window_noglass, t_metal_grate_window_with_curtain_noglass, - t_metal_grate_window_with_curtain_open_noglass + t_metal_grate_window_with_curtain_open_noglass, + t_wall_metal }; const std::set allowed_furn_id { f_rack, @@ -5070,8 +5071,9 @@ cata::optional iuse::oxytorch( player *p, item *it, bool, const tripoint & ter == t_metal_grate_window_with_curtain_open_noglass ) { turns = to_turns( 10_seconds ); } else if( ter == t_door_metal_locked || ter == t_door_metal_c || ter == t_door_bar_c || - ter == t_door_bar_locked || ter == t_door_metal_pickable || furn == f_safe_l || - furn == f_gunsafe_ml || furn == f_gunsafe_mj || furn == f_gun_safe_el ) { + ter == t_door_bar_locked || ter == t_door_metal_pickable || ter == t_wall_metal || + furn == f_safe_l || furn == f_gunsafe_ml || furn == f_gunsafe_mj || + furn == f_gun_safe_el ) { turns = to_turns( 15_seconds ); } else { return cata::nullopt; diff --git a/src/mapdata.cpp b/src/mapdata.cpp index 8a22701bbcc0e..75431e198f9a5 100644 --- a/src/mapdata.cpp +++ b/src/mapdata.cpp @@ -551,6 +551,8 @@ ter_id t_null, t_wall_half, t_wall_wood, t_wall_wood_chipped, t_wall_wood_broken, t_wall, t_concrete_wall, t_brick_wall, t_wall_metal, + t_scrap_wall, + t_scrap_wall_halfway, t_wall_glass, t_wall_glass_alarm, t_reinforced_glass, t_reinforced_glass_shutter, t_reinforced_glass_shutter_open, @@ -707,6 +709,8 @@ void set_ter_ids() t_concrete_wall = ter_id( "t_concrete_wall" ); t_brick_wall = ter_id( "t_brick_wall" ); t_wall_metal = ter_id( "t_wall_metal" ); + t_scrap_wall = ter_id( "t_scrap_wall" ); + t_scrap_wall_halfway = ter_id( "t_scrap_wall_halfway" ); t_wall_glass = ter_id( "t_wall_glass" ); t_wall_glass_alarm = ter_id( "t_wall_glass_alarm" ); t_reinforced_glass = ter_id( "t_reinforced_glass" ); diff --git a/src/mapdata.h b/src/mapdata.h index ec365bfa3140d..cc1457c5fd52c 100644 --- a/src/mapdata.h +++ b/src/mapdata.h @@ -466,6 +466,8 @@ extern ter_id t_null, t_wall_half, t_wall_wood, t_wall_wood_chipped, t_wall_wood_broken, t_wall, t_concrete_wall, t_brick_wall, t_wall_metal, + t_scrap_wall, + t_scrap_wall_halfway, t_wall_glass, t_wall_glass_alarm, t_reinforced_glass, t_reinforced_glass_shutter, t_reinforced_glass_shutter_open,