N3OW/N3OW/common/scripted_triggers/00_bastard_triggers.txt
2025-10-30 10:25:39 +00:00

234 lines
5.5 KiB
Text

should_mother_give_house_to_bastard_trigger = {
#Also governs the "should_mother_give_house_to_bastard" scripted rule
trigger_if = {
limit = { NOT = { exists = mother } }
always = no
}
trigger_else_if = {
limit = { NOT = { exists = mother.house } }
always = no
}
trigger_else_if = {
limit = { NOT = { exists = father } }
always = yes
}
trigger_else_if = {
limit = {
real_father = { is_ruler = yes }
mother = { is_ruler = no }
exists = real_father.house
}
always = no
}
trigger_else_if = {
limit = {
real_father = { is_ruler = no }
mother = { is_ruler = yes }
exists = mother.house
}
always = yes
}
trigger_else_if = {
limit = {
mother = { NOT = { exists = house } }
exists = real_father.house
}
always = no
}
trigger_else_if = {
limit = {
real_father = { NOT = { exists = house } }
exists = mother.house
}
always = yes
}
# making the default behavior explicit if no other trigger_(else_)ifs are valid
trigger_else = {
always = yes
}
}
secret_unmarried_illegitimate_child_is_valid_trigger = {
$TARGET$ = {
is_alive = yes
exists = real_father
exists = mother
NOT = { has_trait = child_of_concubine }
save_temporary_scope_as = temp_child
trigger_if = {
limit = {
exists = father
exists = scope:temp_child.real_father
}
father != scope:temp_child.real_father
}
}
}
secret_disputed_heritage_is_valid_trigger = {
$TARGET$ = { # Child
is_alive = yes
exists = real_father
exists = father
exists = mother
real_father != father
NOR = {
has_trait = bastard
has_trait = wild_oat
has_trait = legitimized_bastard
real_father = {
government_has_flag = government_is_mandala
house ?= { has_house_power_parameter = aspect_of_creation }
is_house_head = yes
}
mother = {
government_has_flag = government_is_mandala
house ?= { has_house_power_parameter = aspect_of_creation }
is_house_head = yes
}
}
}
}
bastard_secret_is_criminal = {
$TARGET$ = { save_temporary_scope_as = criminal_bastard }
$PARTICIPANT$ = { save_temporary_scope_as = criminal_participant }
OR = {
#Adultery of parent is criminal
scope:criminal_participant = {
NAND = {
government_has_flag = government_is_mandala
house ?= { has_house_power_parameter = aspect_of_creation }
is_house_head = yes
}
OR = {
trait_is_criminal_in_faith_trigger = {
FAITH = faith
TRAIT = adulterer
GENDER_CHARACTER = scope:criminal_participant
}
any_liege_or_above = {
trait_is_criminal_in_faith_trigger = {
FAITH = faith
TRAIT = adulterer
GENDER_CHARACTER = scope:criminal_participant
}
}
}
}
}
}
bastard_secret_is_shunned = {
assert_if = {
limit = { NOT = { exists = $TARGET$ } }
text = "Empty TARGET was passed to bastard_secret_is_shunned!"
}
assert_if = {
limit = { NOT = { exists = $TARGET$ } }
text = "Empty PARTICIPANT was passed to bastard_secret_is_shunned!"
}
#Saving bastard & other parent scope
$TARGET$ = { save_temporary_scope_as = bastard }
$PARTICIPANT$ = { save_temporary_scope_as = participant }
assert_if = {
limit = { NOT = { exists = scope:bastard } }
text = "scope:bastard does not exist in bastard_secret_is_shunned!"
}
assert_if = {
limit = { NOT = { exists = scope:participant } }
text = "scope:participant does not exist in bastard_secret_is_shunned!"
}
assert_if = {
limit = { NOT = { exists = scope:bastard.mother } }
text = "scope:bastard.mother does not exist in bastard_secret_is_shunned!"
}
assert_if = {
limit = { NOT = { exists = scope:bastard.real_father } }
text = "scope:bastard.real_father does not exist in bastard_secret_is_shunned!"
}
OR = {
#Bastard child: always shunned, never criminal
scope:participant = scope:bastard
#Adultery is shunned
scope:participant = {
OR = {
trait_is_shunned_in_faith_trigger = {
FAITH = faith
TRAIT = adulterer
GENDER_CHARACTER = scope:participant
}
any_liege_or_above = {
trait_is_shunned_in_faith_trigger = {
FAITH = faith
TRAIT = adulterer
GENDER_CHARACTER = scope:participant
}
}
}
}
#Either parent if incest is shunned
AND = {
# Can't have incest with only one parent!
exists = scope:bastard.real_father
exists = scope:bastard.mother
# Also the secret participant has to be one of the parents
scope:participant = {
OR = {
this = scope:bastard.mother
this = scope:bastard.real_father
}
trigger_if = {
limit = { this = scope:bastard.mother }
scope:bastard.real_father = { save_temporary_scope_as = other_parent }
}
trigger_else = {
scope:bastard.mother = { save_temporary_scope_as = other_parent }
}
# Check if the relation would be incestuous in my faith or my liege's faith
relation_with_character_is_incestuous_in_faith_trigger = {
CHARACTER = scope:other_parent
FAITH = scope:participant.faith
}
any_liege_or_above = {
save_temporary_scope_as = liege_or_above
scope:participant = {
relation_with_character_is_incestuous_in_faith_trigger = {
CHARACTER = scope:other_parent
FAITH = scope:liege_or_above.faith
}
}
}
}
}
}
NOT = {
bastard_secret_is_criminal = {
TARGET = scope:bastard
PARTICIPANT = scope:participant
}
}
}
has_any_bastard_trait_trigger = {
OR = {
has_trait = wild_oat
has_any_negative_bastard_trait_trigger = yes
}
}
has_any_negative_bastard_trait_trigger = {
OR = {
has_trait = bastard
has_trait = legitimized_bastard
has_trait = disputed_heritage
}
}