This commit is contained in:
Fishedotjpg 2026-11-19 03:52:08 +00:00
parent f866dd83d0
commit 05d852ffc5
4 changed files with 314 additions and 54 deletions

View file

@ -105,6 +105,18 @@ peasant_faction = {
}
on_creation = {
random_faction_county_member = {
save_scope_as = founding_county
}
set_variable = {
name = faction_culture
value = scope:founding_county.culture
}
set_variable = {
name = faction_faith
value = scope:founding_county.faith
}
}
on_destroy = {
@ -119,6 +131,7 @@ peasant_faction = {
if = {
#Verify that the title exists before trying to destroy it
limit = {
is_alive = yes
has_variable = peasant_title
exists = this.var:peasant_title
NOT = { has_variable = peasant_war_escalates }
@ -152,17 +165,35 @@ peasant_faction = {
county_join_score = {
base = 0
compare_modifier = {
desc = "FACTION_REASON_COUNTY_OPINION"
value = county_opinion
desc = "FACTION_REASON_POPULAR_OPINION"
value = popular_opinion
multiplier = -1.0
}
compare_modifier = {
desc = "FACTION_REASON_HIGH_COUNTY_CONTROL"
value = faction_county_high_control_suppression
multiplier = -1.0
}
compare_modifier = {
desc = "FACTION_REASON_STATIONED_GARRISON"
value = faction_county_garrison_suppression
multiplier = -1.0
}
modifier = {
desc = "FACTION_REASON_PREFER_BURGHER_FACTION"
add = -50
burgher_county_has_own_faction_option_trigger = yes
}
# If a suitable Popular Faction exists, perfer to join it instead.
modifier = {
desc = "FACTION_REASON_PREFER_POPULIST_FACTION"
add = -10
AND = {
county_opinion <= -15
popular_opinion <= -15
scope:faction.faction_target = {
top_liege = {
any_targeting_faction = {
@ -209,7 +240,7 @@ peasant_faction = {
# Defiant Ambushers
modifier = {
add = 25
county_opinion < 0
popular_opinion < 0
culture != scope:faction.faction_target.culture
scope:root.culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common }
}
@ -333,7 +364,7 @@ peasant_faction = {
modifier = {
desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY"
add = 25
county_opinion < 0
popular_opinion < 0
scope:faction.faction_target = {
top_participant_group:dynastic_cycle ?= {
has_participant_group_parameter = dynastic_cycle_more_peasant_factions
@ -344,7 +375,7 @@ peasant_faction = {
modifier = {
desc = "FACTION_REASON_POPULIST_PEASANT_MORE_LIKELY"
add = 25
county_opinion < 0
popular_opinion < 0
faith != scope:faction.faction_target.faith
rite = {
rite_has_parameter = peasant_and_populist_factions_more_common
@ -353,22 +384,40 @@ peasant_faction = {
}
county_create_score = {
base = 0
base = -15
####
# AI Modifiers
####
compare_modifier = {
value = county_opinion
value = popular_opinion
multiplier = -1.0
}
compare_modifier = {
desc = "FACTION_REASON_HIGH_COUNTY_CONTROL"
value = faction_county_high_control_suppression
multiplier = -1.0
}
compare_modifier = {
desc = "FACTION_REASON_STATIONED_GARRISON"
value = faction_county_garrison_suppression
multiplier = -1.0
}
modifier = {
desc = "FACTION_REASON_PREFER_BURGHER_FACTION"
add = -50
burgher_county_has_own_faction_option_trigger = yes
}
# If a suitable Popular Faction exists, perfer to join it instead.
modifier = {
add = -10
AND = {
county_opinion <= -15
popular_opinion <= -15
scope:target = {
top_liege = {
any_targeting_faction = {
@ -416,7 +465,7 @@ peasant_faction = {
# Defiant Ambushers
modifier = {
add = 25
county_opinion < 0
popular_opinion < 0
culture != scope:target.culture
culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common }
}
@ -512,7 +561,7 @@ peasant_faction = {
modifier = {
desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY"
add = 25
county_opinion < 0
popular_opinion < 0
scope:target = {
top_participant_group:dynastic_cycle ?= {
has_participant_group_parameter = dynastic_cycle_more_peasant_factions
@ -522,7 +571,7 @@ peasant_faction = {
# Pure Land
modifier = {
add = 25
county_opinion < 0
popular_opinion < 0
faith != scope:target.faith
rite = {
rite_has_parameter = peasant_and_populist_factions_more_common
@ -561,6 +610,8 @@ peasant_faction = {
}
trigger_else = { holder = scope:faction.faction_target }
burgher_county_faction_on_cooldown_trigger = no
title_province = {
NOR = {
has_holding_type = nomad_holding
@ -604,6 +655,8 @@ peasant_faction = {
NOT = { scope:target = { immune_to_factions_trigger = yes } }
}
burgher_county_faction_on_cooldown_trigger = no
title_province = {
NOR = {
has_holding_type = nomad_holding