Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
improved alliance event (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johuotar authored and Idhrendur committed Jun 12, 2018
1 parent 750f042 commit 3b8dc03
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Vic2ToHoI4/Source/HOI4World/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ void HoI4::Events::createFactionEvents(std::shared_ptr<HoI4Country> Leader, std:
Event nfEvent;
nfEvent.type = "country_event";
nfEvent.id = "NFEvents." + std::to_string(nationalFocusEventNumber++);
nfEvent.title = "\"Alliance?\"";
nfEvent.descriptions.push_back("desc = \"Alliance with " + leaderName + "?\"");
nfEvent.title = "\"Alliance Offer\"";
nfEvent.descriptions.push_back("desc = \"We have been invited to an alliance with " + leaderName + ". Should we accept the invitation?\"");
nfEvent.picture = "news_event_generic_sign_treaty1";
nfEvent.majorEvent = false;
nfEvent.triggeredOnly = true;
Expand All @@ -245,6 +245,16 @@ void HoI4::Events::createFactionEvents(std::shared_ptr<HoI4Country> Leader, std:
yesOption += " }\n";
yesOption += " dismantle_faction = yes";
yesOption += " }\n";
yesOption += " if = {\n";
yesOption += " limit = {\n";
yesOption += " " + Leader->getTag() + " = {\n";
yesOption += " is_in_faction = no\n";
yesOption += " }\n";
yesOption += " }\n";
yesOption += " " + Leader->getTag() + " = {\n";
yesOption += " create_faction = " + leaderName + "\n";
yesOption += " }\n";
yesOption += " }\n";
yesOption += " " + Leader->getTag() + " = {\n";
yesOption += " add_to_faction = " + newAlly->getTag() + "\n";
yesOption += " }\n";
Expand All @@ -267,8 +277,8 @@ void HoI4::Events::createFactionEvents(std::shared_ptr<HoI4Country> Leader, std:
Event newsEventYes;
newsEventYes.type = "news_event";
newsEventYes.id = "news." + to_string(newsEventNumber);
newsEventYes.title = "\"" + newAllyName + " Now an Ally with " + leaderName + "!\"";
newsEventYes.descriptions.push_back("desc = \"They are now allies\"");
newsEventYes.title = "\"" + newAllyName + " formalizes alliance with " + leaderName + "\"";
newsEventYes.descriptions.push_back("desc = \"The leaders of both countries have announced their intent of military cooperation.\"");
newsEventYes.picture = "news_event_generic_sign_treaty1";
newsEventYes.majorEvent = true;
newsEventYes.triggeredOnly = true;
Expand All @@ -281,8 +291,8 @@ void HoI4::Events::createFactionEvents(std::shared_ptr<HoI4Country> Leader, std:
Event newsEventNo;
newsEventNo.type = "news_event";
newsEventNo.id = "news." + to_string(newsEventNumber + 1);
newsEventNo.title = "\"" + newAllyName + " Refused the Alliance offer of " + leaderName + "!\"";
newsEventNo.descriptions.push_back("desc = \"They are not allies\"");
newsEventNo.title = "\"" + newAllyName + " refuses the alliance offer of " + leaderName + "\"";
newsEventNo.descriptions.push_back("desc = \"The alliance negotiations ended in disagreement.\"");
newsEventNo.picture = "news_event_generic_sign_treaty1";
newsEventNo.majorEvent = true;
newsEventNo.triggeredOnly = true;
Expand Down
6 changes: 6 additions & 0 deletions Vic2ToHoI4/Source/HOI4World/HoI4FocusTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,12 @@ void HoI4FocusTree::addGPWarBranch(shared_ptr<HoI4Country> Home, const vector<sh
newFocus->icon = "GFX_goal_generic_allies_build_infantry";
newFocus->text = "Alliance with " + allyCountryName;
newFocus->prerequisites.push_back("= { focus = " + ideologyShort + "_Summit" + Home->getTag() + " }");
newFocus->available = "= {\n";
newFocus->available += " OR = {\n";
newFocus->available += " is_faction_leader = yes\n";
newFocus->available += " is_in_faction = no\n";
newFocus->available += " }";
newFocus->available += " }";
newFocus->xPos = nextFreeColumn + i * 2;
newFocus->yPos = 1;
newFocus->cost = 10;
Expand Down

0 comments on commit 3b8dc03

Please sign in to comment.