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

Migrate the "Kill Horde Master" mission to JSON #62559

Merged
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
18 changes: 17 additions & 1 deletion data/json/npcs/missiondef.json
Original file line number Diff line number Diff line change
Expand Up @@ -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, "name": "Demonic Soul" },
{ "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",
Expand Down
1 change: 0 additions & 1 deletion src/mission.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 0 additions & 46 deletions src/mission_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

Expand Down Expand Up @@ -91,47 +86,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<coords::sm>( 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
Expand Down
1 change: 0 additions & 1 deletion src/missiondef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ static const std::map<std::string, std::function<void( mission * )>> 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 },
Expand Down