Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jvhemmer authored Jun 4, 2024
1 parent ab715c2 commit 001a1f7
Show file tree
Hide file tree
Showing 6 changed files with 292 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace = slower_colonization

slower_colonization_mod_disp = { } # Removing this makes the modifier not appear in the Government screen

slower_colonization = { global_colonial_growth = 0.001 }

slower_colonization_0.1 = { global_colonial_growth = -0.1 }
slower_colonization_0.2 = { global_colonial_growth = -0.2 }
slower_colonization_0.4 = { global_colonial_growth = -0.4 }
slower_colonization_0.8 = { global_colonial_growth = -0.8 }
slower_colonization_1.6 = { global_colonial_growth = -1.6 }
slower_colonization_3.2 = { global_colonial_growth = -3.2 }
slower_colonization_6.4 = { global_colonial_growth = -6.4 }
slower_colonization_12.8 = { global_colonial_growth = -12.8 }
slower_colonization_25.6 = { global_colonial_growth = -25.6 }
slower_colonization_51.2 = { global_colonial_growth = -51.2 }
slower_colonization_102.4 = { global_colonial_growth = -102.4 }
slower_colonization_204.8 = { global_colonial_growth = -204.8 }
slower_colonization_409.6 = { global_colonial_growth = -409.6 }
slower_colonization_819.2 = { global_colonial_growth = -819.2 }
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# $name$ represents slower_colonization
# $variable$ represents current_colonial_growth
# $scope$ represents country
# $value$ is the amount of the modifier to add

remove_colonization_modifier = {
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=819.2 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=409.6 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=204.8 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=102.4 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=51.2 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=25.6 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=12.8 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=6.4 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=3.2 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=1.6 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=0.8 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=0.4 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=0.2 }
remove_colonization_modifier_helper = { name=$name$ scope=$scope$ value=0.1 }
}

remove_colonization_modifier_helper = {
# Remove the modifier if it is already set (so we don't apply the same again)
if = {
limit = {
has_$scope$_modifier = $name$_$value$
}
remove_$scope$_modifier = $name$_$value$
}
}

refresh_binary_colonization_modifier = {
if = {
limit = {
# Check if calculated debuff is at least 0.1
check_variable = {
which = $variable$
value = 0.1
}
}

# Save the actual value of the calculate debuff
set_variable = {
which = temp
which = $variable$
}

refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=819.2 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=409.6 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=204.8 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=102.4 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=51.2 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=25.6 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=12.8 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=6.4 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=3.2 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=1.6 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=0.8 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=0.4 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=0.2 }
refresh_binary_colonization_modifier_helper = { name=$name$ variable=$variable$ scope=$scope$ value=0.1 }

set_variable = {
which = temp
value = 0
}
}
else = {
remove_$scope$_modifier = $name$
}
}

refresh_binary_colonization_modifier_helper = {
# Check if the calculated debuff is higher or equal to $value$
if = {
limit = {
check_variable = {
which = $variable$
value = $value$
}
}

# If it is, subtract $value$ from it
subtract_variable = {
which = $variable$
value = $value$
}

# And then apply $value$ amount of debuff
add_$scope$_modifier = {
name = $name$_$value$
duration = -1
hidden = yes
}
}
}
9 changes: 9 additions & 0 deletions slower_colonization/descriptor.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version="1.0"
tags={
"Balance"
"Gameplay"
"Historical"
}
name="Slower Colonization"
supported_version="v1.37.*"
remote_file_id="3255929828"
144 changes: 144 additions & 0 deletions slower_colonization/events/slower_colonization_event.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
namespace = slower_colonization

country_event = {
id = slower_colonization.1
title = slower_colonization.1.t
desc = slower_colonization.1.desc
picture = COLONIZATION_eventPicture

hidden = yes

# Triggers if either the country has never had this modifier, or if it has been more than a year ago since it fired
trigger = {
AND = {
is_month = 0

OR = {
had_country_flag = {
flag = slower_colonization_timer
days = 365 }

NOT = {
has_country_flag = slower_colonization_timer
}
}
}
}

# When triggered, effect will be applied almost instantaneously
mean_time_to_happen = {
days = 1
}

option = {
# Remove the flag (in case it was already there)
clr_country_flag = slower_colonization_timer

# Add the flag
set_country_flag = slower_colonization_timer

# Remove the old modifiers before checking again
remove_colonization_modifier = {
name = slower_colonization
scope = country
}

export_to_variable = {
which = current_colonial_growth
value = modifier:global_colonial_growth
}

# The modifier global_colonial_growth does not include the amount provided by technologies, so it has to be added manually to the calculation
# Tech 1
if = {
limit = { dip_tech = 1 }

change_variable = {
which = current_colonial_growth
value = 10
}
}

# Tech 3
if = {
limit = { dip_tech = 3 }

change_variable = {
which = current_colonial_growth
value = 15
}
}

# Tech 10
if = {
limit = { dip_tech = 10 }

change_variable = {
which = current_colonial_growth
value = 10
}
}

# Tech 15
if = {
limit = { dip_tech = 15 }

change_variable = {
which = current_colonial_growth
value = 15
}
}

# Tech 23
if = {
limit = { dip_tech = 23 }

change_variable = {
which = current_colonial_growth
value = 25
}
}

# Tech 26
if = {
limit = { dip_tech = 23 }

change_variable = {
which = current_colonial_growth
value = 25
}
}

# Tech 32
if = {
limit = { dip_tech = 32 }

change_variable = {
which = current_colonial_growth
value = 50
}
}

# Multiply the countries Global Settler Increase by 0.5
multiply_variable = {
which = current_colonial_growth
value = 0.5 }

# Clean up by deleting the temporary variable
set_variable = {
which = temp
value = 0
}

# Execute binary modifier script
refresh_binary_colonization_modifier = {
name = slower_colonization
variable = current_colonial_growth
scope = country
}

ai_chance = {
factor = 1
}
}
}
22 changes: 22 additions & 0 deletions slower_colonization/localisation/slower_colonization_l_english.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
l_english:
slower_colonization.1.t:0 "Slower Colonization Triggered!"
slower_colonization.1.desc:0 "Colonization debuff applied."
slower_colonization.1.a:0 "Sounds good."

slower_colonization: "Slower Colonization"
slower_colonization_0.1: "Slower Colonization"
slower_colonization_0.2: "Slower Colonization"
slower_colonization_0.4: "Slower Colonization"
slower_colonization_0.8: "Slower Colonization"
slower_colonization_1.6: "Slower Colonization"
slower_colonization_3.2: "Slower Colonization"
slower_colonization_6.4: "Slower Colonization"
slower_colonization_12.8: "Slower Colonization"
slower_colonization_25.6: "Slower Colonization"
slower_colonization_51.2: "Slower Colonization"
slower_colonization_102.4: "Slower Colonization"
slower_colonization_204.8: "Slower Colonization"
slower_colonization_409.6: "Slower Colonization"
slower_colonization_819.2: "Slower Colonization"

desc_slower_colonization: "Slower Colonization Debuff: §G+[Root.modifier_var.GetValue]¤§!"
Binary file added slower_colonization/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 001a1f7

Please sign in to comment.