Skip to content

Commit f45e2cc

Browse files
Merge pull request #2080 from EaW-Team/general-dev
2.5.0.3
2 parents e4e7cae + 8f448c2 commit f45e2cc

368 files changed

Lines changed: 8804 additions & 5391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DecisionImminentWarDeclaration.py

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
from codecs import open
2+
import sys
3+
from os import listdir
4+
import time
5+
import os
6+
import re
7+
8+
complete_effect = "eaw_alert_send_imminent_declaration_of_war"
9+
complete_effect_var = "temp_target"
10+
remove_effect = "eaw_clear_alert_imminent_declaration_of_war"
11+
remove_effect_var = "temp_target"
12+
complete_effect_targeted = "eaw_alert_send_imminent_declaration_of_war_FROM"
13+
remove_effect_targeted = "eaw_clear_alert_imminent_declaration_of_war_FROM"
14+
15+
def decision_improved(cpath):
16+
17+
timestart = time.time()
18+
19+
# Thanks Yard Very Cool
20+
for filename in listdir(os.path.join(cpath, "common", "decisions")):
21+
22+
# listdir also provides directories and this is very annoying thank you very much
23+
if 'categories' in filename:
24+
continue
25+
26+
# We gottem boys
27+
# This check is here because sometimes smart people put other files in this directory
28+
if ".txt" in filename:
29+
# Open that sucker right up
30+
with open(os.path.join(cpath, "common", "decisions", filename), 'r', 'utf-8') as file:
31+
32+
# Because this scripts hates empty files, we just ignore all that are below 100 bytes
33+
if os.path.getsize(os.path.join(cpath, "common", "decisions", filename)) < 100:
34+
continue
35+
36+
# Get them lines
37+
lines = file.readlines()
38+
39+
# This is the var that indicates the bracket level
40+
level = 0
41+
42+
# The dictionary that will hold all our stuff
43+
found_decisions = {} # Numbers denote line numbers: decision_name: [complete_effect, remove_effect, timeout_effect, targeted_decision_bool]
44+
45+
#Initialise the latest found to an unreachable value
46+
latest_found = -1
47+
48+
# Loop over all lines this file to detect where the decisions are
49+
for line_number, line in enumerate(lines):
50+
51+
# If the line is a comment, we skip it, and if it contains a comment, strip it out
52+
if '#' in line:
53+
if line.strip().startswith("#") is True:
54+
continue
55+
else:
56+
line = line.split('#')[0]
57+
58+
# Check for a ={ and the right level denoting a new decision
59+
if ('= {' in line or '={' in line) and level == 1:
60+
61+
# Keep track of the latest decision found
62+
latest_found = line_number
63+
# Add a default reference to this decision
64+
#[complete_effect line, remove_effect/timeout_effect line, war target lines, is targeted, has complete_effect, has effects, should change]
65+
found_decisions[line_number] = [0, 0, [], False, False, False, False]
66+
67+
if latest_found in found_decisions:
68+
if 'complete_effect' in line:
69+
found_decisions[latest_found][0] = line_number
70+
found_decisions[latest_found][4] = True
71+
72+
elif 'remove_effect' in line or 'timeout_effect' in line:
73+
found_decisions[latest_found][1] = line_number
74+
75+
elif 'war_with_on_remove' in line or 'war_with_target_on_remove' in line or 'war_with_target_on_timeout' in line or 'war_with_on_timeout' in line:
76+
target = line.split('=')[1].strip()
77+
if target != "yes":
78+
found_decisions[latest_found][2].append(target)
79+
found_decisions[latest_found][6] = True
80+
81+
elif 'target_trigger' in line or 'targets' in line or 'target_array' in line:
82+
found_decisions[latest_found][3] = True
83+
84+
#Ignore the decision if it already has the scripted effects
85+
elif complete_effect in line or complete_effect_targeted in line or remove_effect in line or remove_effect_targeted in line:
86+
found_decisions[latest_found][5] = True
87+
88+
#If the decision has no complete_effect we'll insert it right before the decision ends
89+
if ('}' in line) and level == 2:
90+
if found_decisions[latest_found][0] == 0:
91+
found_decisions[latest_found][0] = line_number-1
92+
93+
if '{' in line:
94+
level += line.count('{')
95+
if '}' in line:
96+
level -= line.count('}')
97+
98+
99+
if found_decisions == {}:
100+
continue
101+
102+
found_decisions_filtered = {}
103+
for key, value in found_decisions.items():
104+
# Check if key is even then add pair to new dictionary
105+
if value:
106+
found_decisions_filtered[key] = value
107+
108+
found_decisions = found_decisions_filtered
109+
110+
id = ""
111+
index = [-1, -1, [], False, False, False, False]
112+
113+
main_line_numbers = list(found_decisions.keys())
114+
115+
skip_next = False
116+
117+
with open(os.path.join(cpath, "common", "decisions", filename), 'w', 'utf-8') as outputfile:
118+
outputfile.truncate()
119+
120+
for line_number, line in enumerate(lines):
121+
122+
if skip_next:
123+
skip_next = False
124+
continue
125+
126+
if line.strip().startswith('#'):
127+
outputfile.write(line)
128+
continue
129+
130+
replacement_text = line
131+
132+
#For neatness we want to insert the code under any logs
133+
134+
if (line_number in main_line_numbers) and not found_decisions[line_number][5] and found_decisions[line_number][6]:
135+
index = found_decisions[line_number]
136+
137+
#Add to complete_effect
138+
elif line_number == index[0]:
139+
if line_number < (len(lines) - 1) and "log" in lines[line_number + 1]:
140+
replacement_text = replacement_text + lines[line_number + 1]
141+
skip_next = True
142+
insertion_text = ""
143+
if index[3]:
144+
insertion_text = complete_effect_targeted + " = yes"
145+
else:
146+
for tag in index[2]:
147+
insertion_text += "set_temp_variable = { " + complete_effect_var + " = " + tag + " }\n\t\t\t" + complete_effect + " = yes\n\t\t\t"
148+
if not index[4]:
149+
insertion_text = "\n\t\tcomplete_effect = {\n\t\t\t" + insertion_text + "\n\t\t}\n"
150+
replacement_text = replacement_text + insertion_text
151+
else:
152+
if '}' in line:
153+
replacement_text = replacement_text.split('}')[0] + "\t\t\t" + insertion_text + "\n\t\t}\n"
154+
else:
155+
replacement_text = replacement_text + "\t\t\t" + insertion_text + "\n"
156+
157+
#Add to remove_effect or timeout_effect
158+
elif line_number == index[1]:
159+
if line_number < (len(lines) - 1) and "log" in lines[line_number + 1]:
160+
replacement_text = replacement_text + lines[line_number + 1]
161+
skip_next = True
162+
insertion_text = ""
163+
if index[3]:
164+
insertion_text = remove_effect_targeted + " = yes"
165+
else:
166+
for tag in index[2]:
167+
insertion_text += "set_temp_variable = { " + remove_effect_var + " = " + tag + " }\n\t\t\t" + remove_effect + " = yes\n\t\t\t"
168+
if '}' in line:
169+
replacement_text = replacement_text.split('}')[0] + "\t\t\t" + insertion_text + "\n\t\t}\n"
170+
# # # else:
171+
replacement_text = replacement_text + "\t\t\t" + insertion_text + "\n"
172+
173+
outputfile.write(replacement_text)
174+
175+
return time.time() - timestart
176+
177+
178+
def main():
179+
cpath = os.path.dirname(os.path.realpath(__file__))
180+
181+
ttime = 0
182+
ttime += decision_improved(cpath)
183+
print("Total Time: %.3f ms" % (ttime * 1000))
184+
185+
if __name__ == "__main__":
186+
main()

changelog.txt

Lines changed: 175 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,178 @@
1-
🔥 “Scorched Earth” 2.5.0.2 🌋
1+
🔥 “Scorched Earth” 2.5.0.3 🌋
2+
✢ Additions:
3+
- Added background flags for capitulation messages.
4+
- Implemented automated alert for imminent declaration of war from decisions.
5+
- Added more jungle terrain in northern Zebrica.
6+
- Abyssinia:
7+
- New icons for all concerns/designers/MIOs.
8+
- Adelart:
9+
- Now starts with irregulars technology.
10+
- Austral Protectorate:
11+
- Added a capitulation quote.
12+
- Bronzehill:
13+
- Added a story event for Copperhill.
14+
- Colthage:
15+
- Added two military factories and three civilian factories at the start.
16+
- Added a new icon for a starting national spirit.
17+
- Equestria:
18+
- Added a couple of rivers.
19+
- Hippogriffia:
20+
- Added response events for Crack Lightning about their request for the Summer Islands.
21+
- Lake City:
22+
- Added a new advisor.
23+
- Lan Kir:
24+
- Added a new hill range running the length of Lan Kir.
25+
- Added a new river running from Solstice to the sea.
26+
- Added a starting fort in Solstice.
27+
- Added the "Anti-Nirik Coalition" crisis mission.
28+
- Added a flavour event.
29+
- Longsword:
30+
- Added a new Riverlands formable.
31+
- Pingland:
32+
- Added some lakes and rivers.
33+
- Zeblu:
34+
- Added a supply hub.
35+
✢ Changes:
36+
- The decisions to raise tribal warbands during the Southeast Equestrian civil war has been changed. Now, if you lose control of the state that you were recruiting in, you will not lose the ability to recruit from other states.
37+
- Special Project facilities are now locked behind Science Base rather than Society Development.
38+
- Made Aquileia formable visible by default.
39+
- Sombra and the Sirens will no longer avenge the Canterlot Wedding.
40+
- Modified the planes that Celestial Resistance, Lunar Military Administration and Aztlan Provisional Government get from the air force tree back to 150 early fighters. This now correctly shows the tooltip.
41+
- Taking control of the Golden City now gives you the national spirit that Talarayi has at the start.
42+
- The Golden City of Tampuk now gets properly destroyed.
43+
- Renamed Appleloosian Protectorate to Mild West Protectorate.
44+
- Crystal Mountains prospecting decisions now target Quartz Piedmont instead because the former is impassable.
45+
- Abyssinia:
46+
- Prevented from declaring war on Maregypt before resolving the Manedalusia dispute first.
47+
- Angriver:
48+
- Ranger divisions are now rangers if NCNS is enabled, otherwise they are mountaineers.
49+
- Aquileia:
50+
- Now adds Tarrin to faction if joining their war against Francistria.
51+
- Austurland:
52+
- Replaced a national spirit icon.
53+
- Aztlan:
54+
- Added a bypass for a focus if all states have infrastructure.
55+
- Nerfed Aztlan's supply consumption debuffs by 15% on the right army path.
56+
- Modified weights to give AI Equestria a higher chance at not choosing to instantly kill Aztlan.
57+
- Star Dash now gives 0.2 Air XP as an air advisor.
58+
- Reduced industrial bonuses across the board in the industry and political tree (left side only).
59+
- Allowed to continue the defensive path if Equestria decides to not let them in the faction. Alternatively, the player can still decide to attack Equestria.
60+
- Changed the effects of an event. Players will not longer be able to do the rebellion path as Caballeron if they are rejected from joining the UPA by Equestria.
61+
- Redrawn portrait for Tailcoatl.
62+
- Bronzehill:
63+
- Reduced the bonus from the national spirit "Death To The Traitors" in the revenge path.
64+
- The event about the Imperial Service proclamation now adds some ponypower to account for the griffons deemed loyal.
65+
- The national spirit "Our Natural Terrain" now only applies to mountaineers but is slightly stronger.
66+
- Celestial Resistance:
67+
- The AI no longer joins the South Confederate States faction if Equestria exists and is harmonic.
68+
- Colthage:
69+
- Improved Colthage AI to not send volunteers.
70+
- GUI Facelift for Colthage's trading mechanic.
71+
- Coltva:
72+
- Adjusted GUI for Zarishat's prefectures.
73+
- Equestria:
74+
- Updated the portrait of Sunrise Moonshadow.
75+
- Francistria:
76+
- Now gets fascist coup if the Wingbardian Social Republic appears.
77+
- Griffonian Empire:
78+
- Swapped some post-coronation national spirit icons.
79+
- Griffonian Republic:
80+
- Monarchist Cloudbury can no longer bend the knee to a communist Griffonian Empire.
81+
- Lan Kir:
82+
- Reworked puppet flags for Taungpau and Llambet.
83+
- Made Solstice urban terrain with increased victory point value.
84+
- Increased Orchid victory point value.
85+
- The award "Statistically Significant" now only requires 10 mil casualties.
86+
- Made recruit special forces support company decisions mutually exclusive.
87+
- Longsword:
88+
- Lemiamas Šuolis mission doesn't cancel on war anymore.
89+
- Lushi:
90+
- Removed bandit game rule.
91+
- Maglibing:
92+
- Moved capital victory point and supply hub to the river.
93+
- New Mareland:
94+
- White peace decision now requires war to have lasted at least six months.
95+
- Pingland:
96+
- Changed shapes of some states.
97+
- Wittenland:
98+
- Evacuating Barrad now empties it more thoroughly.
99+
- Yale:
100+
- Reduced the production efficiency nerf and increased the infantry equipment production boost from the focus "Arcturian insights".
101+
- Zarantia:
102+
- Can now sign a peace with Hippogriffia if they have taken all states in continental North Zebrica.
103+
- Zongo:
104+
- Bypass a focus if you don't own the required DLC.
105+
- Changed where certain units spawn.
106+
- Moved some steel to Zuba.
107+
- More steel from a focus.
108+
- Poverty doesn't try increasing once already at extreme.
109+
- Remove war check from Zaikiria partition focus.
110+
✢ Fixes:
111+
- Fixed "Stop Extremism" faction manifest.
112+
- Faction battalion count goal fixes.
113+
- Capitulation message popup now resets its position after being moved around.
114+
- Fixed Chisimbi war declaration decisions not warning the target about war properly.
115+
- Fixed the Chisimbi decision "End the Unification Wars" accidentally appearing twice.
116+
- Fixed a missing generic focus icon.
117+
- Fixed formats of some flags.
118+
- Improved AI logic when disbanding excess divisions.
119+
- Fixed an effect disbanding units causing some countries to get numerous random division templates.
120+
- Removed all collection unit counts from faction goals. This should fix some common crashes.
121+
- Abyssinia:
122+
- Fixed issues with Patriotic Revolt cosmetic tags.
123+
- Remove Manedalusia wargoal after white peace for King Gomez.
124+
- Fixed Manedalusia war white peace for the communist path.
125+
- Angriver:
126+
- Fixed a railway from a focus not connecting hubs properly.
127+
- Aquileia:
128+
- Fixed political power cost for Lionella Brochard advisor.
129+
- Fixed decision to declare war sometimes not appearing.
130+
- Aztlan:
131+
- Fixed edge case where the country is puppeted by Equestria and could not complete its tree.
132+
- Fixed equipment being targeted to the Celestial Resistance.
133+
- Fixed an event not removing the correct stage of a national spirit.
134+
- Fixed a focus bypass check.
135+
- Fixed Daring Do being recruited in the event if you have already decided to go with the rebellion subroute.
136+
- Fixed Equestria demanding subjugation of Aztlan while they were in the faction.
137+
- Union with southwest now requires both Aztlan and the South Confederate States to be independent.
138+
- Bronzehill:
139+
- Barnaby's focus tree now accounts for Cloudbury bending the knee.
140+
- Can now properly access its army tree when puppeted by Grover II.
141+
- Celestial Resistance:
142+
- Fixed gamerules not working properly always.
143+
- Changeling Lands:
144+
- Can no longer puppet the Polar Bears while being a puppet themselves.
145+
- Colthage:
146+
- Coltdar war focuses now take into account if Zrumqi is owned by a puppeted Coltva.
147+
- Flowena:
148+
- Supremacy path no longer gets duplicate Aquileian designers at the end.
149+
- Francistria:
150+
- Prevented fascist path from getting stuck at war with Verenian countries that it can't reach.
151+
- Griffonian Empire:
152+
- The AI no longer avoids Vedina war focus if it is stuck at war with Haukland.
153+
- Imba-Zaru:
154+
- Properly use the secondary species logic for getting generic griffons.
155+
- Katerin:
156+
- Princess Diellza is now properly assigned as female.
157+
- Katzennia:
158+
- Fixed Kattail getting massive bonuses from positive food after world embargo event fires.
159+
- Fixed Kattail's dam modifier overflowing.
160+
- Kiria:
161+
- Fixed missing tooltip.
162+
- Lan Kir:
163+
- Fixed a minor bug with the Quadripartition.
164+
- Fixed decision to puppet remnants.
165+
- Polar Bear Communities:
166+
- Fixed some icons not working.
167+
- Warzena:
168+
- The focus "Propose an alliance" now requires Hippogriffia to be harmonic.
169+
- Yale:
170+
- Karl Legreif will now no longer start with the trait "Union Chairgriff", but rather gain it through the focus "The Trade Unions".
171+
- Dehumanized some GFX.
172+
- Miscellaneous bugfixes and improvements.
173+
- Miscellaneous localisation fixes.
174+
175+
🔥 “Scorched Earth” 2.5.0.2 🌋
2176
✢ Additions:
3177
- New cosmetic tags for Chisimbi unifiers.
4178
- New equipment icons for Stalliongrad, Equestria and related countries.

common/achievements/eaw_achievements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ of_statistical_significance = {
886886
happened = {
887887
custom_trigger_tooltip = {
888888
tooltip = KXN_Statistical_Significance_Req
889-
check_variable = { KXN.inflicted_casualties > 20000 }
889+
check_variable = { KXN.inflicted_casualties > 10000 }
890890
}
891891
}
892892
}

0 commit comments

Comments
 (0)