From cd57497460d2a3cd5e631da51a4eab3ffe53b306 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sat, 25 May 2024 20:56:01 -0400 Subject: [PATCH 01/59] adds dynamic faction epilogues --- data/json/npcs/factions.json | 43 +++++++++++++++++------ data/json/snippets/epilogue_factions.json | 42 +++++++++++++++++++++- src/faction.cpp | 23 ++++++++++++ src/faction.h | 2 ++ src/game.cpp | 12 ++++++- 5 files changed, 110 insertions(+), 12 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 20eacecdf3e4d..9f3a1c3a16446 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -77,8 +77,14 @@ "marloss": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, - { "power_min": 150, "power_max": 299, "id": "epilogue_faction_robofac_150" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" } + ], + "dynamic_epilogues": [ + { "fac1_id": "exodii", "power_strong_1": false, "fac2_id": "the_great_library", "power_strong_2": false, "id": "epilogue_faction_robofac_150" }, + { "fac1_id": "exodii", "power_strong_1": false, "fac2_id": "the_great_library", "power_strong_2": true, "id": "epilogue_faction_robofac_150" }, + { "fac1_id": "exodii", "power_strong_1": true, "fac2_id": "the_great_library", "power_strong_2": false, "id": "epilogue_faction_robofac_150" }, + { "fac1_id": "exodii", "power_strong_1": true, "fac2_id": "the_great_library", "power_strong_2": true, "id": "epilogue_faction_robofac_thrive" }, + { "fac1_id": "old_guard", "power_strong_1": true, "id": "epilogue_faction_robofac_OG" } ], "description": "The surviving staff of Hub 01, a pre-Cataclysm research lab. They rarely leave their lab, if at all, and rely on their robots and advanced technology to survive." }, @@ -141,8 +147,13 @@ "hells_raiders": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "id": "epilogue_faction_old_guard_0" }, - { "power_min": 150, "id": "epilogue_faction_old_guard_150" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_old_guard_0" } + ], + "dynamic_epilogues": [ + { "fac1_id": "tacoma_commune", "power_strong_1": false, "fac2_id": "robofac", "power_strong_2": false, "id": "epilogue_faction_old_guard_thrive" }, + { "fac1_id": "tacoma_commune", "power_strong_1": false, "fac2_id": "robofac", "power_strong_2": true, "id": "epilogue_faction_old_guard_thrive" }, + { "fac1_id": "tacoma_commune", "power_strong_1": true, "fac2_id": "robofac", "power_strong_2": false, "id": "epilogue_faction_old_guard_thrive" }, + { "fac1_id": "tacoma_commune", "power_strong_1": true, "fac2_id": "robofac", "power_strong_2": true, "id": "epilogue_faction_old_guard_thrive" } ], "description": "The remains of the federal government. The extent of their strength is unknown but squads of patrolling soldiers have been seen under their banner." }, @@ -317,8 +328,13 @@ } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" }, - { "power_min": 150, "id": "epilogue_faction_tacoma_commune_150" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" } + ], + "dynamic_epilogues": [ + { "fac1_id": "free_merchants", "power_strong_1": true, "id": "epilogue_faction_tacoma_commune_150" }, + { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": true, "id": "epilogue_tacoma_commune_FM_OG" }, + { "fac1_id": "free_merchants", "power_strong_1": false, "id": "epilogue_tacoma_commune_revolt" }, + { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": false, "id": "epilogue_tacoma_commune_OG" } ], "description": "An outpost started by the Free Merchants to provide a source of food and raw materials." }, @@ -456,8 +472,11 @@ "your_followers": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_hells_raiders_0" }, - { "power_min": 150, "id": "epilogue_faction_hells_raiders_150" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_hells_raiders_0" } + ], + "dynamic_epilogues": [ + { "fac1_id": "old_guard", "power_strong_1": false, "id": "epilogue_faction_hells_raiders_150" }, + { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "robofac", "power_strong_2": true, "fac3_id": "tacoma_commune", "power_strong_3": true, "id": "epilogue_faction_hells_raiders_collapse" } ], "description": "The largest gang of hooligans and bandits that preys upon other survivors. Even if you have no gear, there is always a need for slaves and fresh meat." }, @@ -592,8 +611,12 @@ "hells_raiders": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_isherwoods_0" }, - { "power_min": 150, "id": "epilogue_faction_isherwoods_150" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_isherwoods_0" } + ], + "dynamic_epilogues": [ + { "fac1_id": "old_guard", "power_strong_1": false, "id": "epilogue_faction_isherwoods_150" }, + { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": true, "id": "epilogue_faction_isherwoods_OG_FM" }, + { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": false, "fac3_id": "tacoma_commune", "power_strong_3": true, "id": "epilogue_faction_isherwoods_OG" } ], "description": "A small family surviving on their generational land." }, diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index ebda5fde9e544..342b953c21a3f 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -7,6 +7,10 @@ "id": "epilogue_faction_default", "text": " You and everyone who followed you are forgotten among the billions lost in the Cataclysm…" }, + { + "id": "epilogue_faction_dynamic_default", + "text": " " + }, { "id": "epilogue_faction_your_followers_0", "text": " You and everyone who followed you are forgotten among the billions lost in the Cataclysm…" @@ -19,6 +23,10 @@ "id": "epilogue_faction_old_guard_150", "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by small successes, a number of operations to re-secure facilities met with limited success. Forced to eventually consolidate to large bases, the Old Guard left these facilities in the hands of the few survivors that remained. As the years passed, little materialized from the hopes of rebuilding civilization…" }, + { + "id": "epilogue_faction_old_guard_thrive", + "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag. In the coming decades, the Old Guard were able to reconnect much of New England and beyond, their dreams for the future buoyed by the memory of the past." + }, { "id": "epilogue_faction_free_merchants_0", "text": " Life in the refugee shelter deteriorated as food shortages and disease destroyed any hope of maintaining a civilized enclave. The merchants and craftsmen dispersed to found new colonies but most became victims of marauding bandits. Those who survived never found a place to call home…" @@ -35,6 +43,18 @@ "id": "epilogue_faction_tacoma_commune_150", "text": " The commune continued to grow rapidly through the years despite constant external threat. While maintaining a reputation as a haven for all law-abiding citizens, the commune's leadership remained loyal to the interests of the Free Merchants. Hard labor for little reward remained the price to be paid for those who sought the safety of the community." }, + { + "id": "epilogue_faction_tacoma_commune_revolt", + "text": " Through the years, the commune would continue to rapidly grow despite constant external threats. In a surprising twist then, the greatest threat would turn out to be an internal one. The collapse of the Free Merchant traders plunged the Commune's leadership into a period of significant infighting, and seeing an opportunity, the survivors of the Commune quickly moved to oust them. Afterwards, the settlement was re-organized under a democratically elected council and the resources of Tacoma were distributed by need and popular vote. The Commune would soon earn a reputation as a place where the struggles of the wasteland were shared, and where the horrors of the world were faced together." + }, + { + "id": "epilogue_faction_tacoma_commune_FM_OG", + "text": " When the Old Guard came for their support, the Commune's leadership was happy to accept, though not without conditions. Lucrative contracts and the exclusive rights to inter-settlement trade routes made the Free Merchants virtual merchant royalty overnight. While many survivors would grumble, none could deny that wherever the Old Guard went, the Free Merchants would bring their prosperity with them, for a price of course." + }, + { + "id": "epilogue_faction_tacoma_commune_OG", + "text": " When the Old Guard came for their support, the citizens of the Commune were extremely resistant to surrendering their autonomy to this 'new' power. However, the Old Guard, desperate to find footholds in the region, proved more amicable to their demands than they expected. In exchange for representation in the Provisional Congress on Nantucket island, and the Old Guard's support in organizing other settlements like Tacoma in their territory, the Tacoma Commune would surprise many by voting to join the new union. When asked for a comment on the vote, the First Speaker of the Tacoma Council simply said, 'out of many, one.'" + }, { "id": "epilogue_faction_isolated_road_0", "text": " The artisans continued to work for a time. However a lack of trade and connection left them doomed from the beginning. At some point the properties became abandoned with no signs of the former inhabitants." @@ -59,13 +79,25 @@ "id": "epilogue_faction_hells_raiders_150", "text": " Fueled by drugs and rage, the Hell's Raiders fought tooth and nail to overthrow the last strongholds of the Old Guard. The costly victories brought the warlords abundant territory and slaves but little in the way of stability. Within weeks, infighting led to civil war as tribes vied for leadership of the faction. When only one warlord finally secured control, there was nothing left to fight for… just endless cities full of the dead." }, + { + "id": "epilogue_faction_hells_raiders_collapse", + "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror finally beginning to fade like a bad dream." + }, { "id": "epilogue_faction_robofac_0", "text": " Despite Melchior's enlightened leadership, shortages and crises plagued Hub-01 from the first day of the Cataclysm. The researchers and administrators among the surviving staff lacked the practical skills to survive in the savage new world. As Hub-01's systems collapsed from a lack of maintenance, the few survivors fled the building to be killed by the zombies and bandits." }, { "id": "epilogue_faction_robofac_150", - "text": " Melchior's enlightened leadership, combined with practical skills provided by mercenary survivors, allowed Hub-01 to flourish briefly. It became a mecca for advanced technology, selling off devices and equipment that could no longer be reproduced. Despite this, Hub-01 was never able to expand sufficiently to renew its own population, nor was it able to unite with any other prosperous community, nor could enough trustworthy mercenaries (or staff) be recruited to replace those who died in its defense. Hub-01 fell into disrepair and ruin. After the air processing facility was overtaken by mold, the remaining staff of Hub-01 fled the building and were killed by zombies and bandits. Melchior's drones - possibly by design - were incapable of maintaining themselves without human hands, and stopped working a few months later. Without regular maintenance, Melchior's own systems also fell to ruin, and less than a decade after the Cataclysm, humanity's first AI powered down and was forgotten." + "text": " Melchior's enlightened leadership, combined with practical skills provided by mercenary survivors, allowed Hub-01 to flourish briefly. It became a mecca for advanced technology, selling off devices and equipment that could no longer be reproduced. Despite this, Hub-01 was never able to expand sufficiently to renew its own population, nor was it able to unite with any other prosperous community, nor could enough trustworthy mercenaries (or staff) be recruited to replace those who died in its defense. Hub-01 fell into disrepair and ruin. After the air processing facility was overtaken by mold, the remaining staff of Hub-01 fled the building and were killed by zombies and bandits. Melchior's drones - possibly by design - were incapable of maintaining themselves without human hands, and stopped working a few months later. Without regular maintenance, Melchior's own systems also fell to ruin, and less than a decade after the Cataclysm, humanity's first AI powered down and was forgotten." + }, + { + "id": "epilogue_faction_robofac_thrive", + "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." + }, + { + "id": "epilogue_faction_robofac_OG", + "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." }, { "id": "epilogue_faction_isherwoods_0", @@ -75,6 +107,14 @@ "id": "epilogue_faction_isherwoods_150", "text": " The generational land of the Isherwoods came to flourish following , helping to feed nearby settlements. Survivors flocked to learn botany, animal handling, and backwoods remedies, eventually forming a small community…" }, + { + "id": "epilogue_faction_isherwoods_OG_FM", + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. With the Isherwoods forced from their home, the farm was quickly purchased by the Free Merchants and converted into a very profitable plantation…" + }, + { + "id": "epilogue_faction_isherwoods_OG", + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. After the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to oversee a future settlement…" + }, { "id": "epilogue_faction_lapin_0", "text": " Mr. Lapin continued his remote life in the wilderness, teaching whoever would visit. The survivors who came slowly dwindled, until they stopped entirely. Mr. Lapin was found dead several years later following a heart attack. His body had decomposed to skeletal remains…" diff --git a/src/faction.cpp b/src/faction.cpp index 7a8e691efc2d6..9f39dfa2433af 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -148,6 +148,15 @@ faction_template::faction_template( const JsonObject &jsobj ) jao.get_int( "power_max", std::numeric_limits::max() ), snippet_id( jao.get_string( "id", "epilogue_faction_default" ) ) ); } + for ( const JsonObject jao : jsobj.get_array( "dynamic_epilogues" ) ) { + dynamic_data.emplace( faction_id( jao.get_string( "fac1_id", "your_followers" ) ), + jao.get_bool( "power_strong_1", false ), + faction_id( jao.get_string( "fac2_id", "your_followers" ) ), + jao.get_bool( "power_strong_2", false ), + faction_id( jao.get_string( "fac3_id", "your_followers" ) ), + jao.get_bool( "power_strong_3", false ), + snippet_id( jao.get_string( "id", "epilogue_faction_dynamic_default" ) ) ); + } } std::string faction::describe() const @@ -167,6 +176,19 @@ std::vector faction::epilogue() const return ret; } +std::vector faction::dynamic() const +{ + std::vector ret; + for ( const std::tuple& dynamic_entry : dynamic_data ) { + if ( power >= 150 && ( std::get<0>( dynamic_entry )->power >= 150 && std::get<1>( dynamic_entry ) ) + && ( std::get<2>( dynamic_entry )->power >= 150 && std::get<3>( dynamic_entry ) ) + && ( std::get<4>( dynamic_entry )->power >= 150 && std::get<5>( dynamic_entry ) ) ) { + ret.emplace_back( std::get<6>( dynamic_entry )->translated() ); + } + } + return ret; +} + void faction::add_to_membership( const character_id &guy_id, const std::string &guy_name, const bool known ) { @@ -521,6 +543,7 @@ faction *faction_manager::get( const faction_id &id, const bool complain ) elem.second.desc = fac_temp.desc; elem.second.mon_faction = fac_temp.mon_faction; elem.second.epilogue_data = fac_temp.epilogue_data; + elem.second.dynamic_data = fac_temp.dynamic_data; for( const auto &rel_data : fac_temp.relations ) { if( elem.second.relations.find( rel_data.first ) == elem.second.relations.end() ) { elem.second.relations[rel_data.first] = rel_data.second; diff --git a/src/faction.h b/src/faction.h index 464918d46b379..46c5adff41755 100644 --- a/src/faction.h +++ b/src/faction.h @@ -121,6 +121,7 @@ class faction_template std::map> relations; mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human std::set> epilogue_data; + std::set> dynamic_data; //Epilogues resulting from interactions with other factions }; class faction : public faction_template @@ -135,6 +136,7 @@ class faction : public faction_template std::string describe() const; std::vector epilogue() const; + std::vector dynamic() const; std::string food_supply_text(); nc_color food_supply_color(); diff --git a/src/game.cpp b/src/game.cpp index 0c53bd851772f..7b147c0b3d3a8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3632,7 +3632,8 @@ void game::display_faction_epilogues() for( const auto &elem : faction_manager_ptr->all() ) { if( elem.second.known_by_u ) { const std::vector epilogue = elem.second.epilogue(); - if( !epilogue.empty() ) { + const std::vector dynamic = elem.second.dynamic(); + if( !epilogue.empty() && dynamic.empty() ) { const auto new_win = []() { return catacurses::newwin( FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, point( std::max( 0, ( TERMX - FULL_SCREEN_WIDTH ) / 2 ), @@ -3643,6 +3644,15 @@ void game::display_faction_epilogues() []( std::string lhs, const std::string & rhs ) -> std::string { return std::move( lhs ) + "\n" + rhs; } ) ); + } else if ( !dynamic.empty() && elem.second.power >= 150 ) { + for ( std::string fac : dynamic ) { + const auto new_win = []() { + return catacurses::newwin( FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, + point( std::max( 0, ( TERMX - FULL_SCREEN_WIDTH ) / 2 ), + std::max( 0, ( TERMY - FULL_SCREEN_HEIGHT ) / 2) ) ); + }; + scrollable_text( new_win, elem.second.name, fac + "\n" ); + } } } } From 646c2314098506d814aafe4586e5e3e1092a7140 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 16:37:06 -0400 Subject: [PATCH 02/59] dynamic epilogues update 1 --- data/json/npcs/factions.json | 52 ++++----- data/json/snippets/epilogue_factions.json | 8 +- src/faction.cpp | 34 ++---- src/faction.h | 4 +- src/game.cpp | 127 ++++++++++++++++++++-- src/game.h | 1 + 6 files changed, 148 insertions(+), 78 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 9f3a1c3a16446..5f15bfa3a01b5 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -77,14 +77,10 @@ "marloss": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" } - ], - "dynamic_epilogues": [ - { "fac1_id": "exodii", "power_strong_1": false, "fac2_id": "the_great_library", "power_strong_2": false, "id": "epilogue_faction_robofac_150" }, - { "fac1_id": "exodii", "power_strong_1": false, "fac2_id": "the_great_library", "power_strong_2": true, "id": "epilogue_faction_robofac_150" }, - { "fac1_id": "exodii", "power_strong_1": true, "fac2_id": "the_great_library", "power_strong_2": false, "id": "epilogue_faction_robofac_150" }, - { "fac1_id": "exodii", "power_strong_1": true, "fac2_id": "the_great_library", "power_strong_2": true, "id": "epilogue_faction_robofac_thrive" }, - { "fac1_id": "old_guard", "power_strong_1": true, "id": "epilogue_faction_robofac_OG" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, + { "dynamic": "0300000", "id": "epilogue_faction_robofac_150" }, + { "dynamic": "0100110", "id": "epilogue_faction_robofac_thrive" }, + { "dynamic": "1110110", "id": "epilogue_faction_robofac_thrive_OG" } ], "description": "The surviving staff of Hub 01, a pre-Cataclysm research lab. They rarely leave their lab, if at all, and rely on their robots and advanced technology to survive." }, @@ -147,13 +143,9 @@ "hells_raiders": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_old_guard_0" } - ], - "dynamic_epilogues": [ - { "fac1_id": "tacoma_commune", "power_strong_1": false, "fac2_id": "robofac", "power_strong_2": false, "id": "epilogue_faction_old_guard_thrive" }, - { "fac1_id": "tacoma_commune", "power_strong_1": false, "fac2_id": "robofac", "power_strong_2": true, "id": "epilogue_faction_old_guard_thrive" }, - { "fac1_id": "tacoma_commune", "power_strong_1": true, "fac2_id": "robofac", "power_strong_2": false, "id": "epilogue_faction_old_guard_thrive" }, - { "fac1_id": "tacoma_commune", "power_strong_1": true, "fac2_id": "robofac", "power_strong_2": true, "id": "epilogue_faction_old_guard_thrive" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_old_guard_0" }, + { "power_min": 150, "dynamic": "4000000", "id": "epilogue_faction_old_guard_150" }, + { "dynamic": "1110110", "id": "epilogue_faction_old_guard_thrive" } ], "description": "The remains of the federal government. The extent of their strength is unknown but squads of patrolling soldiers have been seen under their banner." }, @@ -328,13 +320,11 @@ } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" } - ], - "dynamic_epilogues": [ - { "fac1_id": "free_merchants", "power_strong_1": true, "id": "epilogue_faction_tacoma_commune_150" }, - { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": true, "id": "epilogue_tacoma_commune_FM_OG" }, - { "fac1_id": "free_merchants", "power_strong_1": false, "id": "epilogue_tacoma_commune_revolt" }, - { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": false, "id": "epilogue_tacoma_commune_OG" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" }, + { "dynamic": "0011000", "id": "epilogue_faction_tacoma_commune_150" }, + { "dynamic": "1111110", "id": "epilogue_faction_tacoma_commune_150_OG" }, + { "dynamic": "0012000", "id": "epilogue_faction_tacoma_commune_revolt" }, + { "dynamic": "1112110", "id": "epilogue_faction_tacoma_commune_revolt_OG" } ], "description": "An outpost started by the Free Merchants to provide a source of food and raw materials." }, @@ -472,11 +462,9 @@ "your_followers": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_hells_raiders_0" } - ], - "dynamic_epilogues": [ - { "fac1_id": "old_guard", "power_strong_1": false, "id": "epilogue_faction_hells_raiders_150" }, - { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "robofac", "power_strong_2": true, "fac3_id": "tacoma_commune", "power_strong_3": true, "id": "epilogue_faction_hells_raiders_collapse" } + { "dynamic": "4000002", "id": "epilogue_faction_hells_raiders_0" }, + { "dynamic": "4000001", "id": "epilogue_faction_hells_raiders_150" }, + { "dynamic": "3000000", "id": "epilogue_faction_hells_raiders_collapse" } ], "description": "The largest gang of hooligans and bandits that preys upon other survivors. Even if you have no gear, there is always a need for slaves and fresh meat." }, @@ -611,12 +599,10 @@ "hells_raiders": { "kill on sight": true } }, "epilogues": [ - { "power_min": 0, "power_max": 149, "id": "epilogue_faction_isherwoods_0" } - ], - "dynamic_epilogues": [ - { "fac1_id": "old_guard", "power_strong_1": false, "id": "epilogue_faction_isherwoods_150" }, - { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": true, "id": "epilogue_faction_isherwoods_OG_FM" }, - { "fac1_id": "old_guard", "power_strong_1": true, "fac2_id": "free_merchants", "power_strong_2": false, "fac3_id": "tacoma_commune", "power_strong_3": true, "id": "epilogue_faction_isherwoods_OG" } + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_isherwoods_0" }, + { "power_min": 150, "dynamic": "4000000", "id": "epilogue_faction_isherwoods_150" }, + { "power_min": 150, "dynamic": "1111110", "id": "epilogue_faction_isherwoods_OG_FM" }, + { "power_min": 150, "dynamic": "1112110", "id": "epilogue_faction_isherwoods_OG" } ], "description": "A small family surviving on their generational land." }, diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 342b953c21a3f..c5c337b8e5d2b 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -48,11 +48,11 @@ "text": " Through the years, the commune would continue to rapidly grow despite constant external threats. In a surprising twist then, the greatest threat would turn out to be an internal one. The collapse of the Free Merchant traders plunged the Commune's leadership into a period of significant infighting, and seeing an opportunity, the survivors of the Commune quickly moved to oust them. Afterwards, the settlement was re-organized under a democratically elected council and the resources of Tacoma were distributed by need and popular vote. The Commune would soon earn a reputation as a place where the struggles of the wasteland were shared, and where the horrors of the world were faced together." }, { - "id": "epilogue_faction_tacoma_commune_FM_OG", + "id": "epilogue_faction_tacoma_commune_150_OG", "text": " When the Old Guard came for their support, the Commune's leadership was happy to accept, though not without conditions. Lucrative contracts and the exclusive rights to inter-settlement trade routes made the Free Merchants virtual merchant royalty overnight. While many survivors would grumble, none could deny that wherever the Old Guard went, the Free Merchants would bring their prosperity with them, for a price of course." }, { - "id": "epilogue_faction_tacoma_commune_OG", + "id": "epilogue_faction_tacoma_commune_revolt_OG", "text": " When the Old Guard came for their support, the citizens of the Commune were extremely resistant to surrendering their autonomy to this 'new' power. However, the Old Guard, desperate to find footholds in the region, proved more amicable to their demands than they expected. In exchange for representation in the Provisional Congress on Nantucket island, and the Old Guard's support in organizing other settlements like Tacoma in their territory, the Tacoma Commune would surprise many by voting to join the new union. When asked for a comment on the vote, the First Speaker of the Tacoma Council simply said, 'out of many, one.'" }, { @@ -96,7 +96,7 @@ "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." }, { - "id": "epilogue_faction_robofac_OG", + "id": "epilogue_faction_robofac_thrive_OG", "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." }, { @@ -113,7 +113,7 @@ }, { "id": "epilogue_faction_isherwoods_OG", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. After the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to oversee a future settlement…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. After the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" }, { "id": "epilogue_faction_lapin_0", diff --git a/src/faction.cpp b/src/faction.cpp index 9f39dfa2433af..96e7b1a0eadf2 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -85,8 +85,8 @@ void faction_template::check_consistency() { for( const faction_template &fac : npc_factions::all_templates ) { for( const auto &epi : fac.epilogue_data ) { - if( !std::get<2>( epi ).is_valid() ) { - debugmsg( "There's no snippet with id %s", std::get<2>( epi ).str() ); + if( !std::get<3>( epi ).is_valid() ) { + debugmsg( "There's no snippet with id %s", std::get<3>( epi ).str() ); } } } @@ -146,17 +146,9 @@ faction_template::faction_template( const JsonObject &jsobj ) for( const JsonObject jao : jsobj.get_array( "epilogues" ) ) { epilogue_data.emplace( jao.get_int( "power_min", std::numeric_limits::min() ), jao.get_int( "power_max", std::numeric_limits::max() ), + jao.get_string( "dynamic", "0000000" ), // old_guard, robofac, tacoma_commune, free_merchants, exodii, great_library, hells_raiders; 0 - anything; 1 - power >= 150; 2 - power < 150; 3,4,... - specific dynamic faction endings snippet_id( jao.get_string( "id", "epilogue_faction_default" ) ) ); } - for ( const JsonObject jao : jsobj.get_array( "dynamic_epilogues" ) ) { - dynamic_data.emplace( faction_id( jao.get_string( "fac1_id", "your_followers" ) ), - jao.get_bool( "power_strong_1", false ), - faction_id( jao.get_string( "fac2_id", "your_followers" ) ), - jao.get_bool( "power_strong_2", false ), - faction_id( jao.get_string( "fac3_id", "your_followers" ) ), - jao.get_bool( "power_strong_3", false ), - snippet_id( jao.get_string( "id", "epilogue_faction_dynamic_default" ) ) ); - } } std::string faction::describe() const @@ -168,22 +160,11 @@ std::string faction::describe() const std::vector faction::epilogue() const { std::vector ret; - for( const std::tuple &epilogue_entry : epilogue_data ) { + for( const std::tuple &epilogue_entry : epilogue_data ) { if( power >= std::get<0>( epilogue_entry ) && power < std::get<1>( epilogue_entry ) ) { - ret.emplace_back( std::get<2>( epilogue_entry )->translated() ); - } - } - return ret; -} - -std::vector faction::dynamic() const -{ - std::vector ret; - for ( const std::tuple& dynamic_entry : dynamic_data ) { - if ( power >= 150 && ( std::get<0>( dynamic_entry )->power >= 150 && std::get<1>( dynamic_entry ) ) - && ( std::get<2>( dynamic_entry )->power >= 150 && std::get<3>( dynamic_entry ) ) - && ( std::get<4>( dynamic_entry )->power >= 150 && std::get<5>( dynamic_entry ) ) ) { - ret.emplace_back( std::get<6>( dynamic_entry )->translated() ); + if ( g->verify_dynamic_power( std::get<2>( epilogue_entry ) ) ) { + ret.emplace_back( std::get<3>( epilogue_entry )->translated() ); + } } } return ret; @@ -543,7 +524,6 @@ faction *faction_manager::get( const faction_id &id, const bool complain ) elem.second.desc = fac_temp.desc; elem.second.mon_faction = fac_temp.mon_faction; elem.second.epilogue_data = fac_temp.epilogue_data; - elem.second.dynamic_data = fac_temp.dynamic_data; for( const auto &rel_data : fac_temp.relations ) { if( elem.second.relations.find( rel_data.first ) == elem.second.relations.end() ) { elem.second.relations[rel_data.first] = rel_data.second; diff --git a/src/faction.h b/src/faction.h index 46c5adff41755..d95bc2fdd0670 100644 --- a/src/faction.h +++ b/src/faction.h @@ -120,8 +120,7 @@ class faction_template std::vector price_rules; // additional pricing rules std::map> relations; mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human - std::set> epilogue_data; - std::set> dynamic_data; //Epilogues resulting from interactions with other factions + std::set> epilogue_data; }; class faction : public faction_template @@ -136,7 +135,6 @@ class faction : public faction_template std::string describe() const; std::vector epilogue() const; - std::vector dynamic() const; std::string food_supply_text(); nc_color food_supply_color(); diff --git a/src/game.cpp b/src/game.cpp index 7b147c0b3d3a8..6630b4f70f7de 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,13 +3627,127 @@ void game::disp_NPC_epilogues() } } +bool game::verify_dynamic_power( std::string dyn ) { + for ( int i = 0; i < dyn.length(); i++ ) { + if ( i == 0 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 ) { + return false; + } + } + else if ( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? + if ( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "exodii") )->power < 150 ) { + return false; //If they didn't, then this doesn't apply + } + } + else if (dyn[i] == '4') { //Did the Old Guard fail to find enough powerful allies? + if (faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 + && faction_manager_ptr->get( faction_id( "robofac") )->power >= 150 + && faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 + && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 + && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { + return false; //If they did, then this doesn't apply + } + } + } + if ( i == 1 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { + return false; + } + } + else if ( dyn[i] == '3') { //Did Hub-01 fail to find a solution to their resource shortages? + if ( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 + && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 + && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { + return false; //If they did, then this doesn't apply + } + } + } + if ( i == 2 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 ) { + return false; + } + } + } + if ( i == 3 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power >= 150 ) { + return false; + } + } + } + if ( i == 4 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { + return false; + } + } + } + if ( i == 5 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 ) { + return false; + } + } + } + if ( i == 6 ) { + if ( dyn[i] == '1' ) { + if ( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power < 150 ) { + return false; + } + } + else if ( dyn[i] == '2' ) { + if ( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power >= 150 ) { + return false; + } + } + } + } + return true; +} + void game::display_faction_epilogues() { for( const auto &elem : faction_manager_ptr->all() ) { if( elem.second.known_by_u ) { const std::vector epilogue = elem.second.epilogue(); - const std::vector dynamic = elem.second.dynamic(); - if( !epilogue.empty() && dynamic.empty() ) { + if( !epilogue.empty() ) { const auto new_win = []() { return catacurses::newwin( FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, point( std::max( 0, ( TERMX - FULL_SCREEN_WIDTH ) / 2 ), @@ -3644,15 +3758,6 @@ void game::display_faction_epilogues() []( std::string lhs, const std::string & rhs ) -> std::string { return std::move( lhs ) + "\n" + rhs; } ) ); - } else if ( !dynamic.empty() && elem.second.power >= 150 ) { - for ( std::string fac : dynamic ) { - const auto new_win = []() { - return catacurses::newwin( FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, - point( std::max( 0, ( TERMX - FULL_SCREEN_WIDTH ) / 2 ), - std::max( 0, ( TERMY - FULL_SCREEN_HEIGHT ) / 2) ) ); - }; - scrollable_text( new_win, elem.second.name, fac + "\n" ); - } } } } diff --git a/src/game.h b/src/game.h index 75cd5e0ce0785..d23558c3d7437 100644 --- a/src/game.h +++ b/src/game.h @@ -1050,6 +1050,7 @@ class game void disp_NPCs(); // Currently for debug use. Lists global NPCs. void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) + bool verify_dynamic_power(std::string dyn); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From 1e72f14ddf5c2117cf6d528c02d37a7a565d85be Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 16:48:08 -0400 Subject: [PATCH 03/59] fixed Hub-01 "neutral" ending --- data/json/npcs/factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 5f15bfa3a01b5..30a0b612d6f39 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -78,7 +78,7 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, - { "dynamic": "0300000", "id": "epilogue_faction_robofac_150" }, + { "power_min": 150, "dynamic": "0300000", "id": "epilogue_faction_robofac_150" }, { "dynamic": "0100110", "id": "epilogue_faction_robofac_thrive" }, { "dynamic": "1110110", "id": "epilogue_faction_robofac_thrive_OG" } ], From 1d450205f53191bd5e934578e9c28d6f4b0d2618 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 17:39:27 -0400 Subject: [PATCH 04/59] Hells Raiders text update --- data/json/snippets/epilogue_factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index c5c337b8e5d2b..0ecac1f708938 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -81,7 +81,7 @@ }, { "id": "epilogue_faction_hells_raiders_collapse", - "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror finally beginning to fade like a bad dream." + "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." }, { "id": "epilogue_faction_robofac_0", From f6bb6c75c71121ca48feb59945d257fb2803da2f Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 17:45:53 -0400 Subject: [PATCH 05/59] format fix --- src/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.h b/src/game.h index d23558c3d7437..7ec3cbdb8d9d5 100644 --- a/src/game.h +++ b/src/game.h @@ -1050,7 +1050,7 @@ class game void disp_NPCs(); // Currently for debug use. Lists global NPCs. void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) - bool verify_dynamic_power(std::string dyn); //Checks to make sure the faction power requirements are met for dynamic endings + bool verify_dynamic_power( std::string dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From 2830240ccc1cf517fcd50c1a79ecbbab6a2aa4ae Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 18:30:58 -0400 Subject: [PATCH 06/59] added free merchant ending --- data/json/npcs/factions.json | 3 ++- data/json/snippets/epilogue_factions.json | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 30a0b612d6f39..1bb0702bbe1bc 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -231,7 +231,8 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_free_merchants_0" }, - { "power_min": 150, "id": "epilogue_faction_free_merchants_150" } + { "power_min": 150, "id": "epilogue_faction_free_merchants_150" }, + { "dynamic": "1111110", "id": "epilogue_faction_free_merchants_thrive" } ], "description": "A conglomeration of entrepreneurs and businessmen that stand together to hammer-out an existence through trade and industry." }, diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 0ecac1f708938..4619626ba0770 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -35,6 +35,10 @@ "id": "epilogue_faction_free_merchants_150", "text": " The Free Merchants struggled for years to keep themselves fed but their once profitable trade routes were plundered by bandits and thugs. In squalor and filth the first generations born after the Cataclysm are told stories of the old days when food was abundant and the children were allowed to play in the sun…" }, + { + "id": "epilogue_faction_free_merchants_thrive", + "text": " With the success of Tacoma and the return of the Old Guard, the Free Merchants were able to expand their reach throughout the region. In every settlement they had a partner, and in every venture they had a stake. In the safety of their gilded compounds, food was abundant, and the first children born after the Cataclysm were free to play in the sun…" + }, { "id": "epilogue_faction_tacoma_commune_0", "text": " The fledgling outpost was abandoned a few months later. The external threats combined with low crop yields caused the Free Merchants to withdraw their support. When the exhausted migrants returned to the refugee center they were turned away to face the world on their own." From 4ffe243be2ed2d0e161ffd1bd24fb68b786a9468 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 18:38:18 -0400 Subject: [PATCH 07/59] format fixes --- data/json/snippets/epilogue_factions.json | 5 +- src/faction.cpp | 7 +- src/game.cpp | 97 ++++++++++------------- 3 files changed, 49 insertions(+), 60 deletions(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 4619626ba0770..f00bb4ea41825 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -7,10 +7,7 @@ "id": "epilogue_faction_default", "text": " You and everyone who followed you are forgotten among the billions lost in the Cataclysm…" }, - { - "id": "epilogue_faction_dynamic_default", - "text": " " - }, + { "id": "epilogue_faction_dynamic_default", "text": " " }, { "id": "epilogue_faction_your_followers_0", "text": " You and everyone who followed you are forgotten among the billions lost in the Cataclysm…" diff --git a/src/faction.cpp b/src/faction.cpp index 96e7b1a0eadf2..7460e5167d8b1 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -146,7 +146,8 @@ faction_template::faction_template( const JsonObject &jsobj ) for( const JsonObject jao : jsobj.get_array( "epilogues" ) ) { epilogue_data.emplace( jao.get_int( "power_min", std::numeric_limits::min() ), jao.get_int( "power_max", std::numeric_limits::max() ), - jao.get_string( "dynamic", "0000000" ), // old_guard, robofac, tacoma_commune, free_merchants, exodii, great_library, hells_raiders; 0 - anything; 1 - power >= 150; 2 - power < 150; 3,4,... - specific dynamic faction endings + jao.get_string( "dynamic", + "0000000" ), // old_guard, robofac, tacoma_commune, free_merchants, exodii, great_library, hells_raiders; 0 - anything; 1 - power >= 150; 2 - power < 150; 3,4,... - specific dynamic faction endings snippet_id( jao.get_string( "id", "epilogue_faction_default" ) ) ); } } @@ -162,8 +163,8 @@ std::vector faction::epilogue() const std::vector ret; for( const std::tuple &epilogue_entry : epilogue_data ) { if( power >= std::get<0>( epilogue_entry ) && power < std::get<1>( epilogue_entry ) ) { - if ( g->verify_dynamic_power( std::get<2>( epilogue_entry ) ) ) { - ret.emplace_back( std::get<3>( epilogue_entry )->translated() ); + if( g->verify_dynamic_power( std::get<2>( epilogue_entry ) ) ) { + ret.emplace_back( std::get<3>( epilogue_entry )->translated() ); } } } diff --git a/src/game.cpp b/src/game.cpp index 6630b4f70f7de..a2a2082565dde 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,30 +3627,28 @@ void game::disp_NPC_epilogues() } } -bool game::verify_dynamic_power( std::string dyn ) { - for ( int i = 0; i < dyn.length(); i++ ) { - if ( i == 0 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { +bool game::verify_dynamic_power( std::string dyn ) +{ + for( int i = 0; i < dyn.length(); i++ ) { + if( i == 0 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 ) { return false; } - } - else if ( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? - if ( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 + } else if( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? + if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 || faction_manager_ptr->get( faction_id( "exodii") )->power < 150 ) { return false; //If they didn't, then this doesn't apply } - } - else if (dyn[i] == '4') { //Did the Old Guard fail to find enough powerful allies? - if (faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 + } else if(dyn[i] == '4') { //Did the Old Guard fail to find enough powerful allies? + if(faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "robofac") )->power >= 150 && faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 @@ -3659,81 +3657,74 @@ bool game::verify_dynamic_power( std::string dyn ) { } } } - if ( i == 1 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 ) { + if( i == 1 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { return false; } - } - else if ( dyn[i] == '3') { //Did Hub-01 fail to find a solution to their resource shortages? - if ( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 + } else if( dyn[i] == '3') { //Did Hub-01 fail to find a solution to their resource shortages? + if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { return false; //If they did, then this doesn't apply } } } - if ( i == 2 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 ) { + if( i == 2 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 ) { return false; } } } - if ( i == 3 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power < 150 ) { + if( i == 3 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power >= 150 ) { return false; } } } - if ( i == 4 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { + if( i == 4 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { return false; } } } - if ( i == 5 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 ) { + if( i == 5 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 ) { return false; } } } - if ( i == 6 ) { - if ( dyn[i] == '1' ) { - if ( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power < 150 ) { + if( i == 6 ) { + if( dyn[i] == '1' ) { + if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power < 150 ) { return false; } - } - else if ( dyn[i] == '2' ) { - if ( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power >= 150 ) { + } else if( dyn[i] == '2' ) { + if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power >= 150 ) { return false; } } From cf53bfe119db7b999f37180d9c548433a4c9a95a Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 18:40:08 -0400 Subject: [PATCH 08/59] correct CLRF type in game.h --- src/game.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game.h b/src/game.h index 7ec3cbdb8d9d5..6ca97eda23929 100644 --- a/src/game.h +++ b/src/game.h @@ -1050,7 +1050,8 @@ class game void disp_NPCs(); // Currently for debug use. Lists global NPCs. void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) - bool verify_dynamic_power( std::string dyn ); //Checks to make sure the faction power requirements are met for dynamic endings + bool verify_dynamic_power( std::string + dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From e2ae88c426df87e235c9342c11b00731f7f89b92 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 18:52:37 -0400 Subject: [PATCH 09/59] Isherwood text update --- data/json/snippets/epilogue_factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index f00bb4ea41825..5c50ebea5d7a1 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -114,7 +114,7 @@ }, { "id": "epilogue_faction_isherwoods_OG", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. After the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" }, { "id": "epilogue_faction_lapin_0", From 41dd8b7f3598c966e89009c70ee95049193dd9c2 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sun, 26 May 2024 18:54:30 -0400 Subject: [PATCH 10/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index 7460e5167d8b1..75612bcc55d1c 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -146,7 +146,7 @@ faction_template::faction_template( const JsonObject &jsobj ) for( const JsonObject jao : jsobj.get_array( "epilogues" ) ) { epilogue_data.emplace( jao.get_int( "power_min", std::numeric_limits::min() ), jao.get_int( "power_max", std::numeric_limits::max() ), - jao.get_string( "dynamic", + jao.get_string( "dynamic", "0000000" ), // old_guard, robofac, tacoma_commune, free_merchants, exodii, great_library, hells_raiders; 0 - anything; 1 - power >= 150; 2 - power < 150; 3,4,... - specific dynamic faction endings snippet_id( jao.get_string( "id", "epilogue_faction_default" ) ) ); } From b03ae2814af60aefa41b34a929e0fb4811f582fb Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sun, 26 May 2024 18:54:36 -0400 Subject: [PATCH 11/59] Update src/game.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index a2a2082565dde..de235d6a0e2a7 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,7 +3627,7 @@ void game::disp_NPC_epilogues() } } -bool game::verify_dynamic_power( std::string dyn ) +bool game::verify_dynamic_power( std::string dyn ) { for( int i = 0; i < dyn.length(); i++ ) { if( i == 0 ) { From 6ff7e201ef2937f71c9b117b3e4bf84d50db1702 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sun, 26 May 2024 18:54:41 -0400 Subject: [PATCH 12/59] Update src/game.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index de235d6a0e2a7..c8904d84183df 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3666,7 +3666,7 @@ bool game::verify_dynamic_power( std::string dyn ) if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { return false; } - } else if( dyn[i] == '3') { //Did Hub-01 fail to find a solution to their resource shortages? + } else if( dyn[i] == '3' ) { //Did Hub-01 fail to find a solution to their resource shortages? if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { From ebeb5948fb1f077f2dc38c81a1e22b95c79c87d1 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sun, 26 May 2024 18:54:50 -0400 Subject: [PATCH 13/59] Update src/game.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/game.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index c8904d84183df..87c06c57f57f3 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3640,11 +3640,11 @@ bool game::verify_dynamic_power( std::string dyn ) return false; } } else if( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? - if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "exodii") )->power < 150 ) { + if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 + || faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { return false; //If they didn't, then this doesn't apply } } else if(dyn[i] == '4') { //Did the Old Guard fail to find enough powerful allies? From 73618eab0b4a3714daa24de847fe1ef66250c19d Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sun, 26 May 2024 18:54:57 -0400 Subject: [PATCH 14/59] Update src/game.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/game.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 87c06c57f57f3..704664b52948e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3647,9 +3647,9 @@ bool game::verify_dynamic_power( std::string dyn ) || faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { return false; //If they didn't, then this doesn't apply } - } else if(dyn[i] == '4') { //Did the Old Guard fail to find enough powerful allies? - if(faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "robofac") )->power >= 150 + } else if( dyn[i] == '4' ) { //Did the Old Guard fail to find enough powerful allies? + if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 + && faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { From 7c5c47edf507d5b85909fb0c5aa4b5f80cbcfb67 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sun, 26 May 2024 18:55:03 -0400 Subject: [PATCH 15/59] Update src/game.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.h b/src/game.h index 6ca97eda23929..8764ac1eb820d 100644 --- a/src/game.h +++ b/src/game.h @@ -1050,7 +1050,7 @@ class game void disp_NPCs(); // Currently for debug use. Lists global NPCs. void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) - bool verify_dynamic_power( std::string + bool verify_dynamic_power( std::string dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related From 58ac75f16ae13b41b7e76126ab7884ba683a8f76 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 19:41:15 -0400 Subject: [PATCH 16/59] fix integer variables --- src/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index 704664b52948e..c21e29d2b7a5c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3629,7 +3629,7 @@ void game::disp_NPC_epilogues() bool game::verify_dynamic_power( std::string dyn ) { - for( int i = 0; i < dyn.length(); i++ ) { + for( char i = 0; i < dyn.length(); i++ ) { if( i == 0 ) { if( dyn[i] == '1' ) { if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { From 9eb05b3a1f26f18bb36912921ae92081431552e4 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 19:59:24 -0400 Subject: [PATCH 17/59] char update --- src/game.cpp | 4 ++-- src/game.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index c21e29d2b7a5c..18126b893c86e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,9 +3627,9 @@ void game::disp_NPC_epilogues() } } -bool game::verify_dynamic_power( std::string dyn ) +bool game::verify_dynamic_power( std::string &dyn ) { - for( char i = 0; i < dyn.length(); i++ ) { + for( int i = 0; i < dyn.length(); i++ ) { if( i == 0 ) { if( dyn[i] == '1' ) { if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { diff --git a/src/game.h b/src/game.h index 8764ac1eb820d..eda981623cefa 100644 --- a/src/game.h +++ b/src/game.h @@ -1051,7 +1051,7 @@ class game void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) bool verify_dynamic_power( std::string - dyn ); //Checks to make sure the faction power requirements are met for dynamic endings + &dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From 36724713e6ed88099bb0cc89e2cab484db10f1a8 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Sun, 26 May 2024 20:05:10 -0400 Subject: [PATCH 18/59] char fix --- src/game.cpp | 4 ++-- src/game.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 18126b893c86e..11a4e8cf4b2f5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,9 +3627,9 @@ void game::disp_NPC_epilogues() } } -bool game::verify_dynamic_power( std::string &dyn ) +bool game::verify_dynamic_power( std::string dyn ) { - for( int i = 0; i < dyn.length(); i++ ) { + for( std::string::size_type i = 0; i < dyn.size(); i++ ) { if( i == 0 ) { if( dyn[i] == '1' ) { if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { diff --git a/src/game.h b/src/game.h index eda981623cefa..8764ac1eb820d 100644 --- a/src/game.h +++ b/src/game.h @@ -1051,7 +1051,7 @@ class game void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) bool verify_dynamic_power( std::string - &dyn ); //Checks to make sure the faction power requirements are met for dynamic endings + dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From 841504470d9551c6f5bc0a1ab7ffc88a6e10f8da Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Mon, 27 May 2024 13:00:57 -0400 Subject: [PATCH 19/59] Update epilogue_factions.json --- data/json/snippets/epilogue_factions.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 5c50ebea5d7a1..2c15238ef7cd0 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -22,7 +22,7 @@ }, { "id": "epilogue_faction_old_guard_thrive", - "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag. In the coming decades, the Old Guard were able to reconnect much of New England and beyond, their dreams for the future buoyed by the memory of the past." + "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag. In the coming decades, the Old Guard were able to reconnect much of New England and beyond, their dreams for the future buoyed by the memory of the past." }, { "id": "epilogue_faction_free_merchants_0", @@ -34,7 +34,7 @@ }, { "id": "epilogue_faction_free_merchants_thrive", - "text": " With the success of Tacoma and the return of the Old Guard, the Free Merchants were able to expand their reach throughout the region. In every settlement they had a partner, and in every venture they had a stake. In the safety of their gilded compounds, food was abundant, and the first children born after the Cataclysm were free to play in the sun…" + "text": " With the success of Tacoma and the return of the Old Guard, the Free Merchants were able to expand their reach throughout the region. In every settlement they had a partner, and in every venture they had a stake. In the safety of their gilded compounds, food was abundant, and the first children born after the Cataclysm were free to play in the sun…" }, { "id": "epilogue_faction_tacoma_commune_0", @@ -46,15 +46,15 @@ }, { "id": "epilogue_faction_tacoma_commune_revolt", - "text": " Through the years, the commune would continue to rapidly grow despite constant external threats. In a surprising twist then, the greatest threat would turn out to be an internal one. The collapse of the Free Merchant traders plunged the Commune's leadership into a period of significant infighting, and seeing an opportunity, the survivors of the Commune quickly moved to oust them. Afterwards, the settlement was re-organized under a democratically elected council and the resources of Tacoma were distributed by need and popular vote. The Commune would soon earn a reputation as a place where the struggles of the wasteland were shared, and where the horrors of the world were faced together." + "text": " Through the years, the commune would continue to rapidly grow despite constant external threats. In a surprising twist then, the greatest threat would turn out to be an internal one. The collapse of the Free Merchant traders plunged the Commune's leadership into a period of significant infighting, and seeing an opportunity, the survivors of the Commune quickly moved to oust them. Afterwards, the settlement was re-organized under a democratically elected council and the resources of Tacoma were distributed by need and popular vote. The Commune would soon earn a reputation as a place where the struggles of the wasteland were shared, and where the horrors of the world were faced together." }, { "id": "epilogue_faction_tacoma_commune_150_OG", - "text": " When the Old Guard came for their support, the Commune's leadership was happy to accept, though not without conditions. Lucrative contracts and the exclusive rights to inter-settlement trade routes made the Free Merchants virtual merchant royalty overnight. While many survivors would grumble, none could deny that wherever the Old Guard went, the Free Merchants would bring their prosperity with them, for a price of course." + "text": " When the Old Guard came for their support, the Commune's leadership was happy to accept, though not without conditions. Lucrative contracts and the exclusive rights to inter-settlement trade routes made the Free Merchants virtual merchant royalty overnight. While many survivors would grumble, none could deny that wherever the Old Guard went, the Free Merchants would bring their prosperity with them, for a price of course." }, { "id": "epilogue_faction_tacoma_commune_revolt_OG", - "text": " When the Old Guard came for their support, the citizens of the Commune were extremely resistant to surrendering their autonomy to this 'new' power. However, the Old Guard, desperate to find footholds in the region, proved more amicable to their demands than they expected. In exchange for representation in the Provisional Congress on Nantucket island, and the Old Guard's support in organizing other settlements like Tacoma in their territory, the Tacoma Commune would surprise many by voting to join the new union. When asked for a comment on the vote, the First Speaker of the Tacoma Council simply said, 'out of many, one.'" + "text": " When the Old Guard came for their support, the citizens of the Commune were extremely resistant to surrendering their autonomy to this 'new' power. However, the Old Guard, desperate to find footholds in the region, proved more amicable to their demands than they expected. In exchange for representation in the Provisional Congress on Nantucket island, and the Old Guard's support in organizing other settlements like Tacoma in their territory, the Tacoma Commune would surprise many by voting to join the new union. When asked for a comment on the vote, the First Speaker of the Tacoma Council simply said, 'out of many, one.'" }, { "id": "epilogue_faction_isolated_road_0", @@ -82,7 +82,7 @@ }, { "id": "epilogue_faction_hells_raiders_collapse", - "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." + "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." }, { "id": "epilogue_faction_robofac_0", @@ -94,11 +94,11 @@ }, { "id": "epilogue_faction_robofac_thrive", - "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." + "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." }, { "id": "epilogue_faction_robofac_thrive_OG", - "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." + "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." }, { "id": "epilogue_faction_isherwoods_0", @@ -110,11 +110,11 @@ }, { "id": "epilogue_faction_isherwoods_OG_FM", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. With the Isherwoods forced from their home, the farm was quickly purchased by the Free Merchants and converted into a very profitable plantation…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. With the Isherwoods forced from their home, the farm was quickly purchased by the Free Merchants and converted into a very profitable plantation…" }, { "id": "epilogue_faction_isherwoods_OG", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" }, { "id": "epilogue_faction_lapin_0", From 364dda4417e633ff1e8c0cbe4db1a93ec2499ed8 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Tue, 28 May 2024 17:33:54 -0400 Subject: [PATCH 20/59] updates --- data/json/npcs/factions.json | 6 +- data/json/snippets/epilogue_factions.json | 20 +-- src/faction.cpp | 48 +++-- src/faction.h | 100 ++++++++--- src/game.cpp | 210 +++++++++++----------- src/game.h | 4 +- 6 files changed, 227 insertions(+), 161 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 1bb0702bbe1bc..cba435288f364 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -78,9 +78,9 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, - { "power_min": 150, "dynamic": "0300000", "id": "epilogue_faction_robofac_150" }, - { "dynamic": "0100110", "id": "epilogue_faction_robofac_thrive" }, - { "dynamic": "1110110", "id": "epilogue_faction_robofac_thrive_OG" } + { "dynamic": { "and": [ { "faction": "robofac", "power_min": 150 }, { "not": { "and": [ { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] } } ] }, "id": "epilogue_faction_robofac_150" }, + { "dynamic": { "and": [ { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] }, "id": "epilogue_faction_robofac_thrive" }, + { "dynamic": { "and": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] }, "id": "epilogue_faction_robofac_thrive_OG" } ], "description": "The surviving staff of Hub 01, a pre-Cataclysm research lab. They rarely leave their lab, if at all, and rely on their robots and advanced technology to survive." }, diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 5c50ebea5d7a1..2c15238ef7cd0 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -22,7 +22,7 @@ }, { "id": "epilogue_faction_old_guard_thrive", - "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag. In the coming decades, the Old Guard were able to reconnect much of New England and beyond, their dreams for the future buoyed by the memory of the past." + "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag. In the coming decades, the Old Guard were able to reconnect much of New England and beyond, their dreams for the future buoyed by the memory of the past." }, { "id": "epilogue_faction_free_merchants_0", @@ -34,7 +34,7 @@ }, { "id": "epilogue_faction_free_merchants_thrive", - "text": " With the success of Tacoma and the return of the Old Guard, the Free Merchants were able to expand their reach throughout the region. In every settlement they had a partner, and in every venture they had a stake. In the safety of their gilded compounds, food was abundant, and the first children born after the Cataclysm were free to play in the sun…" + "text": " With the success of Tacoma and the return of the Old Guard, the Free Merchants were able to expand their reach throughout the region. In every settlement they had a partner, and in every venture they had a stake. In the safety of their gilded compounds, food was abundant, and the first children born after the Cataclysm were free to play in the sun…" }, { "id": "epilogue_faction_tacoma_commune_0", @@ -46,15 +46,15 @@ }, { "id": "epilogue_faction_tacoma_commune_revolt", - "text": " Through the years, the commune would continue to rapidly grow despite constant external threats. In a surprising twist then, the greatest threat would turn out to be an internal one. The collapse of the Free Merchant traders plunged the Commune's leadership into a period of significant infighting, and seeing an opportunity, the survivors of the Commune quickly moved to oust them. Afterwards, the settlement was re-organized under a democratically elected council and the resources of Tacoma were distributed by need and popular vote. The Commune would soon earn a reputation as a place where the struggles of the wasteland were shared, and where the horrors of the world were faced together." + "text": " Through the years, the commune would continue to rapidly grow despite constant external threats. In a surprising twist then, the greatest threat would turn out to be an internal one. The collapse of the Free Merchant traders plunged the Commune's leadership into a period of significant infighting, and seeing an opportunity, the survivors of the Commune quickly moved to oust them. Afterwards, the settlement was re-organized under a democratically elected council and the resources of Tacoma were distributed by need and popular vote. The Commune would soon earn a reputation as a place where the struggles of the wasteland were shared, and where the horrors of the world were faced together." }, { "id": "epilogue_faction_tacoma_commune_150_OG", - "text": " When the Old Guard came for their support, the Commune's leadership was happy to accept, though not without conditions. Lucrative contracts and the exclusive rights to inter-settlement trade routes made the Free Merchants virtual merchant royalty overnight. While many survivors would grumble, none could deny that wherever the Old Guard went, the Free Merchants would bring their prosperity with them, for a price of course." + "text": " When the Old Guard came for their support, the Commune's leadership was happy to accept, though not without conditions. Lucrative contracts and the exclusive rights to inter-settlement trade routes made the Free Merchants virtual merchant royalty overnight. While many survivors would grumble, none could deny that wherever the Old Guard went, the Free Merchants would bring their prosperity with them, for a price of course." }, { "id": "epilogue_faction_tacoma_commune_revolt_OG", - "text": " When the Old Guard came for their support, the citizens of the Commune were extremely resistant to surrendering their autonomy to this 'new' power. However, the Old Guard, desperate to find footholds in the region, proved more amicable to their demands than they expected. In exchange for representation in the Provisional Congress on Nantucket island, and the Old Guard's support in organizing other settlements like Tacoma in their territory, the Tacoma Commune would surprise many by voting to join the new union. When asked for a comment on the vote, the First Speaker of the Tacoma Council simply said, 'out of many, one.'" + "text": " When the Old Guard came for their support, the citizens of the Commune were extremely resistant to surrendering their autonomy to this 'new' power. However, the Old Guard, desperate to find footholds in the region, proved more amicable to their demands than they expected. In exchange for representation in the Provisional Congress on Nantucket island, and the Old Guard's support in organizing other settlements like Tacoma in their territory, the Tacoma Commune would surprise many by voting to join the new union. When asked for a comment on the vote, the First Speaker of the Tacoma Council simply said, 'out of many, one.'" }, { "id": "epilogue_faction_isolated_road_0", @@ -82,7 +82,7 @@ }, { "id": "epilogue_faction_hells_raiders_collapse", - "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." + "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." }, { "id": "epilogue_faction_robofac_0", @@ -94,11 +94,11 @@ }, { "id": "epilogue_faction_robofac_thrive", - "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." + "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." }, { "id": "epilogue_faction_robofac_thrive_OG", - "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." + "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." }, { "id": "epilogue_faction_isherwoods_0", @@ -110,11 +110,11 @@ }, { "id": "epilogue_faction_isherwoods_OG_FM", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. With the Isherwoods forced from their home, the farm was quickly purchased by the Free Merchants and converted into a very profitable plantation…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. With the Isherwoods forced from their home, the farm was quickly purchased by the Free Merchants and converted into a very profitable plantation…" }, { "id": "epilogue_faction_isherwoods_OG", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" }, { "id": "epilogue_faction_lapin_0", diff --git a/src/faction.cpp b/src/faction.cpp index 75612bcc55d1c..bb86252425f43 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -85,8 +85,8 @@ void faction_template::check_consistency() { for( const faction_template &fac : npc_factions::all_templates ) { for( const auto &epi : fac.epilogue_data ) { - if( !std::get<3>( epi ).is_valid() ) { - debugmsg( "There's no snippet with id %s", std::get<3>( epi ).str() ); + if( !epi.epilogue.is_valid() ) { + debugmsg( "There's no snippet with id %s", epi.epilogue.str() ); } } } @@ -143,13 +143,7 @@ faction_template::faction_template( const JsonObject &jsobj ) lone_wolf_faction = jsobj.get_bool( "lone_wolf_faction", false ); load_relations( jsobj ); mon_faction = mfaction_str_id( jsobj.get_string( "mon_faction", "human" ) ); - for( const JsonObject jao : jsobj.get_array( "epilogues" ) ) { - epilogue_data.emplace( jao.get_int( "power_min", std::numeric_limits::min() ), - jao.get_int( "power_max", std::numeric_limits::max() ), - jao.get_string( "dynamic", - "0000000" ), // old_guard, robofac, tacoma_commune, free_merchants, exodii, great_library, hells_raiders; 0 - anything; 1 - power >= 150; 2 - power < 150; 3,4,... - specific dynamic faction endings - snippet_id( jao.get_string( "id", "epilogue_faction_default" ) ) ); - } + optional( jsobj, false, "epilogues", epilogue_data ); } std::string faction::describe() const @@ -158,13 +152,41 @@ std::string faction::describe() const return ret; } + +//bool faction::check_relations( std::optional> jo ) const +//{ +// for( auto it = jo->cbegin(), next_it = it; it != jo->cend(); it = next_it ) { +// if( it->power_min.has_value() && it->faction->power < it->power_min.value() ) { +// return false; +// } +// else if( it->power_max.has_value() && it->faction->power >= it->power_max.value() ) { +// return false; +// } +// } +// return true; +//} + +bool faction::check_relations(const std::vector faction_power_specs) const +{ + if (!faction_power_specs.empty()) { + for (const faction_power_spec& spec : faction_power_specs) { + if ((!!spec.power_min && spec.faction->power < spec.power_min.value()) || (!!spec.power_max && spec.faction->power >= spec.power_max.value())) { + return false; + } + } + } + return true; +} + std::vector faction::epilogue() const { std::vector ret; - for( const std::tuple &epilogue_entry : epilogue_data ) { - if( power >= std::get<0>( epilogue_entry ) && power < std::get<1>( epilogue_entry ) ) { - if( g->verify_dynamic_power( std::get<2>( epilogue_entry ) ) ) { - ret.emplace_back( std::get<3>( epilogue_entry )->translated() ); + for( auto it = epilogue_data.cbegin(), next_it = it; it != epilogue_data.cend(); it = next_it ) { + if( power >= it->power_min && power < it->power_max ) { + if( !it->dynamic_conditions.empty() ) { + if( check_relations( it->dynamic_conditions ) ) { + ret.emplace_back( it->epilogue->translated() ); + } } } } diff --git a/src/faction.h b/src/faction.h index d95bc2fdd0670..7b4dbfbd94e73 100644 --- a/src/faction.h +++ b/src/faction.h @@ -90,37 +90,79 @@ class faction_price_rules_reader : public generic_typed_reader power_min; + std::optional power_max; - private: - explicit faction_template( const JsonObject &jsobj ); + void deserialize( const JsonObject& jo ); +}; - public: - static void load( const JsonObject &jsobj ); - static void check_consistency(); - static void reset(); - - std::string name; - int likes_u; - int respects_u; - int trusts_u; // Determines which item groups are available for trading - bool known_by_u; - faction_id id; - translation desc; - int size; // How big is our sphere of influence? - int power; // General measure of our power - nutrients food_supply; //Total nutritional value held - int wealth; //Total trade currency - bool lone_wolf_faction; // is this a faction for just one person? - itype_id currency; // id of the faction currency - std::vector price_rules; // additional pricing rules - std::map> relations; - mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human - std::set> epilogue_data; +void faction_power_spec::deserialize( const JsonObject& jo ) +{ + mandatory( jo, false, "faction", faction ); // from generic_factory.h + optional( jo, false, "power_min", power_min ); + optional( jo, false, "power_max", power_max ); + + if ( !power_min.has_value() && !power_max.has_value() ) { + jo.throw_error("must have either a power_min or a power_max"); + } +} + +struct faction_epilogue_data +{ + int power_min; + int power_max; + + std::vector dynamic_conditions; + + snippet_id epilogue; + + void deserialize( const JsonObject &jo ); +}; + +void faction_epilogue_data::deserialize( const JsonObject &jo ) +{ + optional(jo, false, "power_min", power_min); + optional(jo, false, "power_max", power_max); + optional(jo, false, "dynamic", dynamic_conditions); + mandatory(jo, false, "faction", epilogue); +} + +class faction_template +{ +protected: + faction_template(); + void load_relations(const JsonObject& jsobj); + +private: + explicit faction_template(const JsonObject& jsobj); + + +public: + static void load(const JsonObject& jsobj); + static void check_consistency(); + static void reset(); + + std::string name; + int likes_u; + int respects_u; + int trusts_u; // Determines which item groups are available for trading + bool known_by_u; + faction_id id; + translation desc; + int size; // How big is our sphere of influence? + int power; // General measure of our power + nutrients food_supply; //Total nutritional value held + int wealth; //Total trade currency + bool lone_wolf_faction; // is this a faction for just one person? + itype_id currency; // id of the faction currency + std::vector price_rules; // additional pricing rules + std::map> relations; + mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human + std::set epilogue_data; }; class faction : public faction_template @@ -133,7 +175,9 @@ class faction : public faction_template void serialize( JsonOut &json ) const; void faction_display( const catacurses::window &fac_w, int width ) const; + std::string describe() const; + bool check_relations(std::vector jo) const; std::vector epilogue() const; std::string food_supply_text(); diff --git a/src/game.cpp b/src/game.cpp index 11a4e8cf4b2f5..b3be19f5b4cfb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,111 +3627,111 @@ void game::disp_NPC_epilogues() } } -bool game::verify_dynamic_power( std::string dyn ) -{ - for( std::string::size_type i = 0; i < dyn.size(); i++ ) { - if( i == 0 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 ) { - return false; - } - } else if( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? - if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 - || faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { - return false; //If they didn't, then this doesn't apply - } - } else if( dyn[i] == '4' ) { //Did the Old Guard fail to find enough powerful allies? - if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { - return false; //If they did, then this doesn't apply - } - } - } - if( i == 1 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { - return false; - } - } else if( dyn[i] == '3' ) { //Did Hub-01 fail to find a solution to their resource shortages? - if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 - && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { - return false; //If they did, then this doesn't apply - } - } - } - if( i == 2 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 ) { - return false; - } - } - } - if( i == 3 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power >= 150 ) { - return false; - } - } - } - if( i == 4 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { - return false; - } - } - } - if( i == 5 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 ) { - return false; - } - } - } - if( i == 6 ) { - if( dyn[i] == '1' ) { - if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power < 150 ) { - return false; - } - } else if( dyn[i] == '2' ) { - if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power >= 150 ) { - return false; - } - } - } - } - return true; -} +//bool game::verify_dynamic_power( std::string dyn ) +//{ +// for( std::string::size_type i = 0; i < dyn.size(); i++ ) { +// if( i == 0 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 ) { +// return false; +// } +// } else if( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? +// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 +// || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 +// || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 +// || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 +// || faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { +// return false; //If they didn't, then this doesn't apply +// } +// } else if( dyn[i] == '4' ) { //Did the Old Guard fail to find enough powerful allies? +// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 +// && faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 +// && faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 +// && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 +// && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { +// return false; //If they did, then this doesn't apply +// } +// } +// } +// if( i == 1 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { +// return false; +// } +// } else if( dyn[i] == '3' ) { //Did Hub-01 fail to find a solution to their resource shortages? +// if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 +// && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 +// && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { +// return false; //If they did, then this doesn't apply +// } +// } +// } +// if( i == 2 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 ) { +// return false; +// } +// } +// } +// if( i == 3 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power >= 150 ) { +// return false; +// } +// } +// } +// if( i == 4 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { +// return false; +// } +// } +// } +// if( i == 5 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 ) { +// return false; +// } +// } +// } +// if( i == 6 ) { +// if( dyn[i] == '1' ) { +// if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power < 150 ) { +// return false; +// } +// } else if( dyn[i] == '2' ) { +// if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power >= 150 ) { +// return false; +// } +// } +// } +// } +// return true; +//} void game::display_faction_epilogues() { diff --git a/src/game.h b/src/game.h index 8764ac1eb820d..9c6fedf5a1e6e 100644 --- a/src/game.h +++ b/src/game.h @@ -1050,8 +1050,8 @@ class game void disp_NPCs(); // Currently for debug use. Lists global NPCs. void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) - bool verify_dynamic_power( std::string - dyn ); //Checks to make sure the faction power requirements are met for dynamic endings + //bool verify_dynamic_power( std::string + //dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From d24b52750534d346ba34bab2dd2c1170ebce4cc2 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Tue, 28 May 2024 18:52:17 -0400 Subject: [PATCH 21/59] fix for faction.cpp and faction.h --- src/faction.cpp | 18 ++++++++++++++++++ src/faction.h | 19 +------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index bb86252425f43..e3ff59953b7f2 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -152,6 +152,24 @@ std::string faction::describe() const return ret; } +void faction_power_spec::deserialize(const JsonObject& jo) +{ + mandatory(jo, false, "faction", faction); // from generic_factory.h + optional(jo, false, "power_min", power_min); + optional(jo, false, "power_max", power_max); + + if (!power_min.has_value() && !power_max.has_value()) { + jo.throw_error("must have either a power_min or a power_max"); + } +} + +void faction_epilogue_data::deserialize(const JsonObject& jo) +{ + optional(jo, false, "power_min", power_min); + optional(jo, false, "power_max", power_max); + optional(jo, false, "dynamic", dynamic_conditions); + mandatory(jo, false, "faction", epilogue); +} //bool faction::check_relations( std::optional> jo ) const //{ diff --git a/src/faction.h b/src/faction.h index 7b4dbfbd94e73..c06bf6caa8288 100644 --- a/src/faction.h +++ b/src/faction.h @@ -100,16 +100,6 @@ struct faction_power_spec void deserialize( const JsonObject& jo ); }; -void faction_power_spec::deserialize( const JsonObject& jo ) -{ - mandatory( jo, false, "faction", faction ); // from generic_factory.h - optional( jo, false, "power_min", power_min ); - optional( jo, false, "power_max", power_max ); - - if ( !power_min.has_value() && !power_max.has_value() ) { - jo.throw_error("must have either a power_min or a power_max"); - } -} struct faction_epilogue_data { @@ -123,13 +113,6 @@ struct faction_epilogue_data void deserialize( const JsonObject &jo ); }; -void faction_epilogue_data::deserialize( const JsonObject &jo ) -{ - optional(jo, false, "power_min", power_min); - optional(jo, false, "power_max", power_max); - optional(jo, false, "dynamic", dynamic_conditions); - mandatory(jo, false, "faction", epilogue); -} class faction_template { @@ -162,7 +145,7 @@ class faction_template std::vector price_rules; // additional pricing rules std::map> relations; mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human - std::set epilogue_data; + std::vector epilogue_data; }; class faction : public faction_template From 1d0303cc8d3973cce428df3f35c931c116682749 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Thu, 30 May 2024 14:13:01 -0500 Subject: [PATCH 22/59] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 36 +++++++++++++++++-- src/faction.cpp | 33 ++++++++--------- src/faction.h | 70 ++++++++++++++++++------------------ src/game.h | 2 +- 4 files changed, 85 insertions(+), 56 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index cba435288f364..a963df39039a1 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -78,9 +78,39 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, - { "dynamic": { "and": [ { "faction": "robofac", "power_min": 150 }, { "not": { "and": [ { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] } } ] }, "id": "epilogue_faction_robofac_150" }, - { "dynamic": { "and": [ { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] }, "id": "epilogue_faction_robofac_thrive" }, - { "dynamic": { "and": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] }, "id": "epilogue_faction_robofac_thrive_OG" } + { + "dynamic": { + "and": [ + { "faction": "robofac", "power_min": 150 }, + { + "not": { "and": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_min": 150 } ] } + } + ] + }, + "id": "epilogue_faction_robofac_150" + }, + { + "dynamic": { + "and": [ + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ] + }, + "id": "epilogue_faction_robofac_thrive" + }, + { + "dynamic": { + "and": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ] + }, + "id": "epilogue_faction_robofac_thrive_OG" + } ], "description": "The surviving staff of Hub 01, a pre-Cataclysm research lab. They rarely leave their lab, if at all, and rely on their robots and advanced technology to survive." }, diff --git a/src/faction.cpp b/src/faction.cpp index e3ff59953b7f2..d7ce575b5b8b7 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -152,23 +152,23 @@ std::string faction::describe() const return ret; } -void faction_power_spec::deserialize(const JsonObject& jo) +void faction_power_spec::deserialize( const JsonObject &jo ) { - mandatory(jo, false, "faction", faction); // from generic_factory.h - optional(jo, false, "power_min", power_min); - optional(jo, false, "power_max", power_max); + mandatory( jo, false, "faction", faction ); // from generic_factory.h + optional( jo, false, "power_min", power_min ); + optional( jo, false, "power_max", power_max ); - if (!power_min.has_value() && !power_max.has_value()) { - jo.throw_error("must have either a power_min or a power_max"); + if( !power_min.has_value() && !power_max.has_value() ) { + jo.throw_error( "must have either a power_min or a power_max" ); } } -void faction_epilogue_data::deserialize(const JsonObject& jo) +void faction_epilogue_data::deserialize( const JsonObject &jo ) { - optional(jo, false, "power_min", power_min); - optional(jo, false, "power_max", power_max); - optional(jo, false, "dynamic", dynamic_conditions); - mandatory(jo, false, "faction", epilogue); + optional( jo, false, "power_min", power_min ); + optional( jo, false, "power_max", power_max ); + optional( jo, false, "dynamic", dynamic_conditions ); + mandatory( jo, false, "faction", epilogue ); } //bool faction::check_relations( std::optional> jo ) const @@ -184,11 +184,12 @@ void faction_epilogue_data::deserialize(const JsonObject& jo) // return true; //} -bool faction::check_relations(const std::vector faction_power_specs) const +bool faction::check_relations( const std::vector faction_power_specs ) const { - if (!faction_power_specs.empty()) { - for (const faction_power_spec& spec : faction_power_specs) { - if ((!!spec.power_min && spec.faction->power < spec.power_min.value()) || (!!spec.power_max && spec.faction->power >= spec.power_max.value())) { + if( !faction_power_specs.empty() ) { + for( const faction_power_spec &spec : faction_power_specs ) { + if( ( !!spec.power_min && spec.faction->power < spec.power_min.value() ) || ( !!spec.power_max && + spec.faction->power >= spec.power_max.value() ) ) { return false; } } @@ -201,7 +202,7 @@ std::vector faction::epilogue() const std::vector ret; for( auto it = epilogue_data.cbegin(), next_it = it; it != epilogue_data.cend(); it = next_it ) { if( power >= it->power_min && power < it->power_max ) { - if( !it->dynamic_conditions.empty() ) { + if( !it->dynamic_conditions.empty() ) { if( check_relations( it->dynamic_conditions ) ) { ret.emplace_back( it->epilogue->translated() ); } diff --git a/src/faction.h b/src/faction.h index c06bf6caa8288..131a1e5d6f54c 100644 --- a/src/faction.h +++ b/src/faction.h @@ -91,18 +91,16 @@ class faction_price_rules_reader : public generic_typed_reader power_min; std::optional power_max; - void deserialize( const JsonObject& jo ); + void deserialize( const JsonObject &jo ); }; -struct faction_epilogue_data -{ +struct faction_epilogue_data { int power_min; int power_max; @@ -116,36 +114,36 @@ struct faction_epilogue_data class faction_template { -protected: - faction_template(); - void load_relations(const JsonObject& jsobj); - -private: - explicit faction_template(const JsonObject& jsobj); - - -public: - static void load(const JsonObject& jsobj); - static void check_consistency(); - static void reset(); - - std::string name; - int likes_u; - int respects_u; - int trusts_u; // Determines which item groups are available for trading - bool known_by_u; - faction_id id; - translation desc; - int size; // How big is our sphere of influence? - int power; // General measure of our power - nutrients food_supply; //Total nutritional value held - int wealth; //Total trade currency - bool lone_wolf_faction; // is this a faction for just one person? - itype_id currency; // id of the faction currency - std::vector price_rules; // additional pricing rules - std::map> relations; - mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human - std::vector epilogue_data; + protected: + faction_template(); + void load_relations( const JsonObject &jsobj ); + + private: + explicit faction_template( const JsonObject &jsobj ); + + + public: + static void load( const JsonObject &jsobj ); + static void check_consistency(); + static void reset(); + + std::string name; + int likes_u; + int respects_u; + int trusts_u; // Determines which item groups are available for trading + bool known_by_u; + faction_id id; + translation desc; + int size; // How big is our sphere of influence? + int power; // General measure of our power + nutrients food_supply; //Total nutritional value held + int wealth; //Total trade currency + bool lone_wolf_faction; // is this a faction for just one person? + itype_id currency; // id of the faction currency + std::vector price_rules; // additional pricing rules + std::map> relations; + mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human + std::vector epilogue_data; }; class faction : public faction_template @@ -160,7 +158,7 @@ class faction : public faction_template std::string describe() const; - bool check_relations(std::vector jo) const; + bool check_relations( std::vector jo ) const; std::vector epilogue() const; std::string food_supply_text(); diff --git a/src/game.h b/src/game.h index 9c6fedf5a1e6e..dcc590f554ea5 100644 --- a/src/game.h +++ b/src/game.h @@ -1051,7 +1051,7 @@ class game void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) //bool verify_dynamic_power( std::string - //dyn ); //Checks to make sure the faction power requirements are met for dynamic endings + //dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From 6279bd6a3dfe50523698b97a88d99e3879f93892 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 16:09:55 -0400 Subject: [PATCH 23/59] faction.cpp fixes --- data/json/npcs/factions.json | 46 ++++++---- data/json/snippets/epilogue_factions.json | 25 +++++- src/faction.cpp | 49 +++++----- src/faction.h | 4 +- src/game.cpp | 105 ---------------------- src/game.h | 2 - 6 files changed, 75 insertions(+), 156 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index cba435288f364..a1bc2efc95893 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -23,6 +23,10 @@ }, "mon_faction": "player", "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_your_followers_0" } ], + "epilogues": [ { "power_min": 150, "id": "epilogue_faction_your_followers_150" } ], + "epilogues": [ { "power_min": 150, "dynamic": [ { "faction": "free_merchants", "power_min": 150 }, { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_your_followers_FM" } ], + "epilogues": [ { "power_min": 150, "dynamic": [ { "faction": "free_merchants", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_your_followers_revolt" } ], + "epilogues": [ { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_your_followers_OG" } ], "description": "The survivors who have entrusted you with their well-being. If morale drops, poor performance and mutiny may become issues." }, { @@ -78,9 +82,11 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, - { "dynamic": { "and": [ { "faction": "robofac", "power_min": 150 }, { "not": { "and": [ { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] } } ] }, "id": "epilogue_faction_robofac_150" }, - { "dynamic": { "and": [ { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] }, "id": "epilogue_faction_robofac_thrive" }, - { "dynamic": { "and": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ] }, "id": "epilogue_faction_robofac_thrive_OG" } + { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_max": 150 }, { "faction": "the_great_library", "power_max": 150 } ], "id": "epilogue_faction_robofac_150" }, + { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_max": 150 } ], "id": "epilogue_faction_robofac_150" }, + { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_max": 150 }, { "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_robofac_150" }, + { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_robofac_thrive" }, + { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_robofac_thrive_OG" } ], "description": "The surviving staff of Hub 01, a pre-Cataclysm research lab. They rarely leave their lab, if at all, and rely on their robots and advanced technology to survive." }, @@ -144,8 +150,10 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_old_guard_0" }, - { "power_min": 150, "dynamic": "4000000", "id": "epilogue_faction_old_guard_150" }, - { "dynamic": "1110110", "id": "epilogue_faction_old_guard_thrive" } + { "power_min": 150, "dynamic": [ { "faction": "tacoma_commune", "power_max": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_old_guard_150" }, + { "power_min": 150, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_max": 150 } ], "id": "epilogue_faction_old_guard_150" }, + { "power_min": 150, "dynamic": [ { "faction": "tacoma_commune", "power_max": 150 }, { "faction": "robofac", "power_max": 150 } ], "id": "epilogue_faction_old_guard_150" }, + { "power_min": 150, "power_max": 300, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_old_guard_thrive" } ], "description": "The remains of the federal government. The extent of their strength is unknown but squads of patrolling soldiers have been seen under their banner." }, @@ -231,8 +239,10 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_free_merchants_0" }, - { "power_min": 150, "id": "epilogue_faction_free_merchants_150" }, - { "dynamic": "1111110", "id": "epilogue_faction_free_merchants_thrive" } + { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_free_merchants_150" }, + { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_max": 150 } ], "id": "epilogue_faction_free_merchants_150" }, + { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "tacoma_commune", "power_max": 150 } ], "id": "epilogue_faction_free_merchants_150" }, + { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_free_merchants_thrive" } ], "description": "A conglomeration of entrepreneurs and businessmen that stand together to hammer-out an existence through trade and industry." }, @@ -322,10 +332,10 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" }, - { "dynamic": "0011000", "id": "epilogue_faction_tacoma_commune_150" }, - { "dynamic": "1111110", "id": "epilogue_faction_tacoma_commune_150_OG" }, - { "dynamic": "0012000", "id": "epilogue_faction_tacoma_commune_revolt" }, - { "dynamic": "1112110", "id": "epilogue_faction_tacoma_commune_revolt_OG" } + { "power_min": 150, "power_max": 400, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_150" }, + { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_150_OG" }, + { "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 } ], "id": "epilogue_faction_tacoma_commune_revolt" }, + { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_revolt_OG" } ], "description": "An outpost started by the Free Merchants to provide a source of food and raw materials." }, @@ -463,9 +473,11 @@ "your_followers": { "kill on sight": true } }, "epilogues": [ - { "dynamic": "4000002", "id": "epilogue_faction_hells_raiders_0" }, - { "dynamic": "4000001", "id": "epilogue_faction_hells_raiders_150" }, - { "dynamic": "3000000", "id": "epilogue_faction_hells_raiders_collapse" } + { "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "hells_raiders", "power_max": 150 } ], "id": "epilogue_faction_hells_raiders_0" }, + { "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "hells_raiders", "power_min": 150 } ], "id": "epilogue_faction_hells_raiders_150" }, + { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "hells_raiders", "power_max": 150 } ], "id": "epilogue_faction_hells_raiders_stalemate" }, + { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "hells_raiders", "power_min": 150 } ], "id": "epilogue_faction_hells_raiders_stalemate" }, + { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_hells_raiders_collapse" } ], "description": "The largest gang of hooligans and bandits that preys upon other survivors. Even if you have no gear, there is always a need for slaves and fresh meat." }, @@ -601,9 +613,9 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_isherwoods_0" }, - { "power_min": 150, "dynamic": "4000000", "id": "epilogue_faction_isherwoods_150" }, - { "power_min": 150, "dynamic": "1111110", "id": "epilogue_faction_isherwoods_OG_FM" }, - { "power_min": 150, "dynamic": "1112110", "id": "epilogue_faction_isherwoods_OG" } + { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_isherwoods_OG_FM" }, + { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_isherwoods_OG" }, + { "power_min": 150, "id": "epilogue_faction_isherwoods_150" } ], "description": "A small family surviving on their generational land." }, diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 2c15238ef7cd0..8311a0f298e58 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -7,11 +7,26 @@ "id": "epilogue_faction_default", "text": " You and everyone who followed you are forgotten among the billions lost in the Cataclysm…" }, - { "id": "epilogue_faction_dynamic_default", "text": " " }, { "id": "epilogue_faction_your_followers_0", "text": " You and everyone who followed you are forgotten among the billions lost in the Cataclysm…" }, + { + "id": "epilogue_faction_your_followers_150", + "text": " Your followers will not forget you. Through years struggle, they survive the terrors of the Cataclysm. For this, the legacy of your deeds will live on in the generations your efforts gave a fighting chance…" + }, + { + "id": "epilogue_faction_your_followers_FM", + "text": " The Free Merchants will not forget you. For your support in their time of need, the they contribute greatly to the development of the community established by you and your followers…" + }, + { + "id": "epilogue_faction_your_followers_revolt", + "text": " The people of Tacoma will not forget you. As you helped them develop the facilities needed to survive the apocalypse, they too help your followers harness the means of production…" + }, + { + "id": "epilogue_faction_your_followers_OG", + "text": " The American people will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend is forever entwined in the national mythos and your likeness etched in marble at the heart of Old Washington, many long years later…" + }, { "id": "epilogue_faction_old_guard_0", "text": " Locked in an endless battle, the Old Guard was forced to consolidate their resources in a handful of fortified bases along the coast. Without the men or material to rebuild, the soldiers that remained lost all hope…" @@ -80,9 +95,13 @@ "id": "epilogue_faction_hells_raiders_150", "text": " Fueled by drugs and rage, the Hell's Raiders fought tooth and nail to overthrow the last strongholds of the Old Guard. The costly victories brought the warlords abundant territory and slaves but little in the way of stability. Within weeks, infighting led to civil war as tribes vied for leadership of the faction. When only one warlord finally secured control, there was nothing left to fight for… just endless cities full of the dead." }, + { + "id": "epilogue_faction_hells_raiders_stalemate", + "text": " Unable to overcome the forces of the Old Guard, the Hell's Raiders found themselves trapped in a grueling war of attrition…" + }, { "id": "epilogue_faction_hells_raiders_collapse", - "text": " With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." + "text": " …though in the end, they simply couldn't keep up. With the survivors of the wasteland becoming more organized by the day, the Hell's Raiders found it more and more difficult to find easy prey to loot and pillage. Before long, the once feared raiders found themselves on the defensive as the resurgent Old Guard began to assault their outposts and dismantle their hierarchy of command. Those that weren't killed were forced to flee into the untamed west, the memory of their terror slowly fading like a bad dream." }, { "id": "epilogue_faction_robofac_0", @@ -114,7 +133,7 @@ }, { "id": "epilogue_faction_isherwoods_OG", - "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma looking to build a new settlement…" + "text": " After they shot an Old Guard envoy to the farm, a bounty was placed on the Isherwood family. When the father pleaded guilty to killing the man, the remaining Isherwoods were allowed to return to their farm, albeit with planners from Tacoma…" }, { "id": "epilogue_faction_lapin_0", diff --git a/src/faction.cpp b/src/faction.cpp index e3ff59953b7f2..4aacc50fefc8b 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -154,12 +154,12 @@ std::string faction::describe() const void faction_power_spec::deserialize(const JsonObject& jo) { - mandatory(jo, false, "faction", faction); // from generic_factory.h + mandatory(jo, false, "faction", faction); optional(jo, false, "power_min", power_min); optional(jo, false, "power_max", power_max); if (!power_min.has_value() && !power_max.has_value()) { - jo.throw_error("must have either a power_min or a power_max"); + jo.throw_error("Must have either a power_min or a power_max"); } } @@ -168,49 +168,44 @@ void faction_epilogue_data::deserialize(const JsonObject& jo) optional(jo, false, "power_min", power_min); optional(jo, false, "power_max", power_max); optional(jo, false, "dynamic", dynamic_conditions); - mandatory(jo, false, "faction", epilogue); + mandatory(jo, false, "id", epilogue); } -//bool faction::check_relations( std::optional> jo ) const -//{ -// for( auto it = jo->cbegin(), next_it = it; it != jo->cend(); it = next_it ) { -// if( it->power_min.has_value() && it->faction->power < it->power_min.value() ) { -// return false; -// } -// else if( it->power_max.has_value() && it->faction->power >= it->power_max.value() ) { -// return false; -// } -// } -// return true; -//} - -bool faction::check_relations(const std::vector faction_power_specs) const + +bool faction::check_relations( std::vector faction_power_specs ) const { - if (!faction_power_specs.empty()) { - for (const faction_power_spec& spec : faction_power_specs) { - if ((!!spec.power_min && spec.faction->power < spec.power_min.value()) || (!!spec.power_max && spec.faction->power >= spec.power_max.value())) { - return false; + if( !faction_power_specs.empty() ) { + for( const faction_power_spec& spec : faction_power_specs ) { + if( spec.power_min.has_value() ) { + if( spec.faction->power < spec.power_min.value() ) { + return false; + } + } + if( spec.power_max.has_value() ) { + if( spec.faction->power >= spec.power_max.value() ) { + return false; + } } } } return true; } + std::vector faction::epilogue() const { std::vector ret; - for( auto it = epilogue_data.cbegin(), next_it = it; it != epilogue_data.cend(); it = next_it ) { - if( power >= it->power_min && power < it->power_max ) { - if( !it->dynamic_conditions.empty() ) { - if( check_relations( it->dynamic_conditions ) ) { - ret.emplace_back( it->epilogue->translated() ); - } + for( const faction_epilogue_data& epi : epilogue_data ) { + if ( ( !epi.power_min.has_value() || power >= epi.power_min ) && ( !epi.power_max.has_value() || power < epi.power_max ) ) { + if( check_relations( epi.dynamic_conditions ) ) { + ret.emplace_back( epi.epilogue->translated() ); } } } return ret; } + void faction::add_to_membership( const character_id &guy_id, const std::string &guy_name, const bool known ) { diff --git a/src/faction.h b/src/faction.h index c06bf6caa8288..2c6fe519cff3b 100644 --- a/src/faction.h +++ b/src/faction.h @@ -103,8 +103,8 @@ struct faction_power_spec struct faction_epilogue_data { - int power_min; - int power_max; + std::optional power_min; + std::optional power_max; std::vector dynamic_conditions; diff --git a/src/game.cpp b/src/game.cpp index b3be19f5b4cfb..6e2c712df2e52 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,111 +3627,6 @@ void game::disp_NPC_epilogues() } } -//bool game::verify_dynamic_power( std::string dyn ) -//{ -// for( std::string::size_type i = 0; i < dyn.size(); i++ ) { -// if( i == 0 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 ) { -// return false; -// } -// } else if( dyn[i] == '3' ) { //Did the Old Guard manage to find enough allies? -// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power < 150 -// || faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 -// || faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 -// || faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 -// || faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { -// return false; //If they didn't, then this doesn't apply -// } -// } else if( dyn[i] == '4' ) { //Did the Old Guard fail to find enough powerful allies? -// if( faction_manager_ptr->get( faction_id( "old_guard" ) )->power >= 150 -// && faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 -// && faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 -// && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 -// && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { -// return false; //If they did, then this doesn't apply -// } -// } -// } -// if( i == 1 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "robofac" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 ) { -// return false; -// } -// } else if( dyn[i] == '3' ) { //Did Hub-01 fail to find a solution to their resource shortages? -// if( faction_manager_ptr->get( faction_id( "robofac" ) )->power >= 150 -// && faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 -// && faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { -// return false; //If they did, then this doesn't apply -// } -// } -// } -// if( i == 2 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "tacoma_commune" ) )->power >= 150 ) { -// return false; -// } -// } -// } -// if( i == 3 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "free_merchants" ) )->power >= 150 ) { -// return false; -// } -// } -// } -// if( i == 4 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "exodii" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "exodii" ) )->power >= 150 ) { -// return false; -// } -// } -// } -// if( i == 5 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "the_great_library" ) )->power >= 150 ) { -// return false; -// } -// } -// } -// if( i == 6 ) { -// if( dyn[i] == '1' ) { -// if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power < 150 ) { -// return false; -// } -// } else if( dyn[i] == '2' ) { -// if( faction_manager_ptr->get( faction_id( "hells_raiders" ) )->power >= 150 ) { -// return false; -// } -// } -// } -// } -// return true; -//} void game::display_faction_epilogues() { diff --git a/src/game.h b/src/game.h index 9c6fedf5a1e6e..75cd5e0ce0785 100644 --- a/src/game.h +++ b/src/game.h @@ -1050,8 +1050,6 @@ class game void disp_NPCs(); // Currently for debug use. Lists global NPCs. void list_missions(); // Listed current, completed and failed missions (mission_ui.cpp) - //bool verify_dynamic_power( std::string - //dyn ); //Checks to make sure the faction power requirements are met for dynamic endings private: // Input related // Handles box showing items under mouse From 2484866a3b8efab63eeba1aa986d7cdec2e75c8e Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 16:18:57 -0400 Subject: [PATCH 24/59] Update faction.h --- src/faction.h | 84 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/src/faction.h b/src/faction.h index 5d99dbd5d4350..02aca10a80136 100644 --- a/src/faction.h +++ b/src/faction.h @@ -92,38 +92,62 @@ class faction_price_rules_reader : public generic_typed_reader power_min; + std::optional power_max; - private: - explicit faction_template( const JsonObject &jsobj ); + void deserialize( const JsonObject& jo ); +}; - public: - static void load( const JsonObject &jsobj ); - static void check_consistency(); - static void reset(); - - std::string name; - int likes_u; - int respects_u; - int trusts_u; // Determines which item groups are available for trading - bool known_by_u; - faction_id id; - translation desc; - int size; // How big is our sphere of influence? - int power; // General measure of our power - nutrients food_supply; //Total nutritional value held - bool consumes_food; //Whether this faction actually draws down the food_supply when eating from it - int wealth; //Total trade currency - bool lone_wolf_faction; // is this a faction for just one person? - itype_id currency; // id of the faction currency - std::vector price_rules; // additional pricing rules - std::map> relations; - mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human - std::set> epilogue_data; + +struct faction_epilogue_data +{ + std::optional power_min; + std::optional power_max; + + std::vector dynamic_conditions; + + snippet_id epilogue; + + void deserialize( const JsonObject &jo ); +}; + + +class faction_template +{ +protected: + faction_template(); + void load_relations(const JsonObject& jsobj); + +private: + explicit faction_template(const JsonObject& jsobj); + + +public: + static void load(const JsonObject& jsobj); + static void check_consistency(); + static void reset(); + + std::string name; + int likes_u; + int respects_u; + int trusts_u; // Determines which item groups are available for trading + bool known_by_u; + faction_id id; + translation desc; + int size; // How big is our sphere of influence? + int power; // General measure of our power + nutrients food_supply; //Total nutritional value held + int wealth; //Total trade currency + bool lone_wolf_faction; // is this a faction for just one person? + itype_id currency; // id of the faction currency + std::vector price_rules; // additional pricing rules + std::map> relations; + mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human + std::vector epilogue_data; }; class faction : public faction_template @@ -136,7 +160,9 @@ class faction : public faction_template void serialize( JsonOut &json ) const; void faction_display( const catacurses::window &fac_w, int width ) const; + std::string describe() const; + bool check_relations(std::vector jo) const; std::vector epilogue() const; std::string food_supply_text(); From 7650b03341a88ece60d33ccd1252fa134fe85da5 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:22:53 -0400 Subject: [PATCH 25/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 625f0473b04c2..40e87e0a5c9cc 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -25,9 +25,35 @@ "mon_faction": "player", "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_your_followers_0" } ], "epilogues": [ { "power_min": 150, "id": "epilogue_faction_your_followers_150" } ], - "epilogues": [ { "power_min": 150, "dynamic": [ { "faction": "free_merchants", "power_min": 150 }, { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_your_followers_FM" } ], - "epilogues": [ { "power_min": 150, "dynamic": [ { "faction": "free_merchants", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_your_followers_revolt" } ], - "epilogues": [ { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_your_followers_OG" } ], + "epilogues": [ + { + "power_min": 150, + "dynamic": [ + { "faction": "free_merchants", "power_min": 150 }, + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 } + ], + "id": "epilogue_faction_your_followers_FM" + } + ], + "epilogues": [ + { + "power_min": 150, + "dynamic": [ { "faction": "free_merchants", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], + "id": "epilogue_faction_your_followers_revolt" + } + ], + "epilogues": [ + { + "power_min": 150, + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "robofac", "power_min": 150 } + ], + "id": "epilogue_faction_your_followers_OG" + } + ], "description": "The survivors who have entrusted you with their well-being. If morale drops, poor performance and mutiny may become issues." }, { From e35c8f1243e6bc6fa2f71de3f2a151995bced044 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:03 -0400 Subject: [PATCH 26/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 40e87e0a5c9cc..0d3f288076391 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -112,11 +112,36 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_robofac_0" }, - { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_max": 150 }, { "faction": "the_great_library", "power_max": 150 } ], "id": "epilogue_faction_robofac_150" }, - { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_max": 150 } ], "id": "epilogue_faction_robofac_150" }, - { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_max": 150 }, { "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_robofac_150" }, - { "power_min": 150, "dynamic": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_robofac_thrive" }, - { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_robofac_thrive_OG" } + { + "power_min": 150, + "dynamic": [ { "faction": "exodii", "power_max": 150 }, { "faction": "the_great_library", "power_max": 150 } ], + "id": "epilogue_faction_robofac_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_max": 150 } ], + "id": "epilogue_faction_robofac_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "exodii", "power_max": 150 }, { "faction": "the_great_library", "power_min": 150 } ], + "id": "epilogue_faction_robofac_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "exodii", "power_min": 150 }, { "faction": "the_great_library", "power_min": 150 } ], + "id": "epilogue_faction_robofac_thrive" + }, + { + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ], + "id": "epilogue_faction_robofac_thrive_OG" + } ], "description": "The surviving staff of Hub 01, a pre-Cataclysm research lab. They rarely leave their lab, if at all, and rely on their robots and advanced technology to survive." }, From cc609eb782d7784d8fc1435c31b4073c96a39de2 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:12 -0400 Subject: [PATCH 27/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 0d3f288076391..463bb06242b0c 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -207,10 +207,27 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_old_guard_0" }, - { "power_min": 150, "dynamic": [ { "faction": "tacoma_commune", "power_max": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_old_guard_150" }, - { "power_min": 150, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_max": 150 } ], "id": "epilogue_faction_old_guard_150" }, - { "power_min": 150, "dynamic": [ { "faction": "tacoma_commune", "power_max": 150 }, { "faction": "robofac", "power_max": 150 } ], "id": "epilogue_faction_old_guard_150" }, - { "power_min": 150, "power_max": 300, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_old_guard_thrive" } + { + "power_min": 150, + "dynamic": [ { "faction": "tacoma_commune", "power_max": 150 }, { "faction": "robofac", "power_min": 150 } ], + "id": "epilogue_faction_old_guard_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_max": 150 } ], + "id": "epilogue_faction_old_guard_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "tacoma_commune", "power_max": 150 }, { "faction": "robofac", "power_max": 150 } ], + "id": "epilogue_faction_old_guard_150" + }, + { + "power_min": 150, + "power_max": 300, + "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 } ], + "id": "epilogue_faction_old_guard_thrive" + } ], "description": "The remains of the federal government. The extent of their strength is unknown but squads of patrolling soldiers have been seen under their banner." }, From 554a3d351581c7b4d6f5cbe13538d8fd45d2b9b3 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:19 -0400 Subject: [PATCH 28/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 463bb06242b0c..24a284282d6b2 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -316,10 +316,26 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_free_merchants_0" }, - { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_free_merchants_150" }, - { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_max": 150 } ], "id": "epilogue_faction_free_merchants_150" }, - { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "tacoma_commune", "power_max": 150 } ], "id": "epilogue_faction_free_merchants_150" }, - { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_free_merchants_thrive" } + { + "power_min": 150, + "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], + "id": "epilogue_faction_free_merchants_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_max": 150 } ], + "id": "epilogue_faction_free_merchants_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "tacoma_commune", "power_max": 150 } ], + "id": "epilogue_faction_free_merchants_150" + }, + { + "power_min": 150, + "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], + "id": "epilogue_faction_free_merchants_thrive" + } ], "description": "A conglomeration of entrepreneurs and businessmen that stand together to hammer-out an existence through trade and industry." }, From b01c75cec1fd53bb650a854cd0b93d9fae4519de Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:26 -0400 Subject: [PATCH 29/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 24a284282d6b2..725686f268f8a 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -426,10 +426,38 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" }, - { "power_min": 150, "power_max": 400, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_150" }, - { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_150_OG" }, - { "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 } ], "id": "epilogue_faction_tacoma_commune_revolt" }, - { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_revolt_OG" } + { + "power_min": 150, + "power_max": 400, + "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 } ], + "id": "epilogue_faction_tacoma_commune_150" + }, + { + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "free_merchants", "power_min": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ], + "id": "epilogue_faction_tacoma_commune_150_OG" + }, + { + "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 } ], + "id": "epilogue_faction_tacoma_commune_revolt" + }, + { + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "free_merchants", "power_max": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ], + "id": "epilogue_faction_tacoma_commune_revolt_OG" + } ], "description": "An outpost started by the Free Merchants to provide a source of food and raw materials." }, From 354db49f4233c06197f801e40437676011bc50ae Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:34 -0400 Subject: [PATCH 30/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index dfc428ec4ee85..c210aed7bbfdd 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -159,8 +159,8 @@ void faction_power_spec::deserialize(const JsonObject& jo) optional(jo, false, "power_min", power_min); optional(jo, false, "power_max", power_max); - if (!power_min.has_value() && !power_max.has_value()) { - jo.throw_error("Must have either a power_min or a power_max"); + if( !power_min.has_value() && !power_max.has_value() ) { + jo.throw_error( "Must have either a power_min or a power_max" ); } } From 599ade8ea07f7bdaf6daf8a79de1c5ea276e63dd Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:41 -0400 Subject: [PATCH 31/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index c210aed7bbfdd..db855ccc8e674 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -166,10 +166,10 @@ void faction_power_spec::deserialize(const JsonObject& jo) void faction_epilogue_data::deserialize(const JsonObject& jo) { - optional(jo, false, "power_min", power_min); - optional(jo, false, "power_max", power_max); - optional(jo, false, "dynamic", dynamic_conditions); - mandatory(jo, false, "id", epilogue); + optional( jo, false, "power_min", power_min ); + optional( jo, false, "power_max", power_max ); + optional( jo, false, "dynamic", dynamic_conditions ); + mandatory( jo, false, "id", epilogue ); } From f2c764625643b8160368a4333c5122b40495b6f9 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:50 -0400 Subject: [PATCH 32/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index db855ccc8e674..0799014311d9b 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -196,8 +196,9 @@ bool faction::check_relations( std::vector faction_power_spe std::vector faction::epilogue() const { std::vector ret; - for( const faction_epilogue_data& epi : epilogue_data ) { - if ( ( !epi.power_min.has_value() || power >= epi.power_min ) && ( !epi.power_max.has_value() || power < epi.power_max ) ) { + for( const faction_epilogue_data &epi : epilogue_data ) { + if( ( !epi.power_min.has_value() || power >= epi.power_min ) && ( !epi.power_max.has_value() || + power < epi.power_max ) ) { if( check_relations( epi.dynamic_conditions ) ) { ret.emplace_back( epi.epilogue->translated() ); } From 45dbb1d4dca21e7f450569a510e8301b6c58f329 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:23:57 -0400 Subject: [PATCH 33/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index 0799014311d9b..e916443a620f9 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -176,7 +176,7 @@ void faction_epilogue_data::deserialize(const JsonObject& jo) bool faction::check_relations( std::vector faction_power_specs ) const { if( !faction_power_specs.empty() ) { - for( const faction_power_spec& spec : faction_power_specs ) { + for( const faction_power_spec &spec : faction_power_specs ) { if( spec.power_min.has_value() ) { if( spec.faction->power < spec.power_min.value() ) { return false; From b2af5bb3aea95ef419a5818586327db45c6cf721 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:24:02 -0400 Subject: [PATCH 34/59] Update src/faction.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/faction.h b/src/faction.h index 02aca10a80136..08b536184df4c 100644 --- a/src/faction.h +++ b/src/faction.h @@ -103,8 +103,7 @@ struct faction_power_spec }; -struct faction_epilogue_data -{ +struct faction_epilogue_data { std::optional power_min; std::optional power_max; From 02f643f1ec5f9aca0a4fc3c3e25d62d7c57f8d88 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:26:41 -0400 Subject: [PATCH 35/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 725686f268f8a..25178977eab63 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -740,8 +740,30 @@ }, "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_isherwoods_0" }, - { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_isherwoods_OG_FM" }, - { "power_min": 150, "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_isherwoods_OG" }, + { + "power_min": 150, + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "free_merchants", "power_min": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ], + "id": "epilogue_faction_isherwoods_OG_FM" + }, + { + "power_min": 150, + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "free_merchants", "power_max": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ], + "id": "epilogue_faction_isherwoods_OG" + }, { "power_min": 150, "id": "epilogue_faction_isherwoods_150" } ], "description": "A small family surviving on their generational land." From a8e659d6c37daab6bc0fce32701aaef28c9a88ee Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:26:58 -0400 Subject: [PATCH 36/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 25178977eab63..fe4ce5750e524 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -598,11 +598,32 @@ "your_followers": { "kill on sight": true } }, "epilogues": [ - { "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "hells_raiders", "power_max": 150 } ], "id": "epilogue_faction_hells_raiders_0" }, - { "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "hells_raiders", "power_min": 150 } ], "id": "epilogue_faction_hells_raiders_150" }, - { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "hells_raiders", "power_max": 150 } ], "id": "epilogue_faction_hells_raiders_stalemate" }, - { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "hells_raiders", "power_min": 150 } ], "id": "epilogue_faction_hells_raiders_stalemate" }, - { "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 }, { "faction": "exodii", "power_min": 150 },{ "faction": "the_great_library", "power_min": 150 } ], "id": "epilogue_faction_hells_raiders_collapse" } + { + "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "hells_raiders", "power_max": 150 } ], + "id": "epilogue_faction_hells_raiders_0" + }, + { + "dynamic": [ { "faction": "old_guard", "power_max": 150 }, { "faction": "hells_raiders", "power_min": 150 } ], + "id": "epilogue_faction_hells_raiders_150" + }, + { + "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "hells_raiders", "power_max": 150 } ], + "id": "epilogue_faction_hells_raiders_stalemate" + }, + { + "dynamic": [ { "faction": "old_guard", "power_min": 150 }, { "faction": "hells_raiders", "power_min": 150 } ], + "id": "epilogue_faction_hells_raiders_stalemate" + }, + { + "dynamic": [ + { "faction": "old_guard", "power_min": 150 }, + { "faction": "tacoma_commune", "power_min": 150 }, + { "faction": "robofac", "power_min": 150 }, + { "faction": "exodii", "power_min": 150 }, + { "faction": "the_great_library", "power_min": 150 } + ], + "id": "epilogue_faction_hells_raiders_collapse" + } ], "description": "The largest gang of hooligans and bandits that preys upon other survivors. Even if you have no gear, there is always a need for slaves and fresh meat." }, From e8db0c07ca3704c67f1febe3fb2bda8fd9984b0d Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 16:27:11 -0400 Subject: [PATCH 37/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index e916443a620f9..4074761db5562 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -155,9 +155,9 @@ std::string faction::describe() const void faction_power_spec::deserialize(const JsonObject& jo) { - mandatory(jo, false, "faction", faction); - optional(jo, false, "power_min", power_min); - optional(jo, false, "power_max", power_max); + mandatory( jo, false, "faction", faction ); + optional( jo, false, "power_min", power_min ); + optional( jo, false, "power_max", power_max ); if( !power_min.has_value() && !power_max.has_value() ) { jo.throw_error( "Must have either a power_min or a power_max" ); From 96c1755aa7255af0938928c5cdac79b276cced32 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:04:39 -0400 Subject: [PATCH 38/59] consumes_food fix --- src/faction.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/faction.h b/src/faction.h index 08b536184df4c..d4e06df494220 100644 --- a/src/faction.h +++ b/src/faction.h @@ -144,6 +144,7 @@ class faction_template bool lone_wolf_faction; // is this a faction for just one person? itype_id currency; // id of the faction currency std::vector price_rules; // additional pricing rules + bool consumes_food; std::map> relations; mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human std::vector epilogue_data; From ce16a2ac3dc46125a3cb34f11cb448ef59b51e31 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:10:04 -0400 Subject: [PATCH 39/59] actual consumes_food fix --- src/faction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.h b/src/faction.h index d4e06df494220..8860221dcc7f0 100644 --- a/src/faction.h +++ b/src/faction.h @@ -140,11 +140,11 @@ class faction_template int size; // How big is our sphere of influence? int power; // General measure of our power nutrients food_supply; //Total nutritional value held + bool consumes_food; //Whether this faction actually draws down the food_supply when eating from it int wealth; //Total trade currency bool lone_wolf_faction; // is this a faction for just one person? itype_id currency; // id of the faction currency std::vector price_rules; // additional pricing rules - bool consumes_food; std::map> relations; mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human std::vector epilogue_data; From 4ab72635a734dd44069a36266106114e7e98e506 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 17:17:35 -0400 Subject: [PATCH 40/59] Update src/faction.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.h | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/faction.h b/src/faction.h index 8860221dcc7f0..f57dc0d3b1ee7 100644 --- a/src/faction.h +++ b/src/faction.h @@ -117,37 +117,37 @@ struct faction_epilogue_data { class faction_template { -protected: - faction_template(); - void load_relations(const JsonObject& jsobj); - -private: - explicit faction_template(const JsonObject& jsobj); - - -public: - static void load(const JsonObject& jsobj); - static void check_consistency(); - static void reset(); - - std::string name; - int likes_u; - int respects_u; - int trusts_u; // Determines which item groups are available for trading - bool known_by_u; - faction_id id; - translation desc; - int size; // How big is our sphere of influence? - int power; // General measure of our power - nutrients food_supply; //Total nutritional value held - bool consumes_food; //Whether this faction actually draws down the food_supply when eating from it - int wealth; //Total trade currency - bool lone_wolf_faction; // is this a faction for just one person? - itype_id currency; // id of the faction currency - std::vector price_rules; // additional pricing rules - std::map> relations; - mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human - std::vector epilogue_data; + protected: + faction_template(); + void load_relations( const JsonObject &jsobj ); + + private: + explicit faction_template( const JsonObject &jsobj ); + + + public: + static void load( const JsonObject &jsobj ); + static void check_consistency(); + static void reset(); + + std::string name; + int likes_u; + int respects_u; + int trusts_u; // Determines which item groups are available for trading + bool known_by_u; + faction_id id; + translation desc; + int size; // How big is our sphere of influence? + int power; // General measure of our power + nutrients food_supply; //Total nutritional value held + bool consumes_food; //Whether this faction actually draws down the food_supply when eating from it + int wealth; //Total trade currency + bool lone_wolf_faction; // is this a faction for just one person? + itype_id currency; // id of the faction currency + std::vector price_rules; // additional pricing rules + std::map> relations; + mfaction_str_id mon_faction; // mon_faction_id of the monster faction; defaults to human + std::vector epilogue_data; }; class faction : public faction_template From 5707a7a32b2a7f3faaad04cc7ed84cb585331cf2 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:24:03 -0400 Subject: [PATCH 41/59] json fix --- data/json/npcs/factions.json | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index fe4ce5750e524..9cd8ba3d368ab 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -23,9 +23,16 @@ } }, "mon_faction": "player", - "epilogues": [ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_your_followers_0" } ], - "epilogues": [ { "power_min": 150, "id": "epilogue_faction_your_followers_150" } ], - "epilogues": [ + "epilogues": [ + { + "power_min": 0, + "power_max": 149, + "id": "epilogue_faction_your_followers_0" + }, + { + "power_min": 150, + "id": "epilogue_faction_your_followers_150" + }, { "power_min": 150, "dynamic": [ @@ -34,16 +41,12 @@ { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_your_followers_FM" - } - ], - "epilogues": [ + }, { "power_min": 150, "dynamic": [ { "faction": "free_merchants", "power_max": 150 }, { "faction": "tacoma_commune", "power_min": 150 } ], "id": "epilogue_faction_your_followers_revolt" - } - ], - "epilogues": [ + }, { "power_min": 150, "dynamic": [ From fff1db0a52c6575e53e3b01d025ec97b22496520 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 17:24:40 -0400 Subject: [PATCH 42/59] Update src/faction.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/faction.h b/src/faction.h index f57dc0d3b1ee7..711b91a795ccc 100644 --- a/src/faction.h +++ b/src/faction.h @@ -93,8 +93,7 @@ class faction_price_rules_reader : public generic_typed_reader power_min; std::optional power_max; From 5a8740d4825c027936f4ae8e66e9e9c52b0988ca Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:27:32 -0400 Subject: [PATCH 43/59] text update --- data/json/snippets/epilogue_factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 8311a0f298e58..a9cfc04aeb7c6 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -25,7 +25,7 @@ }, { "id": "epilogue_faction_your_followers_OG", - "text": " The American people will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend is forever entwined in the national mythos and your likeness etched in marble at the heart of Old Washington, many long years later…" + "text": " The American people will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend is forever entwined with the national mythos, your likeness etched in marble at the heart of Old Washington, many long years later…" }, { "id": "epilogue_faction_old_guard_0", From b3e75259fd66105152e6c24f0e1a05160e7f6f86 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 17:28:06 -0400 Subject: [PATCH 44/59] Update data/json/npcs/factions.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/npcs/factions.json | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 9cd8ba3d368ab..5d1858b6e735c 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -23,16 +23,9 @@ } }, "mon_faction": "player", - "epilogues": [ - { - "power_min": 0, - "power_max": 149, - "id": "epilogue_faction_your_followers_0" - }, - { - "power_min": 150, - "id": "epilogue_faction_your_followers_150" - }, + "epilogues": [ + { "power_min": 0, "power_max": 149, "id": "epilogue_faction_your_followers_0" }, + { "power_min": 150, "id": "epilogue_faction_your_followers_150" }, { "power_min": 150, "dynamic": [ From 92a6c7aee42dd1af14834d9acb8bb214f6aec025 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:30:53 -0400 Subject: [PATCH 45/59] another text update --- data/json/snippets/epilogue_factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index a9cfc04aeb7c6..3d4da8721f580 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -13,7 +13,7 @@ }, { "id": "epilogue_faction_your_followers_150", - "text": " Your followers will not forget you. Through years struggle, they survive the terrors of the Cataclysm. For this, the legacy of your deeds will live on in the generations your efforts gave a fighting chance…" + "text": " Your followers will not forget you. Through years of struggle, they survive the terrors of the Cataclysm. For this, the legacy of your deeds will live on in the generations your efforts gave a fighting chance…" }, { "id": "epilogue_faction_your_followers_FM", From 0c9eb0b793a4caca841f307a0c39346d149753ba Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:39:23 -0400 Subject: [PATCH 46/59] astyle fix --- src/faction.cpp | 4 ++-- src/faction.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index 4074761db5562..de745cdae9f10 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -153,7 +153,7 @@ std::string faction::describe() const return ret; } -void faction_power_spec::deserialize(const JsonObject& jo) +void faction_power_spec::deserialize( const JsonObject& jo ) { mandatory( jo, false, "faction", faction ); optional( jo, false, "power_min", power_min ); @@ -164,7 +164,7 @@ void faction_power_spec::deserialize(const JsonObject& jo) } } -void faction_epilogue_data::deserialize(const JsonObject& jo) +void faction_epilogue_data::deserialize( const JsonObject& jo ) { optional( jo, false, "power_min", power_min ); optional( jo, false, "power_max", power_max ); diff --git a/src/faction.h b/src/faction.h index 711b91a795ccc..857b567daf62f 100644 --- a/src/faction.h +++ b/src/faction.h @@ -98,7 +98,7 @@ struct faction_power_spec { std::optional power_min; std::optional power_max; - void deserialize( const JsonObject& jo ); + void deserialize( const JsonObject &jo ); }; @@ -161,7 +161,7 @@ class faction : public faction_template std::string describe() const; - bool check_relations(std::vector jo) const; + bool check_relations( std::vector jo ) const; std::vector epilogue() const; std::string food_supply_text(); From e6272838160063e6555585bb60e291255c9cf45b Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 17:41:39 -0400 Subject: [PATCH 47/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index de745cdae9f10..2dc81d9bc92d3 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -153,7 +153,7 @@ std::string faction::describe() const return ret; } -void faction_power_spec::deserialize( const JsonObject& jo ) +void faction_power_spec::deserialize( const JsonObject &jo ) { mandatory( jo, false, "faction", faction ); optional( jo, false, "power_min", power_min ); From d3fc0835cf22ce8f3be5f94a4c782dd773d964f5 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Fri, 31 May 2024 17:41:44 -0400 Subject: [PATCH 48/59] Update src/faction.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/faction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index 2dc81d9bc92d3..cf125faeb9ab6 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -164,7 +164,7 @@ void faction_power_spec::deserialize( const JsonObject &jo ) } } -void faction_epilogue_data::deserialize( const JsonObject& jo ) +void faction_epilogue_data::deserialize( const JsonObject &jo ) { optional( jo, false, "power_min", power_min ); optional( jo, false, "power_max", power_max ); From 5a13a42699157b7f217df9e7a52e350419683abe Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:48:07 -0400 Subject: [PATCH 49/59] text update --- data/json/snippets/epilogue_factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 3d4da8721f580..dd9108922b692 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -25,7 +25,7 @@ }, { "id": "epilogue_faction_your_followers_OG", - "text": " The American people will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend is forever entwined with the national mythos, your likeness etched in marble at the heart of Old Washington, many long years later…" + "text": " The soldiers of the Old Guard will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend will forever be entwined with the national mythos, your likeness etched in marble at the heart of New Washington…" }, { "id": "epilogue_faction_old_guard_0", From fa30c6baf5749afef278ef570e62465e1ff94890 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 17:50:30 -0400 Subject: [PATCH 50/59] typo --- data/json/snippets/epilogue_factions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index dd9108922b692..866e43247f390 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -17,7 +17,7 @@ }, { "id": "epilogue_faction_your_followers_FM", - "text": " The Free Merchants will not forget you. For your support in their time of need, the they contribute greatly to the development of the community established by you and your followers…" + "text": " The Free Merchants will not forget you. For your support in their time of need, they contribute greatly to the development of the community established by you and your followers…" }, { "id": "epilogue_faction_your_followers_revolt", From 6fe59fed9368097c8dbca203241a4d9338d89324 Mon Sep 17 00:00:00 2001 From: GalacticApple <01134dave@gmail.com> Date: Fri, 31 May 2024 18:04:32 -0400 Subject: [PATCH 51/59] removed testing values --- data/json/npcs/factions.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index 5d1858b6e735c..e53c8af298091 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -220,7 +220,6 @@ }, { "power_min": 150, - "power_max": 300, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_old_guard_thrive" } @@ -424,7 +423,6 @@ { "power_min": 0, "power_max": 149, "id": "epilogue_faction_tacoma_commune_0" }, { "power_min": 150, - "power_max": 400, "dynamic": [ { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_150" }, From 178b5fc446ff623ef4ebc251ba00f742848a37f7 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:14:53 -0400 Subject: [PATCH 52/59] Update src/faction.cpp Co-authored-by: anothersimulacrum --- src/faction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index cf125faeb9ab6..c5f2a2d340e67 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -84,7 +84,7 @@ void faction_template::load( const JsonObject &jsobj ) void faction_template::check_consistency() { for( const faction_template &fac : npc_factions::all_templates ) { - for( const auto &epi : fac.epilogue_data ) { + for( const faction_epilogue_data &epi : fac.epilogue_data ) { if( !epi.epilogue.is_valid() ) { debugmsg( "There's no snippet with id %s", epi.epilogue.str() ); } From 9b37101ebf9993e375121c1e7288b7cd5ea4e442 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:15:00 -0400 Subject: [PATCH 53/59] Update src/faction.cpp Co-authored-by: anothersimulacrum --- src/faction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index c5f2a2d340e67..97c11b1807f95 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -173,7 +173,7 @@ void faction_epilogue_data::deserialize( const JsonObject &jo ) } -bool faction::check_relations( std::vector faction_power_specs ) const +bool faction::check_relations( const std::vector &faction_power_specs ) const { if( !faction_power_specs.empty() ) { for( const faction_power_spec &spec : faction_power_specs ) { From 9578ff02c45f3c0beddfd5c492f8d70ea268a8f8 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:15:10 -0400 Subject: [PATCH 54/59] Update src/faction.cpp Co-authored-by: anothersimulacrum --- src/faction.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/faction.cpp b/src/faction.cpp index 97c11b1807f95..e616626c17c01 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -175,17 +175,18 @@ void faction_epilogue_data::deserialize( const JsonObject &jo ) bool faction::check_relations( const std::vector &faction_power_specs ) const { - if( !faction_power_specs.empty() ) { - for( const faction_power_spec &spec : faction_power_specs ) { - if( spec.power_min.has_value() ) { - if( spec.faction->power < spec.power_min.value() ) { - return false; - } + if( faction_power_specs.empty() ) { + return true; + } + for( const faction_power_spec &spec : faction_power_specs ) { + if( spec.power_min.has_value() ) { + if( spec.faction->power < spec.power_min.value() ) { + return false; } - if( spec.power_max.has_value() ) { - if( spec.faction->power >= spec.power_max.value() ) { - return false; - } + } + if( spec.power_max.has_value() ) { + if( spec.faction->power >= spec.power_max.value() ) { + return false; } } } From 5bc9f57977240e9f74841ca12142e53accaf8ca4 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:15:21 -0400 Subject: [PATCH 55/59] Update src/faction.cpp Co-authored-by: anothersimulacrum --- src/faction.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/faction.cpp b/src/faction.cpp index e616626c17c01..337a90b00c327 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -208,7 +208,6 @@ std::vector faction::epilogue() const return ret; } - void faction::add_to_membership( const character_id &guy_id, const std::string &guy_name, const bool known ) { From 8230dbda0565e06483e46080c42b8d94c6344df3 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:15:29 -0400 Subject: [PATCH 56/59] Update src/game.cpp Co-authored-by: anothersimulacrum --- src/game.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index 6e2c712df2e52..0c53bd851772f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3627,7 +3627,6 @@ void game::disp_NPC_epilogues() } } - void game::display_faction_epilogues() { for( const auto &elem : faction_manager_ptr->all() ) { From 0bef3629b02fdd92639191497f6f3ab057ead5b0 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:15:36 -0400 Subject: [PATCH 57/59] Update src/faction.h Co-authored-by: anothersimulacrum --- src/faction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faction.h b/src/faction.h index 857b567daf62f..25c3ee5f8c515 100644 --- a/src/faction.h +++ b/src/faction.h @@ -161,7 +161,7 @@ class faction : public faction_template std::string describe() const; - bool check_relations( std::vector jo ) const; + bool check_relations( const std::vector &faction_power_specs ) const; std::vector epilogue() const; std::string food_supply_text(); From 1dd469dd7074ec2d58c11e7c492ef3c638ae5735 Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:26:32 -0400 Subject: [PATCH 58/59] Update factions.json --- data/json/npcs/factions.json | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/data/json/npcs/factions.json b/data/json/npcs/factions.json index e53c8af298091..a6db1f630c07f 100644 --- a/data/json/npcs/factions.json +++ b/data/json/npcs/factions.json @@ -431,9 +431,7 @@ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 }, - { "faction": "robofac", "power_min": 150 }, - { "faction": "exodii", "power_min": 150 }, - { "faction": "the_great_library", "power_min": 150 } + { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_150_OG" }, @@ -446,9 +444,7 @@ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 }, - { "faction": "robofac", "power_min": 150 }, - { "faction": "exodii", "power_min": 150 }, - { "faction": "the_great_library", "power_min": 150 } + { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_tacoma_commune_revolt_OG" } @@ -761,9 +757,7 @@ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_min": 150 }, - { "faction": "robofac", "power_min": 150 }, - { "faction": "exodii", "power_min": 150 }, - { "faction": "the_great_library", "power_min": 150 } + { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_isherwoods_OG_FM" }, @@ -773,9 +767,7 @@ { "faction": "old_guard", "power_min": 150 }, { "faction": "tacoma_commune", "power_min": 150 }, { "faction": "free_merchants", "power_max": 150 }, - { "faction": "robofac", "power_min": 150 }, - { "faction": "exodii", "power_min": 150 }, - { "faction": "the_great_library", "power_min": 150 } + { "faction": "robofac", "power_min": 150 } ], "id": "epilogue_faction_isherwoods_OG" }, From 7b6af248437c5714ba08e1c6b158beb030210710 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:18:59 -0500 Subject: [PATCH 59/59] Apply suggestions from code review --- data/json/snippets/epilogue_factions.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/json/snippets/epilogue_factions.json b/data/json/snippets/epilogue_factions.json index 866e43247f390..37c0e5ead4e98 100644 --- a/data/json/snippets/epilogue_factions.json +++ b/data/json/snippets/epilogue_factions.json @@ -25,7 +25,7 @@ }, { "id": "epilogue_faction_your_followers_OG", - "text": " The soldiers of the Old Guard will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend will forever be entwined with the national mythos, your likeness etched in marble at the heart of New Washington…" + "text": " The soldiers of the Old Guard will not forget you. In bringing together the survivors of the Cataclysm, you have sown the seeds for a new birth of Freedom. For this, your legend will survive as long as the Old Guard does…" }, { "id": "epilogue_faction_old_guard_0", @@ -37,7 +37,7 @@ }, { "id": "epilogue_faction_old_guard_thrive", - "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag. In the coming decades, the Old Guard were able to reconnect much of New England and beyond, their dreams for the future buoyed by the memory of the past." + "text": " The steadfastness of individual survivors after the Cataclysm impressed the tattered remains of the once glorious union. Spurred on by numerous strategic successes, a number of operations to re-secure facilities succeeded thanks to the support of various surviving communities. While some remained cautious of submitting themselves to the Old Guard's authority, nostalgia for the old world and the promise of security from the new rallied many more to their flag.." }, { "id": "epilogue_faction_free_merchants_0", @@ -113,11 +113,11 @@ }, { "id": "epilogue_faction_robofac_thrive", - "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to begin opening up to their neighbors for help. Fortunately, the knowledge and resources they were able to source from the Exodii, and the influx of fresh recruits from organizations like the Great Library, ensured that the Hub would continue to thrive for the foreseeable future. While the researchers of the Hub would restrain themselves (or be restrained by Melchior) from engaging in the worst excesses of XEDRA, they continued to explore new ways to survive, and perhaps one day even overcome, the horrors besieging the Earth. Bionics and mutagens, reality anchors and molecular printing, the future was truly in their hands." + "text": " Melchior's enlightened leadership, backed-up with the muscle of numerous mercenary survivors, allowed Hub-01 to flourish on its' own for a time. However, while the staff of Hub-01 preferred to ignore the people of the region, the looming shortages of advanced resources and personnel forced them to expand their search for resources. By prying the secrets of CBMs from the Exodii, Hub01 was able to recruit and retain an enhanced mercenary force which proved capable of protecting them for years after the Cataclysm." }, { "id": "epilogue_faction_robofac_thrive_OG", - "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research, as well as for the legal recognition of Melchior as a fully sentient citizen." + "text": " While still technically being employees (or property, in Melchior's case) of the federal government, the staff of Hub-01 were initially very reluctant to have anything to do with the Old Guard. However, the connections and resources of the Old Guard gave them significant leverage in negotiations between the two factions. After much debate, Hub-01 would eventually vote to rejoin the government in exchange for its' support of the Hub's research." }, { "id": "epilogue_faction_isherwoods_0",