Skip to content

Commit

Permalink
Moved flag change to event, get the opportunity to change every time …
Browse files Browse the repository at this point in the history
…you go republican or change republic type

Credits must be given to the VTM Spain author, who wrote this in their on_law_activated documentation;
# root = ??????????????????
# DOCUMENTATION SAYS COUNTRY BUT ITS LAW
# WHY DO YOU LIE????????????
# WHY???

Without that I would've been lost. o7
  • Loading branch information
Danarca committed Jan 27, 2025
1 parent cc8a897 commit f07d5e1
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 11 deletions.
31 changes: 31 additions & 0 deletions common/decisions/imperia_british_flag_decisions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
change_british_flag = {
is_shown = {
root ?= c:GBR
has_variable = can_change_british_flag
}
possible = {
OR = {
has_law = law_type:law_parliamentary_republic
has_law = law_type:law_presidential_republic
}
}
when_taken = {
remove_variable = can_change_british_flag
trigger_event = {
id = british_republican_flag_events.1
popup = yes
}
}
ai_chance = {
base = 0
# AI will only do if flag haven't been set before
modifier = {
trigger = {
NOT = {
has_variable = british_republican_flag_variant
}
}
add = 100
}
}
}
20 changes: 20 additions & 0 deletions common/on_actions/imperia_index_on_actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ on_diplo_play_back_down = {
}
}

# Root owner Country of the Law
# executed when the law is activated for any reason. It's usually because it
# has been enacted, but script can activate laws directly without going through
# the enactment process. Normally, it's immediately preceded by
# on_law_enactment_ended, but if a law is directly set by script, thus
# bypassing the enactment process, this will execute while
# on_law_enactment_ended will not
#
# NOTE: unlike the other on_law_<something> on-actions, at the point in time
# when this is triggered the law that was enacted is no longer considered being
# enacted. Therefore using the `currently_enacting_law` link will return the
# null law
## IMPERIA EDIT: VTM found root is actually the law, not the country
# Poor VTM guy, looks to have been a headache for him
on_law_activated = {
on_actions = {
on_imperia_law_activated
}
}

# Root = Country
# scope:target = Uprising country
on_revolution_start = {
Expand Down
20 changes: 20 additions & 0 deletions common/on_actions/imperia_on_law_activated.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# root = law
# type = law_type
# owner = the country activating the law
# Courtesy of VTMs headaches
on_imperia_law_activated = {
effect = {
if = {
limit = {
owner ?= c:GBR
OR = {
type = law_type:law_parliamentary_republic
type = law_type:law_presidential_republic
}
}
owner = {
set_variable = can_change_british_flag
}
}
}
}
1 change: 0 additions & 1 deletion common/on_actions/imperia_on_monthtly_pulse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@
}
events = {
infamy_rebalance.1 #updates provinces each month
british_republican_flag_events.1 # British republican flag event, should fire only once.
}
}

Expand Down
10 changes: 0 additions & 10 deletions events/imperia_british_republican_flag_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ british_republican_flag_events.1 = {
has_law = law_type:law_parliamentary_republic
has_law = law_type:law_presidential_republic
}
NOT = {
has_variable = british_republican_flag_variant
}
}
immediate = {
# Just to initialise so this event doesn't keep firing
set_variable = {
name = british_republican_flag_variant
value = 0
}
}
# Spartacus Union Jack (bottom blues replaced with green
option = {
Expand Down
4 changes: 4 additions & 0 deletions localization/english/imperia_misc_l_english.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
imperia_british_india_mortality_modifier: "Oppressive Agrarianization"

# British Republican flags

change_british_flag: "Adopt New Flag"
change_british_flag_desc: "Choose a new flag for the British Republic."

british_republican_flag_events.1.t: "The British Republican Flag"
british_republican_flag_events.1.desc: "The British Republican Flag will be hoisted over the capital, marking the end of the monarchy and the beginning of a new era. The flag is a symbol of the new [ROOT.GetCountry.GetNameNoFlag], and the people are proud to see it flying high. It's just...\nWhich one should we choose?"

Expand Down

0 comments on commit f07d5e1

Please sign in to comment.