From 1a13be36d01648cbbaa206f79de5b58ed6ae62fc Mon Sep 17 00:00:00 2001 From: Anton Burmistrov Date: Fri, 6 Sep 2024 08:38:47 +0400 Subject: [PATCH] Re-added ability to launch nuclear missile to No Hope mod, once again (#76214) * Returned a mod's exclusive variant of finale with a computer able to launch nuclear missile * Replaced manual placing of mininuke with a placing 'crater' overmap special Also removed no longer needed 'nuke' explosion handler. * Added myself back to the list of mod's maintainers * remove unused statics --------- Co-authored-by: Kevin Granade --- data/mods/No_Hope/Mapgen/missile_silo.json | 70 ++++++++++++++++++++++ data/mods/No_Hope/modinfo.json | 3 +- src/computer_session.cpp | 14 ++--- src/explosion.cpp | 15 ----- src/explosion.h | 2 - 5 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 data/mods/No_Hope/Mapgen/missile_silo.json diff --git a/data/mods/No_Hope/Mapgen/missile_silo.json b/data/mods/No_Hope/Mapgen/missile_silo.json new file mode 100644 index 0000000000000..bd0a3e250044a --- /dev/null +++ b/data/mods/No_Hope/Mapgen/missile_silo.json @@ -0,0 +1,70 @@ +[ + { + "type": "mapgen", + "method": "json", + "om_terrain": [ "silo_finale" ], + "//": "Adds a missile launch option to the finale's computer", + "weight": 400, + "object": { + "fill_ter": "t_thconc_floor", + "rows": [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " │││││││││││ ", + " ││~~~~~~~~~│││││ │││││ ", + "││~~~~~~~~~~~││Y│││4│a││", + "│~~~~~~~~~~~~~+........│", + "│~~~~~~~~~~~~~|.││││││.│", + "│~~~~~~~~~~~~~|.|x..a│.│", + "│~~~~~~~~~~~~~|.|x...│.│", + "│~~~~~~~~~~~~~|.|6c..+.│", + "│~~~~~~~~~~~~~|.|x...│Y│", + "│~~~~~~~~~~~~~|.|x...│││", + "│~~~~~~~~~~~~~|.│....│ ", + "│~~~~~~~~~~~~~│.│%%%%│││", + "││~~~~~~~~~~~││.││││││^│", + " ││~~~~~~~~~│││..+....$│", + " │││││││││││ ││││Y│<│$│", + " │││││││" + ], + "terrain": { + " ": "t_rock", + "│": "t_wall_metal", + ".": "t_thconc_floor", + "~": "t_metal_floor_no_roof", + "|": "t_reinforced_glass_shutter_open", + "?": "t_door_metal_c_peep", + "+": "t_door_metal_locked", + "<": "t_stairs_up", + "Y": "t_card_military", + "^": "t_elevator_control_off", + "$": "t_elevator" + }, + "furniture": { + "x": "f_console_broken", + "%": "f_machinery_electronic", + "1": "f_speaker_cabinet", + "4": "f_speaker_cabinet", + "a": "f_air_conditioner", + "c": "f_chair" + }, + "computers": { + "6": { + "name": "Missile Controls", + "access_denied": "ERROR! Access denied! Unauthorized access will be met with lethal force!", + "security": 1, + "failures": [ { "action": "alarm" }, { "action": "damage" }, { "action": "secubots" } ], + "options": [ { "name": "Launch Missile", "action": "miss_launch" }, { "name": "Disarm Missile", "action": "miss_disarm" } ] + } + }, + "place_graffiti": [ { "text": "Warning! Automatic security measures engaged due to the lockdown order!", "x": 17, "y": 20 } ], + "place_monster": [ { "monster": "mon_zombie_hazmat", "x": 8, "y": 15 } ] + } + } +] diff --git a/data/mods/No_Hope/modinfo.json b/data/mods/No_Hope/modinfo.json index e439c418efe93..93e6c35384c3b 100644 --- a/data/mods/No_Hope/modinfo.json +++ b/data/mods/No_Hope/modinfo.json @@ -4,10 +4,11 @@ "id": "no_hope", "name": "No Hope", "authors": [ "Night_Pryanik" ], + "maintainers": [ "Night_Pryanik" ], "description": "- Significantly reduced amount of places with guaranteed loot spawns.\n- Loot spawn in buildings is drastically reduced, especially for food, tools, guns etc.\n- Most buildings are destroyed, vandalized, or looted.\n- Most cars are destroyed or at least damaged. Intact cars are nearly impossible to find.\n- Fuel is much harder to find, almost all cars have no fuel in tanks.\n- Marauders, looters, and bandits everywhere.\n\nSee extended description in README.md.\n\nTo get the mod author's intended playing experience, consider:\n- Enabling wandering hordes.\n- Setting item spawn scaling factor to 0.5 or lower.\n- Setting spawn rate scaling factor to 1.5 or higher.", "category": "content", "dependencies": [ "dda" ], - "version": "3.4" + "version": "3.5" }, { "type": "monster_adjustment", diff --git a/src/computer_session.cpp b/src/computer_session.cpp index 5fe8ef3fc3c9c..db0b72a5c210b 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -104,6 +104,8 @@ static const mtype_id mon_secubot( "mon_secubot" ); static const oter_type_str_id oter_type_sewer( "sewer" ); static const oter_type_str_id oter_type_subway( "subway" ); +static const overmap_special_id overmap_special_Crater( "Crater" ); + static const skill_id skill_computer( "computer" ); static const species_id species_HUMAN( "HUMAN" ); @@ -779,16 +781,8 @@ void computer_session::action_miss_launch() tmpmap.save(); } - for( const tripoint_abs_omt &p : points_in_radius( target, 2 ) ) { - // give it a nice rounded shape - if( !( p.x() == target.x() - 2 && p.y() == target.y() - 2 ) && - !( p.x() == target.x() - 2 && p.y() == target.y() + 2 ) && - !( p.x() == target.x() + 2 && p.y() == target.y() - 2 ) && - !( p.x() == target.x() + 2 && p.y() == target.y() + 2 ) ) { - overmap_buffer.ter_set( p, oter_id( "field" ) ); - } - } - explosion_handler::nuke( target ); + overmap_buffer.place_special( *overmap_special_Crater, target, om_direction::type::north, false, + true ); activate_failure( COMPFAIL_SHUTDOWN ); } diff --git a/src/explosion.cpp b/src/explosion.cpp index a0af4c86c3175..6546603f3d44b 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -77,13 +77,10 @@ static const efftype_id effect_emp( "emp" ); static const efftype_id effect_stunned( "stunned" ); static const efftype_id effect_teleglow( "teleglow" ); -static const flag_id json_flag_ACTIVATE_ON_PLACE( "ACTIVATE_ON_PLACE" ); - static const furn_str_id furn_f_machinery_electronic( "f_machinery_electronic" ); static const itype_id fuel_type_none( "null" ); static const itype_id itype_e_handcuffs( "e_handcuffs" ); -static const itype_id itype_mininuke_act( "mininuke_act" ); static const itype_id itype_rm13_armor_on( "rm13_armor_on" ); static const json_character_flag json_flag_EMP_IMMUNE( "EMP_IMMUNE" ); @@ -844,18 +841,6 @@ void emp_blast( const tripoint &p ) // TODO: Drain NPC energy reserves } -void nuke( const tripoint_abs_omt &p ) -{ - tinymap tmpmap; - tmpmap.load( p, false ); - - item mininuke( itype_mininuke_act ); - mininuke.set_flag( json_flag_ACTIVATE_ON_PLACE ); - tmpmap.add_item( { SEEX - 1, SEEY - 1, 0 }, mininuke ); - - tmpmap.save(); -} - void resonance_cascade( const tripoint &p ) { Character &player_character = get_player_character(); diff --git a/src/explosion.h b/src/explosion.h index fd1dda77ba2f6..dbec0b08fc616 100644 --- a/src/explosion.h +++ b/src/explosion.h @@ -95,8 +95,6 @@ void resonance_cascade( const tripoint &p ); void scrambler_blast( const tripoint &p ); /** Triggers an EMP blast at p. */ void emp_blast( const tripoint &p ); -/** Nuke the area at p - global overmap terrain coordinates! */ -void nuke( const tripoint_abs_omt &p ); // shockwave applies knockback to all targets within radius of p // parameters force, stun, and dam_mult are passed to knockback() // ignore_player determines if player is affected, useful for bionic, etc.