Skip to content

Commit

Permalink
story cycle events
Browse files Browse the repository at this point in the history
  • Loading branch information
Grekopithikos committed Sep 28, 2024
1 parent 8e5c36a commit 07048ef
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,7 @@ murders_at_court.1004 = {
any_child = {
basic_is_available_ai = yes
is_landed = no
NOT = {
is_player_heir_of_trigger = { CHARACTER = root }
}
NOT = { is_player_heir_of = root }
}
}

Expand Down Expand Up @@ -682,9 +680,7 @@ murders_at_court.1004 = {
limit = {
basic_is_available_ai = yes
is_landed = no
NOT = {
is_player_heir_of_trigger = { CHARACTER = root }
}
NOT = { is_player_heir_of = root }
}
save_scope_as = child
show_as_tooltip = {
Expand Down Expand Up @@ -1025,7 +1021,7 @@ murders_at_court.2002 = {
trigger = {
NOT = { has_character_flag = had_event_murders_at_court_2002 }
scope:story.var:murderer = {
NOT = { is_player_heir_of_trigger = { CHARACTER = root } }
NOT = { is_player_heir_of = root }
}
player_heir = {
basic_is_available_ai = yes
Expand All @@ -1047,6 +1043,7 @@ murders_at_court.2002 = {
flag = had_event_murders_at_court_2002
years = 10
}
play_music_cue = "mx_cue_succession"
scope:story = {
change_variable = {
name = escalation
Expand All @@ -1055,8 +1052,6 @@ murders_at_court.2002 = {
var:murderer = {
save_scope_as = murderer
}

play_music_cue = "mx_cue_succession"
}
add_character_flag = { #To block spam about the death
flag = sent_relevant_death_event
Expand Down Expand Up @@ -1311,6 +1306,7 @@ murders_at_court.2101 = {
flag = had_event_murders_at_court_2101
years = 10
}
play_music_cue = "mx_cue_murder"
scope:story = {
change_variable = {
name = escalation
Expand All @@ -1319,7 +1315,6 @@ murders_at_court.2101 = {
var:murderer = {
save_scope_as = murderer
}
play_music_cue = "mx_cue_murder"
}

dynasty = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,12 @@ peasant_affair.2001 = {
trigger = {
NOT = { has_character_flag = peasant_affair_already_looking }
exists = scope:story
scope:story = {
exists = var:peasant_character
var:peasant_character = {
is_alive = yes
}
}
}

immediate = {
Expand Down Expand Up @@ -755,21 +761,42 @@ peasant_affair.2002 = {
override_background = {
reference = throne_room
}
left_portrait = scope:councillor
right_portrait = scope:peasant_child
left_portrait = {
character = scope:searching_character
animation = worry
}
right_portrait = {
character = scope:peasant_child
animation = personality_coward
}

trigger = {
exists = scope:story
any_courtier = {
count >= 1
is_available_adult = yes
}
}

on_trigger_fail = {
trigger_event = peasant_affair.2004
}

immediate = {
random_councillor = {
save_scope_as = councillor
#Save our searching character
if = {
limit = {
cp:councillor_spymaster ?= { is_available_adult = yes }
}
cp:councillor_spymaster = { save_scope_as = searching_character }
}
else = {
random_courtier = {
limit = { is_available_adult = yes }
save_scope_as = searching_character
}
}
#Save the child
scope:story = {
var:peasant_character = {
save_scope_as = peasant_character
Expand All @@ -786,12 +813,7 @@ peasant_affair.2002 = {
}
}
}
if = {
limit = {
has_character_flag = peasant_affair_already_looking
}
remove_character_flag = peasant_affair_already_looking
}
remove_character_flag ?= peasant_affair_already_looking
if = {
limit = {
exists = primary_spouse
Expand Down Expand Up @@ -1007,11 +1029,10 @@ peasant_affair.2003 = {
is_alive = yes
is_ruler = no
}
is_landed = yes
}

immediate = {
remove_character_flag = is_looking_for_peasant
remove_character_flag ?= is_looking_for_peasant
scope:story = {
if = {
limit = {
Expand Down Expand Up @@ -1161,9 +1182,7 @@ peasant_affair.2003 = {
trigger = {
scope:peasant_character = { is_alive = yes }
exists = scope:peasant_child
scope:peasant_child = {
is_in_the_same_court_as = root
}
scope:peasant_child = { is_in_the_same_court_as = root }
}
if = {
limit = {
Expand Down Expand Up @@ -1256,9 +1275,7 @@ peasant_affair.2003 = {
}
custom_tooltip = peasant_affair.2003.d.tt
hidden_effect = {
scope:story = {
end_story = yes
}
scope:story = { end_story = yes }
}
stress_impact = {
compassionate = medium_stress_impact_gain
Expand All @@ -1280,14 +1297,10 @@ peasant_affair.2003 = {
trigger = {
scope:peasant_character = { is_alive = no }
exists = scope:peasant_child
scope:peasant_child = {
is_in_the_same_court_as = root
}
scope:peasant_child = { is_in_the_same_court_as = root }
}
hidden_effect = {
scope:story = {
end_story = yes
}
scope:story = { end_story = yes }
}
stress_impact = {
base = medium_stress_impact_gain
Expand Down Expand Up @@ -1328,9 +1341,7 @@ peasant_affair.2003 = {
}
}
hidden_effect = {
scope:story = {
end_story = yes
}
scope:story = { end_story = yes }
}
stress_impact = {
base = medium_stress_impact_gain
Expand Down Expand Up @@ -1379,9 +1390,7 @@ peasant_affair.2003 = {
}
}
hidden_effect = {
scope:story = {
end_story = yes
}
scope:story = { end_story = yes }
}
stress_impact = {
just = minor_stress_impact_loss
Expand Down Expand Up @@ -1421,20 +1430,18 @@ peasant_affair.2004 = {
override_background = {
reference = throne_room
}
left_portrait = scope:councillor
right_portrait = scope:peasant_child

left_portrait = {
character = root
animation = worry
}
right_portrait = {
trigger = { exists = scope:peasant_child }
character = scope:peasant_child
animation = personality_coward
}

immediate = {
random_councillor = {
save_scope_as = councillor
}
if = {
limit = {
has_character_flag = peasant_affair_already_looking
}
remove_character_flag = peasant_affair_already_looking
}
remove_character_flag ?= peasant_affair_already_looking
}

option = { #Aw darn it
Expand Down
5 changes: 2 additions & 3 deletions events/story_cycles/story_cycle_party_baron_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,6 @@ party_baron.2002 = {
################################
scripted_trigger party_baron_2003_scheme_trigger = {
scheme_type = murder
scheme_power > scheme_resistance
scheme_progress > 2
scheme_owner = {
is_ai = yes
Expand Down Expand Up @@ -886,13 +885,13 @@ party_baron.2003 = {
limit = {
any_scheme = {
scheme_type = murder
scheme_target = scope:party_baron
scheme_target_character = scope:party_baron
}
}
random_scheme = {
limit = {
scheme_type = murder
scheme_target = scope:party_baron
scheme_target_character = scope:party_baron
}
save_scope_as = my_scheme
}
Expand Down
11 changes: 9 additions & 2 deletions events/story_cycles/story_cycle_pet_animal_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,8 @@ pet_animal.0109 = {

trigger = {
NOT = { has_character_flag = had_pet_animal_0109_event }
# Requires a capital county.
is_landed = yes
}

immediate = {
Expand Down Expand Up @@ -1193,6 +1195,7 @@ pet_animal.0200 = {

trigger = {
is_available_healthy_adult = yes
is_landed = yes
}

cooldown = { years = 15 }
Expand Down Expand Up @@ -1243,6 +1246,7 @@ pet_animal.0201 = {
artifact_slot_type = miscellaneous
}
}
is_landed = yes
}

immediate = {
Expand Down Expand Up @@ -1530,6 +1534,7 @@ pet_animal.0203 = {
is_available_healthy_ai_adult = yes
location = root.location
}
is_landed = yes
}

cooldown = { years = 15 }
Expand Down Expand Up @@ -1655,6 +1660,7 @@ pet_animal.0205 = {
is_available_adult = yes
location = root.location
}
is_landed = yes
}

immediate = {
Expand Down Expand Up @@ -2339,7 +2345,7 @@ pet_animal.1108 = {
any_targeting_scheme = {
is_scheme_exposed = no
save_temporary_scope_as = scheme_check
any_scheme_agent = {
any_scheme_agent_character = {
NOT = { is_agent_exposed_in_scheme = scope:scheme_check }
is_in_the_same_court_as = root
}
Expand All @@ -2356,7 +2362,7 @@ pet_animal.1108 = {
is_scheme_exposed = no
}
save_scope_as = scheme
random_scheme_agent = {
random_scheme_agent_character = {
limit = {
NOT = { is_agent_exposed_in_scheme = scope:scheme }
is_in_the_same_court_as = root
Expand Down Expand Up @@ -2765,6 +2771,7 @@ pet_animal.1113 = {

trigger = {
NOT = { has_character_flag = had_pet_animal_1113_event }
is_landed = yes
}

immediate = {
Expand Down

0 comments on commit 07048ef

Please sign in to comment.