poosh
This commit is contained in:
parent
0f3bedb8ff
commit
79385a115c
3 changed files with 1061 additions and 0 deletions
361
N3OW/common/laws/_laws.info
Normal file
361
N3OW/common/laws/_laws.info
Normal file
|
|
@ -0,0 +1,361 @@
|
|||
law_group_name = {
|
||||
|
||||
### brief = default ( database key, optional )
|
||||
# New rulers will use this law by default, provided its "should_start_with" trigger
|
||||
# returns true or is undefined
|
||||
#
|
||||
default = law_name
|
||||
|
||||
### brief: cumulative ( bool, optional )
|
||||
# If set, each subsequent law in the group will provide all effects of the previous law
|
||||
# default = no
|
||||
#
|
||||
cumulative = no
|
||||
|
||||
### brief: flag ( flag )
|
||||
# See below for flags with special treatment in code. These flags may also be checked
|
||||
# in the data/GUI system with LawGroup.HasFlag('some_arbitrary_flag')
|
||||
#
|
||||
flag = some_arbitrary_flag
|
||||
|
||||
### brief: cumulative ( bool, optional )
|
||||
# If set, this law group is considered part of the Treasury Budget set, and will be displayed within a specific
|
||||
# budget interface.
|
||||
# default = no
|
||||
#
|
||||
is_treasury_budget_group = no
|
||||
|
||||
### brief: can_change_law_group ( trigger )
|
||||
# Optional trigger for law groups that maybe some rulers should see but cant change
|
||||
# Default is leaving this empty - and then it will always be true
|
||||
# If this trigger fails - the lawgroup will still be visible but can't be changed by the ruler
|
||||
#
|
||||
can_change_law_group = { }
|
||||
|
||||
law_name = {
|
||||
|
||||
### brief: can_keep ( trigger )
|
||||
# Requirements for keeping the law. If this invalidates, the law will
|
||||
# be replaced with the default law (see own section) within a month.
|
||||
# Also checked after changing faith since doctrinal changes are likely
|
||||
# to invalidate laws. Always true if not specified.
|
||||
# Root scope = ruler with the law
|
||||
#
|
||||
can_keep = { }
|
||||
|
||||
### brief: can_have ( trigger )
|
||||
# Requirements for adopting the law in the ruler's scope. If this is true,
|
||||
# the character is allowed to adopt the law and the law will show as
|
||||
# available (but it can be currently disabled if can_pass is false).
|
||||
# Always true if not specified.
|
||||
# Root scope = ruler for whom we are checking the law
|
||||
#
|
||||
can_have = { }
|
||||
|
||||
### brief: can_pass ( trigger )
|
||||
# Requirements for adopting the law in the ruler's scope. For more
|
||||
# temporary conditions, e.g. being at war ("I can have the law, but
|
||||
# can't pass it right now"). Always true if not specified.
|
||||
# Root scope = ruler for whom we are checking the law
|
||||
#
|
||||
can_pass = { }
|
||||
|
||||
### brief: should_start_with ( trigger )
|
||||
# If these conditions are true, this is a valid law for a ruler to start
|
||||
# with. Note that it always includes the can_keep check.
|
||||
# Root scope = ruler for whom we are checking the law
|
||||
#
|
||||
should_start_with = { }
|
||||
|
||||
### brief: can_title_have ( trigger )
|
||||
# Requirements for titles being able to have this law. Always false if
|
||||
# not specified.
|
||||
# Root scope = title for which we are checking the law
|
||||
#
|
||||
can_title_have = { }
|
||||
|
||||
### brief: can_realm_have ( trigger )
|
||||
# Requirements for characters being able to apply this law at realm level.
|
||||
# Always false if not specified.
|
||||
# By default, the following succession orders imply they can be applied to the whole realm:
|
||||
# * inheritance
|
||||
# * theocracy
|
||||
# * company
|
||||
# * generate
|
||||
# * appointment
|
||||
# Root scope = character for which we are checking the law
|
||||
#
|
||||
can_realm_have = { }
|
||||
|
||||
### brief: should_show_for_title ( trigger )
|
||||
# Should this law be shown in the UI for titles?
|
||||
#
|
||||
should_show_for_title = { }
|
||||
|
||||
### brief: pass_cost ( scripted cost )
|
||||
# The cost of enacting this law
|
||||
# Root scope = ruler wanting to pass the law
|
||||
#
|
||||
pass_cost = { gold/piety/prestige = ... }
|
||||
|
||||
### brief: revoke_cost ( scripted cost )
|
||||
# The cost of revoking or clearing this law
|
||||
# Root scope = ruler wanting to revoke the law
|
||||
#
|
||||
revoke_cost = { gold/piety/prestige = ... }
|
||||
|
||||
### brief: modifier ( character modifier )
|
||||
# Modifier applied to the ruler when this law is active
|
||||
#
|
||||
modifier = { }
|
||||
|
||||
### brief: flag ( flag )
|
||||
# See below for flags treated specially. Can be checked in script
|
||||
# with has_realm_law_flag = some_arbitrary_flag.
|
||||
# See below for flags treated specially in code.
|
||||
#
|
||||
flag = some_arbitrary_flag
|
||||
|
||||
### brief: triggered_flag ( flag )
|
||||
# Checks and adds flag only if the trigger's condition is met.
|
||||
# Both trigger and flag *must* be specified within this block.
|
||||
#
|
||||
triggered_flag = {
|
||||
|
||||
# Some trigger, root is the ruler character scope
|
||||
#
|
||||
trigger = { ... }
|
||||
|
||||
# See below for flags treated specially in code. Can be checked in
|
||||
# script with has_realm_law_flag = some_arbitrary_flag
|
||||
#
|
||||
flag = some_arbitrary_flag
|
||||
}
|
||||
|
||||
### brief: shown_in_encyclopedia ( bool, optional )
|
||||
# If this law should show up in the Encyclopedia
|
||||
# default = yes
|
||||
#
|
||||
shown_in_encyclopedia = yes
|
||||
|
||||
### brief: on_pass ( effect )
|
||||
# Effect run just before law change.
|
||||
# Effect run on the ruler when the law is added. Does *NOT* get run
|
||||
# when default laws are initialized, nor when inheriting a law from
|
||||
# someone else.
|
||||
# Root = ruler in question
|
||||
# If this is done on a title, the title is accessible as scope:title
|
||||
#
|
||||
on_pass = { }
|
||||
|
||||
### brief: on_after_pass ( effect )
|
||||
# Effect run just after law change.
|
||||
# Effect run on the ruler when the law is added. Does *NOT* get run
|
||||
# when default laws are initialized, nor when inheriting a law from
|
||||
# someone else.
|
||||
# Root = ruler in question
|
||||
# If this is done on a title, the title is accessible as scope:title
|
||||
#
|
||||
on_after_pass = { }
|
||||
|
||||
### brief: on_revoke ( effect )
|
||||
# Effect run on ruler when the law is removed. Does *NOT* get run when
|
||||
# law is removed due to inheriting a law from someone else.
|
||||
# Root = ruler in question
|
||||
# If this is done on a title, the title is accessible as scope:title
|
||||
#
|
||||
on_revoke = { }
|
||||
|
||||
### brief: succession ( struct, optional )
|
||||
# Succession rules. Any new law with a rule set will override the
|
||||
# previous law's rule set.
|
||||
# Overriding is in law definition order
|
||||
#
|
||||
succession = {
|
||||
|
||||
### brief: order_of_succession ( enum )
|
||||
# Which order of succession ( provided by code ) does this law use?
|
||||
#
|
||||
# Options:
|
||||
# inheritance
|
||||
# election
|
||||
# appointment ( requires traversal, division and rank be undefined )
|
||||
# theocratic
|
||||
# company
|
||||
# generate
|
||||
# generate_from_template
|
||||
# player_heir
|
||||
# noble_family
|
||||
#
|
||||
order_of_succession = inheritance
|
||||
|
||||
### brief: title_division ( enum )
|
||||
# Used to determine how titles are split during succession
|
||||
# Requires order_of_succession = inheritance or noble_family
|
||||
#
|
||||
# Options:
|
||||
# partition ( only available when traversal_order = children )
|
||||
# single_heir ( only valid for inheritance and noble_family order_of_succession )
|
||||
#
|
||||
title_division = partition
|
||||
|
||||
### brief: traversal_order ( enum )
|
||||
# Determines which set of characters is considered when building
|
||||
# the line of succession.
|
||||
#
|
||||
# Options:
|
||||
# children( may only be defined if title_division = partition )
|
||||
# dynasty
|
||||
# dynasty_house
|
||||
#
|
||||
traversal_order = children/dynasty_house/dynasty
|
||||
|
||||
### brief: rank ( enum )
|
||||
# Determines how characters in the line of succession are sorted
|
||||
#
|
||||
# Options:
|
||||
# oldest
|
||||
# youngest
|
||||
#
|
||||
rank = oldest
|
||||
|
||||
### brief: pool_character_config ( database key, situational )
|
||||
# Entry in common/pool_character_selectors, used when choosing a
|
||||
# character from the pool or generating a new character.
|
||||
# Only available for theocratic, company, and generate.
|
||||
#
|
||||
pool_character_config = key
|
||||
|
||||
### brief: election_type ( database key, situational )
|
||||
# Entry in common/succession_election, used to determine which type
|
||||
# of election should be used for succession.
|
||||
# Only available for election.
|
||||
#
|
||||
election_type = key
|
||||
|
||||
### brief: appointment_type ( database key, situational )
|
||||
# Entry in common/succession_appointment, used to determine which type
|
||||
# of appointment should be used for succession.
|
||||
# Only available for appointment.
|
||||
#
|
||||
appointment_type = key
|
||||
|
||||
|
||||
### Generic Rules
|
||||
|
||||
### brief: gender_law ( enum, optional )
|
||||
# Used to determine which gender(s) are valid for succession.
|
||||
#
|
||||
# Options:
|
||||
# male_only
|
||||
# male_preference
|
||||
# equal
|
||||
# female_preference
|
||||
# female_only
|
||||
#
|
||||
gender_law = equal
|
||||
|
||||
### brief: gender_law ( enum, optional )
|
||||
# Used to determine which faith(s) are valid for succession.
|
||||
# If no character fulfilling this requirement is found, the restriction
|
||||
# is ignored (but titles with the flag destroy_if_invalid_heir = yes
|
||||
# will be destroyed).
|
||||
#
|
||||
# Options:
|
||||
# same_faith
|
||||
# same_religion
|
||||
# same_family
|
||||
#
|
||||
faith = same_faith
|
||||
|
||||
### brief: create_primary_tier_titles ( bool, optional )
|
||||
# If set, then under partition all titles you can create of your primary
|
||||
# tier will be created for free, resulting in a more split-up realm
|
||||
# default = no
|
||||
#
|
||||
create_primary_tier_titles = no
|
||||
|
||||
### brief: primary_heir_minimum_share ( fixed point, optional )
|
||||
# If defined, the primary heir will get at least this portion of
|
||||
# titles, which means if there's a lot of heirs the primary still
|
||||
# gets a guaranteed amount of land
|
||||
#
|
||||
primary_heir_minimum_share = 0.5
|
||||
|
||||
### brief: exclude_rulers ( bool, optional )
|
||||
# If set, the title can not be inherited by rulers (anyone with titles)
|
||||
# default = no
|
||||
#
|
||||
exclude_rulers = no
|
||||
|
||||
### brief: limit_to_courtiers ( bool, optional )
|
||||
# If set, only immediate courtiers and away courtiers of a ruler
|
||||
# will be allowed to inherit
|
||||
# default = no
|
||||
#
|
||||
limit_to_courtiers = no
|
||||
}
|
||||
|
||||
### brief: ai_will_do ( value )
|
||||
# Script value in the ruler scope. If above 0, the AI will enact this
|
||||
# law if able. Law enactment is checked in the RARE_TASK_TICK. If multiple
|
||||
# laws are possible, the AI will enact the one with the highest score.
|
||||
# Root scope = ruler in question
|
||||
#
|
||||
ai_will_do = { ... }
|
||||
}
|
||||
|
||||
# Multiple laws can be defined in a single law group.
|
||||
another_law_name = {}
|
||||
}
|
||||
|
||||
### NOTES ###
|
||||
|
||||
### Inheritance ###
|
||||
Any heir that goes up one or more tier due to inheritance gets the laws of the dead ruler.
|
||||
Note that currently the law conditions are not checked in any way for law inheritance.
|
||||
|
||||
### Default law ###
|
||||
All rulers have a single law from each group.
|
||||
If a group has a default set, that law will be checked first.
|
||||
Otherwise, or if it is invalid, the laws are checked in definition order.
|
||||
The first checked law where "should_start_with" returns true (or does not exist) gets used. Note that "can_pass" is ignored entirely when determining a default law.
|
||||
When a default law is set, "on_pass" is *not* executed
|
||||
|
||||
### Title Succession Laws ###
|
||||
Laws are usually defined for realm. However some succession laws are valid for titles.
|
||||
This is primary based on order_of_succession:
|
||||
|
||||
Title only:
|
||||
player_heir
|
||||
election
|
||||
noble_family
|
||||
generate_from_template
|
||||
Realm only:
|
||||
inheritance ( title_division = partition )
|
||||
theocratic
|
||||
company
|
||||
generate
|
||||
Realm & Title:
|
||||
inheritance ( title_division = single_heir )
|
||||
appointment
|
||||
|
||||
### Associated Localization ###
|
||||
The key of the law will be used as its name. E.G., law_name: "Law Name"
|
||||
The key plus "_effects" can optionally be defined to provide custom effects. E.G., law_name_effects: "Does some law thingy"
|
||||
The key plus "_effects_not_in_prev" can optionally be defined to provide custom effects that should *not* be included when listing effects inherited from earlier laws. E.G., law_name_effects_not_in_prev: "Does some law thingy"
|
||||
|
||||
CHARACTER.GetActiveLawInGroupWithFlag('realm_law') - Will get the character's active law in a group. The group must have the given flag. Note that it does not work for dead characters
|
||||
|
||||
### Hardcoded Flags ###
|
||||
Some flags have special meaning, and are used by the game code.
|
||||
|
||||
Law Groups:
|
||||
flag = realm_law - Will show up in My Realm window
|
||||
|
||||
Laws:
|
||||
flag = titles_cannot_leave_realm_on_succession - Disables titles leaving realm when received on succession by someone outside the realm - the respective heirs will be disqualified from succession
|
||||
flag = men_can_have_multiple_spouses - Allows multiple spouses (if also allowed by faith)
|
||||
flag = men_can_have_consorts - Allows consorts (if also allowed by faith)
|
||||
flag = women_can_have_multiple_spouses - Allows multiple spouses (if also allowed by faith)
|
||||
flag = women_can_have_consorts - Allows consorts (if also allowed by faith)
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
699
N3OW/common/scripted_effects/tgp_debate_scripted_effects.txt
Normal file
699
N3OW/common/scripted_effects/tgp_debate_scripted_effects.txt
Normal file
|
|
@ -0,0 +1,699 @@
|
|||
# Find debate target
|
||||
set_debate_target_effect = {
|
||||
save_scope_as = debate_contender
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_favor
|
||||
}
|
||||
}
|
||||
}
|
||||
#Save current empowered movement.
|
||||
situation:dynastic_cycle ?= {
|
||||
random_participant_group = {
|
||||
limit = { exists = var:movement_favored }
|
||||
save_scope_as = current_empowered_movement
|
||||
}
|
||||
}
|
||||
if = { # Grab the movement leader if available
|
||||
limit = {
|
||||
scope:current_empowered_movement = {
|
||||
var:movement_leader = { involved_activity = scope:activity }
|
||||
}
|
||||
}
|
||||
scope:current_empowered_movement = {
|
||||
var:movement_leader = { save_scope_as = challenged_movement_leader }
|
||||
}
|
||||
}
|
||||
else_if = { # Else grab a proxy
|
||||
limit = {
|
||||
scope:activity = {
|
||||
any_attending_character = {
|
||||
top_participant_group:dynastic_cycle ?= scope:current_empowered_movement
|
||||
}
|
||||
}
|
||||
}
|
||||
scope:activity = {
|
||||
ordered_attending_character = {
|
||||
order_by = movement_power_character_value
|
||||
check_range_bounds = no
|
||||
limit = {
|
||||
top_participant_group:dynastic_cycle ?= scope:current_empowered_movement
|
||||
}
|
||||
save_scope_as = challenged_movement_leader
|
||||
}
|
||||
}
|
||||
}
|
||||
else_if = { # Else grab a character from _another_ movement
|
||||
limit = {
|
||||
scope:activity = {
|
||||
any_attending_character = {
|
||||
NOR = {
|
||||
top_participant_group:dynastic_cycle ?= { participant_group_type = undecided_movement }
|
||||
top_participant_group:dynastic_cycle ?= scope:host.top_participant_group:dynastic_cycle
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
scope:activity = {
|
||||
ordered_attending_character = {
|
||||
order_by = movement_power_character_value
|
||||
check_range_bounds = no
|
||||
limit = {
|
||||
NOR = {
|
||||
top_participant_group:dynastic_cycle ?= { participant_group_type = undecided_movement }
|
||||
top_participant_group:dynastic_cycle ?= scope:host.top_participant_group:dynastic_cycle
|
||||
}
|
||||
}
|
||||
save_scope_as = challenged_movement_leader
|
||||
}
|
||||
}
|
||||
}
|
||||
else = { # Invalidate activity
|
||||
trigger_event = activity_system.0552
|
||||
}
|
||||
}
|
||||
else_if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_leadership
|
||||
}
|
||||
}
|
||||
}
|
||||
scope:activity.special_guest:movement_leader ?= { save_scope_as = challenged_movement_leader }
|
||||
}
|
||||
scope:activity = {
|
||||
set_variable = {
|
||||
name = challenged_movement_leader
|
||||
value = scope:challenged_movement_leader
|
||||
}
|
||||
set_variable = {
|
||||
name = debate_contender
|
||||
value = scope:debate_contender
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# > 0 contender won and will become new leader
|
||||
# <= 0 movement leader won and defended position
|
||||
debate_determine_outcome_effect = {
|
||||
random_list = {
|
||||
10 = { # Contender is winner
|
||||
modifier = {
|
||||
add = 240
|
||||
scope:activity.debate_outcome_value = 3
|
||||
}
|
||||
modifier = {
|
||||
add = 70
|
||||
scope:activity.debate_outcome_value = 2
|
||||
}
|
||||
modifier = {
|
||||
add = 10
|
||||
scope:activity.debate_outcome_value = 1
|
||||
}
|
||||
modifier = { # If opponents score is TOO high, you cannot win
|
||||
factor = 0
|
||||
scope:activity.debate_outcome_value <= -3
|
||||
}
|
||||
scope:activity.var:debate_contender = {
|
||||
save_scope_as = debate_winner
|
||||
}
|
||||
scope:activity.var:challenged_movement_leader = {
|
||||
save_scope_as = debate_loser
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity.debate_outcome_value < 0
|
||||
}
|
||||
save_scope_as = debate_unexpected_win
|
||||
}
|
||||
}
|
||||
10 = { # challenged leader is winner
|
||||
modifier = {
|
||||
add = 240
|
||||
scope:activity.debate_outcome_value = -3
|
||||
}
|
||||
modifier = {
|
||||
add = 70
|
||||
scope:activity.debate_outcome_value = -2
|
||||
}
|
||||
modifier = {
|
||||
add = 10
|
||||
scope:activity.debate_outcome_value = -1
|
||||
}
|
||||
modifier = { # If opponents score is TOO high, you cannot win
|
||||
factor = 0
|
||||
scope:activity.debate_outcome_value >= 3
|
||||
}
|
||||
|
||||
scope:activity.var:debate_contender = {
|
||||
save_scope_as = debate_loser
|
||||
}
|
||||
scope:activity.var:challenged_movement_leader = {
|
||||
save_scope_as = debate_winner
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity.debate_outcome_value > 0
|
||||
}
|
||||
save_scope_as = debate_unexpected_win
|
||||
}
|
||||
}
|
||||
}
|
||||
# Apply effects
|
||||
# Seize movement leadership success
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_leadership
|
||||
}
|
||||
}
|
||||
}
|
||||
# Set variables for activity conclusion desc - note that for the favor special option, these are set in the hegemon's follow up event.
|
||||
scope:activity = {
|
||||
set_variable = {
|
||||
name = debate_winner
|
||||
value = scope:debate_winner
|
||||
}
|
||||
}
|
||||
scope:activity = {
|
||||
set_variable = {
|
||||
name = debate_loser
|
||||
value = scope:debate_loser
|
||||
}
|
||||
}
|
||||
# Record it
|
||||
involved_activity = {
|
||||
if = {
|
||||
limit = {
|
||||
scope:debate_winner = {
|
||||
is_any_movement_leader = no
|
||||
}
|
||||
}
|
||||
add_activity_log_entry = {
|
||||
key = debate_become_movement_leader_reward
|
||||
score = 80
|
||||
tags = { completed }
|
||||
character = scope:debate_winner
|
||||
location = scope:debate_winner.location
|
||||
}
|
||||
}
|
||||
else = {
|
||||
add_activity_log_entry = {
|
||||
key = debate_remain_movement_leader_reward
|
||||
score = 80
|
||||
tags = { completed }
|
||||
character = scope:debate_winner
|
||||
location = scope:debate_winner.location
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debate_disburse_activity_ai_guest_rewards = {
|
||||
if = {
|
||||
limit = {
|
||||
NOT = { exists = var:tgp_debate_success_score }
|
||||
}
|
||||
set_variable = {
|
||||
name = tgp_debate_success_score
|
||||
value = tgp_debate_success_score_value
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
has_activity_intent = debate_increase_movement_power_intent
|
||||
}
|
||||
top_participant_group:dynastic_cycle ?= {
|
||||
save_scope_as = my_movement
|
||||
}
|
||||
random = {
|
||||
chance = {
|
||||
value = 25
|
||||
if = {
|
||||
limit = { var:tgp_debate_success_score >= 100 }
|
||||
add = 75
|
||||
}
|
||||
else_if = {
|
||||
limit = { var:tgp_debate_success_score >= 75 }
|
||||
add = 50
|
||||
}
|
||||
else_if = {
|
||||
limit = { var:tgp_debate_success_score >= 50 }
|
||||
add = 25
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = { var:tgp_debate_success_score >= 100 }
|
||||
change_influence = major_influence_gain
|
||||
scope:my_movement = {
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_major_value
|
||||
}
|
||||
}
|
||||
}
|
||||
else_if = {
|
||||
limit = { var:tgp_debate_success_score >= 75 }
|
||||
change_influence = medium_influence_gain
|
||||
scope:my_movement = {
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_medium_value
|
||||
}
|
||||
}
|
||||
}
|
||||
else = {
|
||||
change_influence = minor_influence_gain
|
||||
scope:my_movement = {
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_minor_value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else = {
|
||||
save_scope_as = ai_guest
|
||||
if = {
|
||||
limit = {
|
||||
NOT = {
|
||||
any_relation = {
|
||||
type = elder
|
||||
is_ai = no
|
||||
}
|
||||
}
|
||||
}
|
||||
random = {
|
||||
chance = {
|
||||
value = 25
|
||||
}
|
||||
scope:activity = {
|
||||
random_attending_character = {
|
||||
limit = {
|
||||
is_ai = yes
|
||||
merit > scope:ai_guest.merit
|
||||
num_of_relation_disciple < disciples_limit_value
|
||||
NOR = {
|
||||
has_relation_elder = scope:ai_guest
|
||||
has_relation_disciple = scope:ai_guest
|
||||
}
|
||||
# Not busy with their own things.
|
||||
this != scope:host
|
||||
this != scope:activity.var:challenged_movement_leader
|
||||
}
|
||||
weight = {
|
||||
base = 100
|
||||
modifier = {
|
||||
any_relation = {
|
||||
type = disciple
|
||||
count > 0
|
||||
}
|
||||
# even out the distribution of disciples
|
||||
add = {
|
||||
every_relation = {
|
||||
type = disciple
|
||||
add = -5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
save_scope_as = elder
|
||||
set_elder_relation_effect = {
|
||||
ELDER = scope:elder
|
||||
DISCIPLE = scope:ai_guest
|
||||
MERIT = minor_merit_gain
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debate_host_rewards_effect = {
|
||||
if = {
|
||||
# Host won debate
|
||||
limit = {
|
||||
this = scope:activity.var:debate_winner
|
||||
}
|
||||
# Activity is imperial debate (determines favored movement)
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_favor
|
||||
}
|
||||
}
|
||||
}
|
||||
root.top_participant_group:dynastic_cycle ?= {
|
||||
# Make favored movement
|
||||
save_scope_as = my_movement
|
||||
}
|
||||
# We raise our own Movement Power
|
||||
custom_tooltip = event_increase_movement_power_major_effect_tooltip
|
||||
scope:my_movement = {
|
||||
make_movement_favored_effect = yes
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_major_value
|
||||
}
|
||||
switch = {
|
||||
trigger = participant_group_type
|
||||
pro_hegemon_movement = {
|
||||
if = {
|
||||
limit = {
|
||||
situation:dynastic_cycle = {
|
||||
situation_top_has_catalyst = catalyst_movement_gained_power_pro_hegemon
|
||||
}
|
||||
}
|
||||
trigger_situation_catalyst = catalyst_movement_gained_power_pro_hegemon
|
||||
}
|
||||
}
|
||||
advancement_movement = {
|
||||
if = {
|
||||
limit = {
|
||||
situation:dynastic_cycle = {
|
||||
situation_top_has_catalyst = catalyst_movement_gained_power_advancement
|
||||
}
|
||||
}
|
||||
trigger_situation_catalyst = catalyst_movement_gained_power_advancement
|
||||
}
|
||||
}
|
||||
expansion_movement = {
|
||||
if = {
|
||||
limit = {
|
||||
situation:dynastic_cycle = {
|
||||
situation_top_has_catalyst = catalyst_movement_gained_power_expansion
|
||||
}
|
||||
}
|
||||
trigger_situation_catalyst = catalyst_movement_gained_power_expansion
|
||||
}
|
||||
}
|
||||
conservative_movement = {
|
||||
if = {
|
||||
limit = {
|
||||
situation:dynastic_cycle = {
|
||||
situation_top_has_catalyst = catalyst_movement_gained_power_conservative
|
||||
}
|
||||
}
|
||||
trigger_situation_catalyst = catalyst_movement_gained_power_conservative
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else = {
|
||||
make_movement_leader_effect = yes
|
||||
}
|
||||
}
|
||||
# Then dole out secondary rewards
|
||||
if = {
|
||||
# We have the intent to gain disciples and gained at least one.
|
||||
limit = { has_variable_list = debate_disciples }
|
||||
if = {
|
||||
# Code math starts at 0
|
||||
limit = {
|
||||
variable_list_size = {
|
||||
name = debate_disciples
|
||||
value = 1
|
||||
}
|
||||
num_of_relation_disciple >= 1
|
||||
}
|
||||
ordered_in_list = {
|
||||
variable = debate_disciples
|
||||
order_by = learning
|
||||
save_scope_as = disciple_1
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
variable_list_size = {
|
||||
name = debate_disciples
|
||||
value = 2
|
||||
}
|
||||
num_of_relation_disciple >= 2
|
||||
}
|
||||
ordered_in_list = {
|
||||
variable = debate_disciples
|
||||
order_by = learning
|
||||
position = 1
|
||||
save_scope_as = disciple_2
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
variable_list_size = {
|
||||
name = debate_disciples
|
||||
value = 3
|
||||
}
|
||||
num_of_relation_disciple >= 3
|
||||
}
|
||||
ordered_in_list = {
|
||||
variable = debate_disciples
|
||||
order_by = learning
|
||||
position = 2
|
||||
save_scope_as = disciple_3
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
exists = scope:disciple_3
|
||||
}
|
||||
custom_tooltip = gained_many_disciples
|
||||
}
|
||||
else_if = {
|
||||
limit = {
|
||||
exists = scope:disciple_2
|
||||
}
|
||||
custom_tooltip = gained_few_disciples
|
||||
}
|
||||
else_if = {
|
||||
limit = {
|
||||
exists = scope:disciple_1
|
||||
}
|
||||
custom_tooltip = gained_one_disciple
|
||||
}
|
||||
}
|
||||
change_influence = {
|
||||
# Modest reward as a base - you're the host after all!
|
||||
value = major_influence_value
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_favor
|
||||
}
|
||||
}
|
||||
this = scope:activity.var:debate_winner
|
||||
}
|
||||
add = monumental_influence_value
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_leadership
|
||||
}
|
||||
}
|
||||
this = scope:activity.var:debate_winner
|
||||
}
|
||||
add = major_influence_value
|
||||
}
|
||||
}
|
||||
add_prestige = {
|
||||
# Modest reward as a base - you're the host after all!
|
||||
value = major_prestige_value
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_favor
|
||||
}
|
||||
}
|
||||
this = scope:activity.var:debate_winner
|
||||
}
|
||||
add = monumental_prestige_value
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
scope:activity = {
|
||||
has_activity_option = {
|
||||
category = special_type
|
||||
option = debate_type_leadership
|
||||
}
|
||||
}
|
||||
this = scope:activity.var:debate_winner
|
||||
}
|
||||
add = major_prestige_value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debate_disburse_activity_host_rewards = {
|
||||
# Regardless of outcome for intents, you should receive some influence and prestige from having hosted debate.
|
||||
if = {
|
||||
limit = { this = scope:host }
|
||||
# Record it
|
||||
involved_activity = {
|
||||
add_activity_log_entry = {
|
||||
key = debate_host_rewards
|
||||
score = 80
|
||||
tags = { completed }
|
||||
show_in_conclusion = yes
|
||||
character = scope:host
|
||||
location = scope:host.location
|
||||
scope:host = { debate_host_rewards_effect = yes }
|
||||
}
|
||||
}
|
||||
}
|
||||
else = {
|
||||
show_as_tooltip = { debate_host_rewards_effect = yes }
|
||||
}
|
||||
}
|
||||
|
||||
debate_guest_rewards = {
|
||||
if = {
|
||||
limit = {
|
||||
this = scope:activity.var:challenged_movement_leader
|
||||
this = scope:activity.var:debate_winner
|
||||
}
|
||||
add_prestige = major_prestige_value
|
||||
change_influence = major_influence_value
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
has_activity_intent = debate_gain_elder_intent
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
has_variable = new_elder
|
||||
}
|
||||
custom_tooltip = gained_new_elder_tt
|
||||
}
|
||||
change_influence = debate_guest_influence_reward_value
|
||||
}
|
||||
if = {
|
||||
limit = {
|
||||
has_activity_intent = debate_increase_movement_power_intent
|
||||
exists = var:tgp_debate_success_score
|
||||
}
|
||||
top_participant_group:dynastic_cycle ?= {
|
||||
save_scope_as = my_movement
|
||||
}
|
||||
random = {
|
||||
chance = {
|
||||
value = 25
|
||||
if = {
|
||||
limit = { var:tgp_debate_success_score >= 100 }
|
||||
add = 75
|
||||
}
|
||||
else_if = {
|
||||
limit = { var:tgp_debate_success_score >= 75 }
|
||||
add = 50
|
||||
}
|
||||
else_if = {
|
||||
limit = { var:tgp_debate_success_score >= 50 }
|
||||
add = 25
|
||||
}
|
||||
}
|
||||
if = {
|
||||
limit = { var:tgp_debate_success_score >= 100 }
|
||||
change_influence = major_influence_gain
|
||||
scope:my_movement = {
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_major_value
|
||||
}
|
||||
}
|
||||
}
|
||||
else_if = {
|
||||
limit = { var:tgp_debate_success_score >= 75 }
|
||||
change_influence = medium_influence_gain
|
||||
scope:my_movement = {
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_medium_value
|
||||
}
|
||||
}
|
||||
}
|
||||
else = {
|
||||
change_influence = minor_influence_gain
|
||||
scope:my_movement = {
|
||||
event_change_movement_power_effect = {
|
||||
VALUE = event_increase_movement_power_minor_value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
change_influence = debate_guest_influence_reward_value
|
||||
}
|
||||
add_trait_xp = {
|
||||
trait = confucian_education
|
||||
value = {
|
||||
value = lifestyle_confucian_education_xp_gain_minor_value
|
||||
#High Score
|
||||
if = {
|
||||
limit = {
|
||||
has_variable = tgp_debate_success_score
|
||||
var:tgp_debate_success_score >= 75
|
||||
}
|
||||
multiply = 3
|
||||
}
|
||||
#Good Score
|
||||
else_if = {
|
||||
limit = {
|
||||
has_variable = tgp_debate_success_score
|
||||
var:tgp_debate_success_score < 75
|
||||
var:tgp_debate_success_score >= 50
|
||||
}
|
||||
multiply = 1.5
|
||||
}
|
||||
#Poor Score
|
||||
else_if = {
|
||||
limit = {
|
||||
has_variable = tgp_debate_success_score
|
||||
var:tgp_debate_success_score < 50
|
||||
}
|
||||
multiply = 0.8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debate_disburse_activity_guest_rewards = {
|
||||
save_scope_as = guest
|
||||
involved_activity = {
|
||||
add_activity_log_entry = {
|
||||
key = debate_guest_rewards
|
||||
score = 80
|
||||
tags = { completed }
|
||||
show_in_conclusion = yes
|
||||
character = scope:guest
|
||||
location = scope:guest.location
|
||||
scope:guest = { debate_guest_rewards = yes }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debate_cleanup_effect = {
|
||||
if = {
|
||||
limit = {
|
||||
has_variable = tgp_debate_success_score
|
||||
}
|
||||
set_variable = {
|
||||
name = tgp_debate_success_score
|
||||
value = var:tgp_debate_success_score
|
||||
days = 60
|
||||
}
|
||||
}
|
||||
# Debates
|
||||
remove_variable ?= debate_selected_tactic
|
||||
remove_variable ?= debate_crowd_sentiment
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue