Skip to content

Commit

Permalink
Migrate the "Recover Priests Diary" mission to JSON (CleverRaven#62581)
Browse files Browse the repository at this point in the history
* Add the stuff

* Update data/json/npcs/missiondef.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
MNG-cataclysm and github-actions[bot] authored Dec 11, 2022
1 parent eb54eb3 commit f16a17d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
12 changes: 11 additions & 1 deletion data/json/npcs/missiondef.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,17 @@
"difficulty": 2,
"value": 70000,
"item": "priest_diary",
"start": "place_priest_diary",
"start": {
"update_mapgen": { "place_item": [ { "item": "priest_diary", "x": [ 3, 21 ], "y": [ 6, 21 ], "amount": 1 } ] },
"assign_mission_target": {
"om_terrain": "house",
"om_terrain_match_type": "PREFIX",
"search_range": 80,
"min_distance": 5,
"random": true,
"z": 0
}
},
"origins": [ "ORIGIN_SECONDARY" ],
"followup": "MISSION_INVESTIGATE_CULT",
"dialogue": {
Expand Down
1 change: 0 additions & 1 deletion src/mission.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ struct mission_start {
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
static void place_deposit_box( mission * ); // Place a safe deposit box in a nearby bank
static void find_safety( mission * ); // Goal is set to non-spawn area
static void place_book( mission * ); // Place a book to retrieve
Expand Down
21 changes: 0 additions & 21 deletions src/mission_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,27 +245,6 @@ void mission_start::place_npc_software( mission *miss )
compmap.save();
}

void mission_start::place_priest_diary( mission *miss )
{
const tripoint_abs_omt place = mission_util::random_house_in_closest_city();
miss->target = place;
overmap_buffer.reveal( place, 2 );
tinymap compmap;
compmap.load( project_to<coords::sm>( place ), false );

std::vector<tripoint> valid;
for( const tripoint &p : compmap.points_on_zlevel() ) {
if( compmap.furn( p ) == f_bed || compmap.furn( p ) == f_dresser ||
compmap.furn( p ) == f_indoor_plant || compmap.furn( p ) == f_cupboard ) {
valid.push_back( p );
}
}
const tripoint fallback( rng( 6, SEEX * 2 - 7 ), rng( 6, SEEY * 2 - 7 ), place.z() );
const tripoint comppoint = random_entry( valid, fallback );
compmap.spawn_item( comppoint, "priest_diary" );
compmap.save();
}

void mission_start::place_deposit_box( mission *miss )
{
npc *p = g->find_npc( miss->npc_id );
Expand Down
1 change: 0 additions & 1 deletion src/missiondef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ static const std::map<std::string, std::function<void( mission * )>> mission_fun
{ "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 },
{ "place_deposit_box", mission_start::place_deposit_box },
{ "find_safety", mission_start::find_safety },
{ "place_book", mission_start::place_book },
Expand Down

0 comments on commit f16a17d

Please sign in to comment.