From e80b84a919bbf607fed2d66a52d91e228f250c2f Mon Sep 17 00:00:00 2001 From: MNG-cataclysm Date: Sat, 3 Dec 2022 23:27:25 -0500 Subject: [PATCH 1/4] Add the stuff --- data/json/npcs/missiondef.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/data/json/npcs/missiondef.json b/data/json/npcs/missiondef.json index fb8f9a4fca3aa..32f6921476733 100644 --- a/data/json/npcs/missiondef.json +++ b/data/json/npcs/missiondef.json @@ -459,7 +459,23 @@ "difficulty": 5, "value": 250000, "urgent": true, - "start": "kill_horde_master", + "start": { + "update_mapgen": { + "place_monster": [ + { "monster": "mon_zombie_master", "x": [ 12, 15 ], "y": [ 12, 15 ], "target": true }, + { "group": "GROUP_ZOMBIE", "x": [ 12, 15 ], "y": [ 12, 15 ], "repeat": [ 21, 29 ] } + ] + }, + "effect": "follow_only", + "assign_mission_target": { + "om_terrain": "house", + "om_terrain_match_type": "CONTAINS", + "search_range": 80, + "min_distance": 10, + "random": true, + "z": 0 + } + }, "end": { "effect": "stop_following" }, "origins": [ "ORIGIN_SECONDARY" ], "followup": "MISSION_RECRUIT_TRACKER", From c53204f2667cd87089611a03755b6b2b1a8a57d9 Mon Sep 17 00:00:00 2001 From: MNG-cataclysm Date: Sat, 3 Dec 2022 23:39:25 -0500 Subject: [PATCH 2/4] Do the C++ thing --- src/mission.h | 1 - src/mission_start.cpp | 41 ----------------------------------------- src/missiondef.cpp | 1 - 3 files changed, 43 deletions(-) diff --git a/src/mission.h b/src/mission.h index 90f87c441acc8..445b8a638cde1 100644 --- a/src/mission.h +++ b/src/mission.h @@ -102,7 +102,6 @@ struct mission_start { static void standard( mission * ); // Standard for its goal type static void place_dog( mission * ); // Put a dog in a house! static void place_zombie_mom( mission * ); // Put a zombie mom in a house! - static void kill_horde_master( mission * ); // Kill the master zombie at the center of the horde static void kill_nemesis( mission * ); // Kill the nemesis spawned with the "hunted" trait static void place_npc_software( mission * ); // Put NPC-type-dependent software static void place_priest_diary( mission * ); // Hides the priest's diary in a local house diff --git a/src/mission_start.cpp b/src/mission_start.cpp index 9bc98747aac63..dd133266b9492 100644 --- a/src/mission_start.cpp +++ b/src/mission_start.cpp @@ -91,47 +91,6 @@ void mission_start::place_zombie_mom( mission *miss ) zomhouse.save(); } -void mission_start::kill_horde_master( mission *miss ) -{ - npc *p = g->find_npc( miss->npc_id ); - if( p == nullptr ) { - debugmsg( "could not find mission NPC %d", miss->npc_id.get_value() ); - return; - } - // Npc joins you - p->set_attitude( NPCATT_FOLLOW ); - // Pick one of the below locations for the horde to haunt - const tripoint_abs_omt center = p->global_omt_location(); - tripoint_abs_omt site = overmap_buffer.find_closest( center, "office_tower_1", 0, false ); - if( site == overmap::invalid_tripoint ) { - site = overmap_buffer.find_closest( center, "hotel_tower_1_8", 0, false ); - } - if( site == overmap::invalid_tripoint ) { - site = overmap_buffer.find_closest( center, "school_5", 0, false ); - } - if( site == overmap::invalid_tripoint ) { - site = overmap_buffer.find_closest( center, "forest_thick", 0, false ); - } - miss->target = site; - overmap_buffer.reveal( site, 6 ); - tinymap tile; - tile.load( project_to( site ), false ); - tile.add_spawn( mon_zombie_master, 1, { SEEX, SEEY, site.z() }, false, -1, miss->uid, - _( "Demonic Soul" ) ); - tile.add_spawn( mon_zombie_brute, 3, { SEEX, SEEY, site.z() } ); - tile.add_spawn( mon_zombie_dog, 3, { SEEX, SEEY, site.z() } ); - - for( int x = SEEX - 1; x <= SEEX + 1; x++ ) { - for( int y = SEEY - 1; y <= SEEY + 1; y++ ) { - tile.add_spawn( mon_zombie, rng( 3, 10 ), { x, y, site.z() } ); - } - tile.add_spawn( mon_zombie_dog, rng( 0, 2 ), { SEEX, SEEY, site.z() } ); - } - tile.add_spawn( mon_zombie_necro, 2, { SEEX, SEEY, site.z() } ); - tile.add_spawn( mon_zombie_hulk, 1, { SEEX, SEEY, site.z() } ); - tile.save(); -} - void mission_start::kill_nemesis( mission * ) { // Pick an area for the nemesis to spawn diff --git a/src/missiondef.cpp b/src/missiondef.cpp index 47ed7e964e3ca..6bbbc3c9d8c51 100644 --- a/src/missiondef.cpp +++ b/src/missiondef.cpp @@ -195,7 +195,6 @@ static const std::map> mission_fun { "standard", { } }, { "place_dog", mission_start::place_dog }, { "place_zombie_mom", mission_start::place_zombie_mom }, - { "kill_horde_master", mission_start::kill_horde_master }, { "kill_nemesis", mission_start::kill_nemesis }, { "place_npc_software", mission_start::place_npc_software }, { "place_priest_diary", mission_start::place_priest_diary }, From 8a4d5f3c9c079e94f22b18cc7d19f1b6e5eea451 Mon Sep 17 00:00:00 2001 From: MNG-cataclysm <58958654+MNG-cataclysm@users.noreply.github.com> Date: Sun, 4 Dec 2022 00:27:49 -0500 Subject: [PATCH 3/4] Update data/json/npcs/missiondef.json Co-authored-by: Anton Burmistrov --- data/json/npcs/missiondef.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/npcs/missiondef.json b/data/json/npcs/missiondef.json index 32f6921476733..a5f2c62f72fff 100644 --- a/data/json/npcs/missiondef.json +++ b/data/json/npcs/missiondef.json @@ -462,7 +462,7 @@ "start": { "update_mapgen": { "place_monster": [ - { "monster": "mon_zombie_master", "x": [ 12, 15 ], "y": [ 12, 15 ], "target": true }, + { "monster": "mon_zombie_master", "x": [ 12, 15 ], "y": [ 12, 15 ], "target": true, "name": "Demonic Soul" }, { "group": "GROUP_ZOMBIE", "x": [ 12, 15 ], "y": [ 12, 15 ], "repeat": [ 21, 29 ] } ] }, From d89155aa9b7b5a3d6eb60d03932bef4e664f784f Mon Sep 17 00:00:00 2001 From: MNG-cataclysm <58958654+MNG-cataclysm@users.noreply.github.com> Date: Sun, 4 Dec 2022 10:48:25 -0500 Subject: [PATCH 4/4] Update mission_start.cpp --- src/mission_start.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mission_start.cpp b/src/mission_start.cpp index dd133266b9492..e6a87dc863034 100644 --- a/src/mission_start.cpp +++ b/src/mission_start.cpp @@ -40,11 +40,6 @@ mission_MISSION_GET_ZOMBIE_BLOOD_ANAL( "MISSION_GET_ZOMBIE_BLOOD_ANAL" ); static const mtype_id mon_dog( "mon_dog" ); static const mtype_id mon_zombie( "mon_zombie" ); -static const mtype_id mon_zombie_brute( "mon_zombie_brute" ); -static const mtype_id mon_zombie_dog( "mon_zombie_dog" ); -static const mtype_id mon_zombie_hulk( "mon_zombie_hulk" ); -static const mtype_id mon_zombie_master( "mon_zombie_master" ); -static const mtype_id mon_zombie_necro( "mon_zombie_necro" ); static const overmap_special_id overmap_special_evac_center( "evac_center" );