Skip to content

Commit

Permalink
Prune unimportant immortals from courts
Browse files Browse the repository at this point in the history
  • Loading branch information
rquinio committed May 27, 2018
1 parent 86dd3e7 commit 7786722
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions MOD/Witcher/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Bugfix:
- Fix an issue when playing an immortal race and giving away a title, causing own courtiers to leave
- Fix a stackoverflow CTD due to guardian refusing magic ward in loop
- Allow racist emperor to nominate a special forces commander
- Trigger some manual pruning for long-lived races in courts

----------------------------------------------------------------------------------------------------------------
v0.8.1 2017-08-20
Expand Down
2 changes: 2 additions & 0 deletions MOD/Witcher/common/on_actions/W_on_actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ on_yearly_pulse = {

# W_witchert_events
witcher.300 # Check and spawn witchers

old_age.97 # Prune court for unimportant immortals
}

random_events = {
Expand Down
36 changes: 36 additions & 0 deletions MOD/Witcher/events/W_old_age_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,42 @@ character_event = {
}
}

# Manual court pruning of unimportant immortals [on_yearly_pulse]
character_event = {
id = old_age.97

is_triggered_only = yes
hide_window = yes

only_rulers = yes

trigger = {
any_courtier = {
immortal = yes
prisoner = no
is_landed = no
NOT = { trait = wilderness_race }
count = 10 # NDefines.NEngine.COURT_PRUNE_SIZE
}
}

immediate = {
log="(Immortality) Pruning at court of [Root.GetBestName] in [Root.Location.GetName]."
any_courtier = {
limit = {
immortal = yes
prisoner = no
is_ruler = no
NOT = { trait = wilderness_race }
is_unimportant_trigger = yes
age = 40 # NDefines.NEngine.PRUNE_MINIMAL_AGE
}
log="(Immortality) Pruning [This.GetBestName] as unimportant"
death = { death_reason = death_missing }
}
}
}

# Move important immortal characters manually to new holder's court, so they do not die of 'natural death' during court pruning.
# Manually prune 80% of the court, to avoid court bloating.
# ROOT is the character
Expand Down

0 comments on commit 7786722

Please sign in to comment.