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

Goblin Loan Mechanic #1228

Merged
merged 5 commits into from
Oct 3, 2023
Merged
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
148 changes: 148 additions & 0 deletions common/decisions/wc_goblin_loan_decisions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
borrow_loan_goblin_decision = {
picture = "gfx/interface/illustrations/decisions/goblin_money_borrow.dds"

ai_check_interval = 24

cost = {
piety = 100
}

cooldown = { days = 3650 }

is_shown = {
is_landed = yes
highest_held_title_tier >= tier_county
exists = title:k_goblin_bankers.holder
NOR = {
exists = var:loan_amount_owed_goblins
exists = var:loan_quarters_paid
}
}

is_valid_showing_failures_only = {
is_available = yes
trigger_if = {
limit = { is_ai = yes }
gold < 100
custom_tooltip = {
text = borrow_from_goblin_bankers_gold_condition
title:k_goblin_bankers.holder = {
gold >= root.holy_order_gold_value
}
}
}
custom_tooltip = {
text = borrow_from_goblin_bankers_gold_condition2
NOT = { has_character_flag = cannot_take_goblin_loans }
}
}

effect = {
hidden_effect = {
title:k_goblin_bankers = {
holder = {
save_scope_as = recipient
}
add_to_variable_list = { name = debtor_list target = root}
}
trigger_event = goblin_loan.200
}
title:k_goblin_bankers.holder = { add_prestige = 10 }
}

ai_potential = {
always = yes
}

ai_will_do = {
base = 0
modifier = {
add = 25
has_trait = greedy
}
modifier = {
add = 5
has_trait = ambitious
}
modifier = {
add = 33
is_at_war = yes
gold < 0
}
modifier = {
add = 5
OR = {
has_trait = intellect_good_1
has_trait = intellect_good_2
has_trait = intellect_good_3
has_trait = shrewd
has_trait = architect
has_trait = administrator
}
}
}
}

##################################################
# Repay Loan Goblin version
# by Linnéa Thimrén and Mayonez_kun :)
##################################################

repay_loan_goblin_decision = {
picture = "gfx/interface/illustrations/decisions/goblin_money_borrow.dds"

ai_check_interval = 0

is_shown = {
exists = var:loan_amount_owed_goblins #loan_amount_owed
exists = var:loan_quarters_paid #loan_holder
exists = title:k_goblin_bankers.holder
}

is_valid_showing_failures_only = {
gold >= quarter_of_your_owe_plus_percent
}

effect = {
title:k_goblin_bankers.holder = {
save_scope_as = recipient
}
pay_short_term_gold = {
gold = quarter_of_your_owe_plus_percent
target = scope:recipient
}

change_variable = { name = loan_quarters_paid add = 1 }

if = {
limit = {
var:loan_quarters_paid >= 4
}
remove_variable = original_debtor
remove_variable = loan_amount_owed_goblins
remove_variable = loan_quarters_paid
title:k_goblin_bankers = {
remove_list_variable = {
name = debtor_list
target = root
}
}
if = { limit = { has_character_flag = defend_four_years } remove_character_flag = defend_four_years }
if = { limit = { has_character_flag = ask_for_time } remove_character_flag = ask_for_time }
}
else = {
add_character_flag = {
flag = defend_four_years
years = 4
}
}
}

ai_potential = {
always = yes
}

ai_will_do = {
base = 0
}
}
1 change: 1 addition & 0 deletions common/dynasties/28000_goblin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ noggenfogger = {name = "Noggenfogger" culture = goblin}
# 28128 = {name = "dynn_Mantooth" culture = goblin}
# 28129 = {name = "dynn_Rustspark" culture = goblin}
# 28130 = {name = "dynn_Megahead" culture = goblin}
28131 = {name = "dynn_Powell" culture = goblin}
18 changes: 18 additions & 0 deletions common/flavorization/wc_title_holders.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ high_priestess_kaldorei_female = {
titles = { e_kaldorei }
}

goblin_banker_male = {
type = character
gender = male
special = holder
tier = kingdom
priority = @special_prio
titles = { k_goblin_bankers }
top_liege = no
}
goblin_banker_female = {
type = character
gender = female
special = holder
tier = kingdom
priority = @special_prio
titles = { k_goblin_bankers }
top_liege = no
}
# Special cultural titles (sorted by culture, then government type).

### Orcs ###
Expand Down
15 changes: 15 additions & 0 deletions common/landed_titles/wc_titular_titles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,21 @@ e_trade_coalition = {
can_be_named_after_dynasty = no
}

k_goblin_bankers = {
color={ 43 43 43 }
definite_form = yes
ruler_uses_title_name = no
landless = yes
capital = c_mount_kajaro
ignore_titularity_for_title_weighting = yes
ai_primary_priority = {
add = 1000
}
destroy_if_invalid_heir = yes
no_automatic_claims = yes
always_follows_primary_heir = yes
}

k_steamwheedle_cartel = {
color={ 134 187 255 }

Expand Down
6 changes: 5 additions & 1 deletion common/modifiers/wc_event_modifiers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ closed_from_another_side = {
#goria_expansion = {
# icon = county_modifier_opinion_positive
# culture_conversion_speed = 0.5
#}
#}
goblin_buisness = {
icon = stewardship_positive
monthly_income = 10
}
5 changes: 5 additions & 0 deletions common/on_action/game_start.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ on_game_start_after_lobby = {
days = standard_hold_court_cooldown_time
}
}
title:k_goblin_bankers.holder = {
create_story = {
type = story_cycle_goblin_loan
}
}


#Set starting cultural acceptance
Expand Down
11 changes: 11 additions & 0 deletions common/on_action/yearly_on_actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ yearly_global_pulse = {
}
reopen_dark_portal_effect = yes
}
if = {
limit = {
exists = title:k_goblin_bankers.holder
title:k_goblin_bankers.holder = { NOT = { has_character_modifier = goblin_buisness } }
}
title:k_goblin_bankers.holder = {
add_character_modifier = {
modifier = goblin_buisness
}
}
}
}
on_actions = {
inspiration_maintenance_global_pulse
Expand Down
2 changes: 2 additions & 0 deletions common/religion/religions/secular_group.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
#Main Group
color = rgb { 255 215 20 }
icon = wcbbmw_cult_of_wealth
religious_head = k_goblin_bankers

holy_site = mount_kajaro
holy_site = wild_cape
Expand All @@ -285,6 +286,7 @@
doctrine = tenet_hedonistic
doctrine = tenet_consumerism
doctrine = tenet_legalism
doctrine = doctrine_spiritual_head

localization = {
#HighGod
Expand Down
24 changes: 24 additions & 0 deletions common/script_values/01_dynamic_values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,30 @@ holy_order_gold_value = {
max = massive_gold_max_value
}

goblin_big_loan_gold_value = {
value = holy_order_gold_value
multiply = 2
}
quarter_of_your_owe = {
value = var:loan_amount_owed_goblins
multiply = 0.25
}
quarter_of_your_owe_plus_percent = {
value = quarter_of_your_owe
add = {
value = quarter_of_your_owe
multiply = 0.25
}
}
rest_of_your_owe = {
value = var:loan_amount_owed_goblins
subtract = {
value = var:loan_amount_owed_goblins
multiply = 0.25
multiply = var:loan_quarters_paid
}
}

create_duchy_title_value = {
add = 250
multiply = {
Expand Down
35 changes: 35 additions & 0 deletions common/story_cycles/wc_story_cycle_goblin_loan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
story_cycle_goblin_loan = {
on_setup = {
}

on_end = {
}

on_owner_death = {
}

effect_group = {
years = 5

triggered_effect = {
trigger = {
exists = title:k_goblin_bankers.holder
title:k_goblin_bankers = {
has_variable_list = debtor_list
}
}
effect = {
title:k_goblin_bankers = {
every_in_list = {
variable = debtor_list
limit = { is_alive = yes }
trigger_event = {
id = goblin_loan.201
days = 1
}
}
}
}
}
}
}
34 changes: 34 additions & 0 deletions events/death_events/death_management_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,40 @@ death_management.0001 = {
}
}
}
#To make the heir inherit a loan (make them owe someone money) from goblins
if = {
limit = {
has_variable = loan_quarters_paid
has_variable = loan_amount_owed_goblins
exists = var:original_debtor
exists = title:k_goblin_bankers.holder
exists = player_heir
}
title:k_goblin_bankers = {
remove_list_variable = {
name = debtor_list
target = scope:dead_character
}
}
player_heir = {
title:k_goblin_bankers = {
add_to_variable_list = { name = debtor_list target = prev }
}
set_variable = {
name = original_debtor
value = prev.var:original_debtor
}
set_variable = {
name = loan_quarters_paid
value = root.var:loan_quarters_paid
}
set_variable = {
name = loan_amount_owed_goblins
value = root.var:loan_amount_owed_goblins
}
}

}


#SEND EVENT ABOUT DEATH
Expand Down
Loading
Loading