Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix government parsing, add feudal theocracy, add reforms for Prussia… #11

Open
wants to merge 1 commit into
base: EU4toV2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions EU4toV2/Data_Files/governmentMapping.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

mapping = {

link = { v2 = absolute_monarchy eu4 = despotic_monarchy eu4 = feudal_monarchy eu4 = absolute_monarchy eu4 = enlightened_despotism eu4 = revolutionary_empire eu4 = theocratic_government eu4 = papal_government eu4 = monastic_order_government eu4 = steppe_horde eu4 = tribal_despotism eu4 = tribal_federation eu4 = archduchy eu4 = celestial_empire eu4 = iqta eu4 = daimyo eu4 = shogunate eu4 = imperial_government eu4 = oligarchic_republic eu4 = tribal_kingdom eu4 = ottoman_government eu4 = tsardom }
link = { v2 = absolute_monarchy eu4 = despotic_monarchy eu4 = feudal_monarchy eu4 = absolute_monarchy eu4 = enlightened_despotism eu4 = revolutionary_empire eu4 = theocratic_government eu4 = papal_government eu4 = monastic_order_government eu4 = steppe_horde eu4 = tribal_despotism eu4 = tribal_federation eu4 = archduchy eu4 = celestial_empire eu4 = iqta eu4 = daimyo eu4 = shogunate eu4 = imperial_government eu4 = oligarchic_republic eu4 = tribal_kingdom eu4 = ottoman_government eu4 = tsardom eu4 = feudal_theocracy }
link = { v2 = democracy eu4 = merchant_republic eu4 = noble_republic eu4 = administrative_republic eu4 = constitutional_republic eu4 = revolutionary_republic eu4 = tribal_democracy eu4 = ambrosian_republic eu4 = dutch_republic eu4 = american_republic eu4 = federal_republic eu4 = colonial_government eu4 = american_republic eu4 = federal_republic eu4 = tribal_council eu4 = native_council eu4 = siberian_native_council eu4 = imperial_city eu4 = trading_city eu4 = veche_republic }
link = { v2 = presidential_dictatorship eu4 = republican_dictatorship eu4 = bureaucratic_despotism }
link = { v2 = hms_government eu4 = english_monarchy eu4 = constitutional_monarchy eu4 = administrative_monarchy eu4 = elective_monarchy eu4 = principality }
link = { v2 = hms_government eu4 = english_monarchy eu4 = constitutional_monarchy eu4 = administrative_monarchy eu4 = elective_monarchy eu4 = principality eu4 = mamluk_government }
link = { v2 = prussian_constitutionalism eu4 = prussian_monarchy }
link = { v2 = proletarian_dictatorship eu4 = peasants_republic } #Dithmarschen special

Expand All @@ -39,4 +39,4 @@ link = { v2 = proletarian_dictatorship eu4 = peasants_republic } #Dithmarschen s
#link = { v2 = prussian_constitutionalism absolutism_level < 60 eu4 = english_monarchy eu4 = constitutional_monarchy eu4 = administrative_monarchy eu4 = elective_monarchy eu4 = prussian_monarchy }
#link = { v2 = absolute_monarchy absolutism_level > 60 eu4 = english_monarchy eu4 = constitutional_monarchy eu4 = administrative_monarchy eu4 = elective_monarchy eu4 = prussian_monarchy eu4 = despotic_monarchy eu4 = feudal_monarchy eu4 = absolute_monarchy eu4 = enlightened_despotism eu4 = revolutionary_empire eu4 = theocratic_government eu4 = papal_government eu4 = monastic_order_government eu4 = steppe_horde eu4 = tribal_despotism eu4 = tribal_federation eu4 = archduchy eu4 = celestial_empire eu4 = iqta eu4 = daimyo eu4 = shogunate eu4 = imperial_government eu4 = oligarchic_republic eu4 = tribal_kingdom eu4 = ottoman_government }

}
}
18 changes: 15 additions & 3 deletions EU4toV2/Source/EU4World/EU4Country.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,20 @@ EU4Country::EU4Country(Object* obj, EU4Version* version)
}
leaders.swap(activeLeaders);

vector<Object*> governmentObj = obj->getValue("government"); // the object holding the government
(governmentObj.size() > 0) ? government = governmentObj[0]->getLeaf() : government = "";
auto* governmentObj = obj->safeGetObject("government");
if (governmentObj)
{
if (governmentObj->isLeaf())
{
// Old-style government = "something"
government = governmentObj->getLeaf();
}
else
{
// New-style government = { government = something }
government = governmentObj->safeGetString("government");
}
}
if (government == "daimyo")
{
possibleDaimyo = true;
Expand Down Expand Up @@ -718,4 +730,4 @@ void EU4Country::clearProvinces()
void EU4Country::clearCores()
{
cores.clear();
}
}
13 changes: 12 additions & 1 deletion EU4toV2/Source/V2World/V2Reforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ void V2Reforms::governmentEffects(const V2Country* dstCountry)
trade_unions += 0.14;
political_parties += 1.5;
}
else if (government == "prussian_constitutionalism")
{
slavery += 0;
vote_franchise = -1;
upper_house_composition = 0;
voting_system += 1;
public_meetings += -2.5;
press_rights += -16;
trade_unions += 0;
political_parties += -4.0;
}
else
{
LOG(LogLevel::Warning) << "Undefined government type '" << government << "' while setting reforms for " << dstCountry->getTag();
Expand Down Expand Up @@ -522,4 +533,4 @@ void V2UncivReforms::output(FILE* output) const
{
fprintf(output, "foreign_navies=no_foreign_navies\n");
}
}
}