From 7ecd9b636224fb5f145628f1c44bcd7ff31bf6ce Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 1 Jan 2025 22:31:19 -0500 Subject: [PATCH] Arcane portal ritual (#1458) * Create portal exempt to ritual cooldown * Create Portal Initial commit * add gui for multiple character targets * Add ability to select destination * add cascading portal selection * add empires to list first * pan_camera_to_title when target is selected * add tooltip for characters * fix change destination gui clipping * army tooltips * fix error spam * fix 'type' error * fix recipient error * remove loose variables * add travel entourage functionality * add tooltips to prevent people from breaking shit * Fix army tootlip * add tooltips/disable teleporting when army in combat * Fix army teleportation * Fix pt 2 * Add decision to go back home * Remove isolated titles and titles with no barony * fix2 --- common/decisions/wc_magic_decisions.txt | 65 ++ .../wc_magic_spells_concepts.txt | 4 + .../lifestyle_perks/wc_order_magic_perks.txt | 13 +- .../script_values/wc_magic_spell_values.txt | 43 +- common/scripted_effects/wc_magic_effects.txt | 2 + .../wc_magic_order_effects.txt | 229 +++++ common/scripted_guis/wc_magic_guis.txt | 807 +++++++++++++++--- .../wc_magic_spells_triggers.txt | 64 +- gui/spellbook_widget.gui | 313 ++++++- .../english/gui/wc_magic_gui_l_english.yml | 6 + .../english/wc_decisions_l_english.yml | 8 +- .../wc_game_concepts_lifestyles_l_english.yml | 2 + .../wc_game_concepts_magic_l_english.yml | 4 +- ...c_game_concepts_magic_spells_l_english.yml | 20 + 14 files changed, 1458 insertions(+), 122 deletions(-) diff --git a/common/decisions/wc_magic_decisions.txt b/common/decisions/wc_magic_decisions.txt index 0b867652e9..915c968db4 100644 --- a/common/decisions/wc_magic_decisions.txt +++ b/common/decisions/wc_magic_decisions.txt @@ -2,6 +2,9 @@ decision_group_type = wc_magic ai_check_interval = 60 sort_order = 81 + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } cooldown = { days = 365 } @@ -53,6 +56,9 @@ restore_chronomancy_decision = { decision_group_type = wc_magic + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } ai_check_interval = 60 @@ -72,6 +78,9 @@ restore_chronomancy_decision = { activate_presence_of_mind_decision = { decision_group_type = wc_magic + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } ai_check_interval = 60 @@ -113,6 +122,9 @@ deactivate_presence_of_mind_decision = { activate_reverse_causality_decision = { decision_group_type = wc_magic + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } ai_check_interval = 60 @@ -140,6 +152,9 @@ activate_reverse_causality_decision = { deactivate_reverse_causality_decision = { decision_group_type = wc_magic + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } ai_check_interval = 60 @@ -157,6 +172,9 @@ deactivate_reverse_causality_decision = { go_into_hibernation_decision = { decision_group_type = wc_magic + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } ai_check_interval = 20 @@ -225,4 +243,51 @@ wc_spell_hack_decision = { remove_variable = wc_spell_hack_available custom_tooltip = wc_spell_hack_effect } +} + +teleport_back_decision = { + decision_group_type = wc_magic + picture = { + reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" + } + + ai_check_interval = 2 + + is_shown = { + has_variable = create_portal_location + } + + effect = { + if = { + limit = { + exists = capital_province + } + capital_province = { save_scope_as = home } + } + else_if = { + limit = { + exists = liege + } + liege.capital_province = { save_scope_as = home } + } + else = { + title:b_stormwind = { save_scope_as = home } + } + custom_tooltip = { + text = wc_teleport_back_decision_effect_tt + set_location = { + location = scope:home.title_province + stick_to_location = yes + } + } + remove_variable = create_portal_location + } + + ai_potential = { + has_variable = create_portal_location + } + + ai_will_do = { + base = 100 + } } \ No newline at end of file diff --git a/common/game_concepts/wc_magic_spells_concepts.txt b/common/game_concepts/wc_magic_spells_concepts.txt index 586ed8b04f..f8382134b1 100644 --- a/common/game_concepts/wc_magic_spells_concepts.txt +++ b/common/game_concepts/wc_magic_spells_concepts.txt @@ -413,4 +413,8 @@ wc_injury_frostbite = { parent = wc_magic_injury alias = { wc_injury_frostbitten } +} + +wc_spell_create_portal = { + parent = wc_spell_school_order } \ No newline at end of file diff --git a/common/lifestyle_perks/wc_order_magic_perks.txt b/common/lifestyle_perks/wc_order_magic_perks.txt index c5bfd2b529..4718bbb008 100644 --- a/common/lifestyle_perks/wc_order_magic_perks.txt +++ b/common/lifestyle_perks/wc_order_magic_perks.txt @@ -572,7 +572,18 @@ order_magic_tree_3_perk_9 = { effect = { # Maintenance wc_nonelemental_MAGIC_magic_lifestyle_rank_up_check_effect = { MAGIC = order } - + custom_tooltip = wc_learn_spell_create_portal + wc_learn_spell_effect = { + SPELL = create_portal + } + learn_spell_rank_effect = { + SPELL = create_portal + RANK = 2 + } + learn_spell_rank_effect = { + SPELL = create_portal + RANK = 3 + } } } diff --git a/common/script_values/wc_magic_spell_values.txt b/common/script_values/wc_magic_spell_values.txt index a66dd6857d..675a576a37 100644 --- a/common/script_values/wc_magic_spell_values.txt +++ b/common/script_values/wc_magic_spell_values.txt @@ -5379,4 +5379,45 @@ wc_life_magic_cast_time_value = { # Use for changing Cast time for ALL LIFE spel } wc_life_magic_duration_value = { # Use for changing Duration for ALL LIFE spells (multiply this value) value = 1 -} \ No newline at end of file +} +## CREATE PORTAL ## +wc_spell_create_portal_cost_mana_value = { + value = { + add = { + value = { + add = wc_max_mana_value + multiply = 0.3 + } + } + desc = wc_mana_base_value_desc + format = "WC_MAX_MANA_VALUE_FORMAT" + } + max = 150 + round = yes +} +wc_spell_create_portal_cast_time_value = { + min = 0 + value = { + add = 0 + desc = wc_mana_base_value_desc + format = "WC_MAX_MANA_VALUE_FORMAT" + } + + multiply = wc_order_magic_cast_time_value + multiply = wc_magic_cast_time_value + round = yes +} +wc_spell_create_portal_cooldown_value = { + min = 0 + value = { + add = wc_spell_cooldown_very_long + desc = wc_mana_base_value_desc + format = "WC_MAX_MANA_VALUE_FORMAT" + } + + multiply = wc_order_magic_cooldown_value + multiply = wc_magic_cooldown_value + round = yes +} +wc_spell_create_portal_duration_days_value = 0 +### CREATE PORTAL ## \ No newline at end of file diff --git a/common/scripted_effects/wc_magic_effects.txt b/common/scripted_effects/wc_magic_effects.txt index 7d8fe67eda..148c74ec76 100644 --- a/common/scripted_effects/wc_magic_effects.txt +++ b/common/scripted_effects/wc_magic_effects.txt @@ -256,6 +256,7 @@ execute_scoped_spell_effect = { flag:chronomancy = { $EFFECT$ = { SPELL = chronomancy RANK = var:current_spell_rank TYPE = order } } flag:evocation = { $EFFECT$ = { SPELL = evocation RANK = var:current_spell_rank TYPE = order } } flag:arcane_dome = { $EFFECT$ = { SPELL = arcane_dome RANK = var:current_spell_rank TYPE = order } } + flag:create_portal = { $EFFECT$ = { SPELL = create_portal RANK = var:current_spell_rank TYPE = order } } ## Fire flag:scorch = { $EFFECT$ = { SPELL = scorch RANK = var:current_spell_rank TYPE = order } } @@ -490,6 +491,7 @@ spell_cast_effect = { spell_is_ritual_trigger = { SPELL = flag:$SPELL$ } + NOT = { flag:$SPELL$ = flag:create_portal } } add_character_flag = { flag = any_ritual_cd diff --git a/common/scripted_effects/wc_magic_order_effects.txt b/common/scripted_effects/wc_magic_order_effects.txt index 9519673d0d..3a447d5db9 100644 --- a/common/scripted_effects/wc_magic_order_effects.txt +++ b/common/scripted_effects/wc_magic_order_effects.txt @@ -8,6 +8,7 @@ add_to_global_variable_list = { name = Order_spells target = flag:chronomancy } add_to_global_variable_list = { name = Order_spells target = flag:evocation } add_to_global_variable_list = { name = Order_spells target = flag:arcane_dome } + add_to_global_variable_list = { name = Order_spells target = flag:create_portal } # Fire add_to_global_variable_list = { name = Order_spells target = flag:scorch } @@ -1367,4 +1368,232 @@ cast_blizzard_effect = { } } } +} + +cast_create_portal_effect = { + if = { + limit = { exists = var:create_portal_recipient } + var:create_portal_recipient = { + save_temporary_scope_as = this_recipient + } + } + else_if = { + limit = { + exists = var:current_spell_name + var:current_spell_name = flag:create_portal + exists = var:spellbook_open + exists = var:spell_recipient + } + var:spell_recipient = { + save_temporary_scope_as = this_recipient + } + } + + + if = { + limit = { + OR = { + AND = { + exists = var:spellbook_open + var:current_spell_rank = 1 + } + var:create_portal_rank ?= 1 + } + scope:this_recipient ?= { is_travelling = yes } + } + set_variable = { + name = create_portal_destination + value = scope:this_recipient.current_travel_plan.final_destination_province + } + } + + if = { + limit = { + exists = var:create_portal_destination + } + var:create_portal_destination ?= { + save_scope_as = portal_destination + } + if = { # Armies - tooltip + limit = { + var:current_spell_rank = 3 + exists = scope:this_recipient + } + scope:this_recipient = { + teleport_army_effect = { DESTINATION = scope:portal_destination } + } + } + else_if = { # Armies - real + limit = { + exists = scope:this_recipient + var:create_portal_rank ?= 3 + } + scope:this_recipient = { + teleport_army_effect = { DESTINATION = scope:portal_destination } + } + remove_variable = current_destination + } + else_if = { # Multiple characters - tooltip + limit = { has_variable_list = spell_targets_list } + every_in_list = { + variable = spell_targets_list + save_scope_as = this_recipient + teleport_character_effect = { DESTINATION = scope:portal_destination } + } + } + else_if = { # Multiple characters - real + limit = { + has_variable_list = create_portal_targets_list + var:create_portal_rank ?= 2 + } + every_in_list = { + variable = create_portal_targets_list + save_scope_as = this_recipient + teleport_character_effect = { DESTINATION = scope:portal_destination } + } + remove_variable = current_destination + } + else_if = { # Character- tooltip + limit = { + var:current_spell_rank ?= 1 + exists = scope:this_recipient + } + if = { + limit = { + scope:this_recipient = { is_travelling = yes } + } + custom_tooltip = WC_TRAVEL_ENTOURAGE_TOOLTIP + } + scope:this_recipient = { + teleport_character_effect = { DESTINATION = scope:portal_destination } + } + if = { + limit = { + has_variable = create_portal_rank + } + remove_variable = current_destination + } + } + else_if = { # Character - real + limit = { + var:create_portal_spell_rank ?= 1 + exists = var:create_portal_recipient + } + scope:this_recipient = { + teleport_character_effect = { DESTINATION = scope:portal_destination } + } + if = { + limit = { + has_variable = create_portal_rank + } + remove_variable = current_destination + } + } + } +} + +teleport_character_effect = { + save_scope_as = portal_recipient + if = { + limit = { + location.county = $DESTINATION$.county + } + custom_tooltip = wc_spell_create_portal_tt_not + } + else = { + set_variable = { + name = create_portal_location + value = scope:portal_recipient.location + } + if = { + limit = { + is_commanding_army = yes + NOR = { + var:create_portal_rank ?= 3 + var:current_spell_rank ?= 3 + } + } + custom_tooltip = WC_ARMY_TOOLTIP_BAD + } + else_if = { + limit = { + is_travelling = yes + OR = { + var:create_portal_rank ?= 2 + var:current_spell_rank ?= 2 + } + } + custom_tooltip = WC_TRAVEL_ENTOURAGE_TOOLTIP_BAD + } + else_if = { + limit = { + is_travelling = yes + OR = { + var:create_portal_rank ?= 1 + var:current_spell_rank ?= 1 + } + } + custom_tooltip = { + text = wc_spell_create_portal_tt_entourage + current_travel_plan = { + every_entourage_character = { + set_variable = { + name = create_portal_location + value = scope:portal_recipient.location + } + set_location = { + location = $DESTINATION$.title_province + stick_to_location = yes + } + add_character_flag = { + flag = recently_teleported + months = 6 + } + } + add_destination_progress = { + days = 100000 + } + } + } + } + else = { + custom_tooltip = { + text = wc_spell_create_portal_tt + set_location = { + location = $DESTINATION$.title_province + stick_to_location = yes + } + add_character_flag = { + flag = recently_teleported + months = 6 + } + } + custom_tooltip = WC_TELEPORT_TOOLTIP_CD + } + } +} + +teleport_army_effect = { + save_scope_as = army_recipient + if = { + limit = { + location.county = $DESTINATION$.county + } + custom_tooltip = wc_spell_create_portal_tt_army_not + } + else = { + custom_tooltip = wc_spell_create_portal_tt_army_warning + custom_tooltip = { + text = wc_spell_create_portal_tt_army + army_commander = { + save_scope_as = portal_recipient + add_character_flag = { + flag = recently_teleported + months = 6 + } + } + set_army_location = $DESTINATION$.title_province + } + custom_tooltip = WC_TELEPORT_TOOLTIP_CD + } } \ No newline at end of file diff --git a/common/scripted_guis/wc_magic_guis.txt b/common/scripted_guis/wc_magic_guis.txt index 5bf77cec37..4f75c06e17 100644 --- a/common/scripted_guis/wc_magic_guis.txt +++ b/common/scripted_guis/wc_magic_guis.txt @@ -1,6 +1,6 @@ wc_show_mana_gui = { scope = character is_shown = { wc_max_mana_value > 0 } } # Used to show/hide the entire interface wc_show_mp_gui = { scope = character is_shown = { wc_mp_value > 0 } } # Used to show/hide the entire interface - + open_spellbook_sgui = { scope = character @@ -34,7 +34,7 @@ open_spellbook_sgui = { value = var:last_elemental_type } } - + add_to_variable_list = { name = spell_elemental_types target = flag:decay } add_to_variable_list = { name = spell_elemental_types target = flag:spirit } @@ -133,7 +133,9 @@ close_spellbook_sgui = { remove_variable = spellbook_type_cast remove_variable = spellbook_type_view remove_variable = spell_targets_list + remove_variable = previous_target clear_variable_list = target_titles + remove_variable = spellbook_open remove_variable = direct_only @@ -168,7 +170,7 @@ add_spellbook_index_sgui = { add = 1 } } - + } } @@ -274,7 +276,7 @@ update_current_spell_class_sgui = { } } } - + } } @@ -939,14 +941,22 @@ is_selected_target_sgui = { saved_scopes = { target } scope = character is_valid = { - OR = { - AND = { - has_variable = spell_recipient - var:spell_recipient = scope:target + trigger_if = { + limit = { + var:current_spell_name = flag:create_portal } - AND = { - has_variable_list = spell_targets_list - any_in_list = { variable = spell_targets_list this = scope:target } + var:create_portal_destination ?= scope:target + } + trigger_else = { + OR = { + AND = { + has_variable = spell_recipient + var:spell_recipient = scope:target + } + AND = { + has_variable_list = spell_targets_list + any_in_list = { variable = spell_targets_list this = scope:target } + } } } } @@ -1110,6 +1120,7 @@ select_province_start_sgui = { var:current_target_type = flag:title var:current_target_type = flag:title_list } + exists = var:original_recipient var:original_recipient = { is_landed = yes } @@ -1141,147 +1152,248 @@ toggle_titles_list_sgui = { get_titles_list_sgui = { scope = character effect = { - var:original_recipient = { - save_scope_as = spell_target - } if = { limit = { has_variable_list = target_titles } clear_variable_list = target_titles } - scope:spell_target = { - if = { - limit = { - root = { - spell_target_title_subtype_province_trigger = { - SPELL = var:current_spell_name - RANK_VALUE = var:current_spell_rank - } - } - } - every_held_title = { - limit = { - tier = tier_barony - satisfy_spell_triggers_barony = { SPELL = root.var:current_spell_name } - } - save_scope_as = potential_title - root = { - add_to_variable_list = { - name = target_titles - target = scope:potential_title - } - } - } + if = { + limit = { + exists = var:original_recipient + NOT = { var:current_spell_name = flag:create_portal } + } + var:original_recipient = { + save_scope_as = spell_target + } + scope:spell_target = { if = { limit = { root = { - NOT = { has_variable = direct_only } + spell_target_title_subtype_province_trigger = { + SPELL = var:current_spell_name + RANK_VALUE = var:current_spell_rank + } } } - every_vassal_or_below = { - every_held_title = { - limit = { - tier = tier_barony - satisfy_spell_triggers_barony = { SPELL = root.var:current_spell_name } + every_held_title = { + limit = { + tier = tier_barony + satisfy_spell_triggers_barony = { SPELL = root.var:current_spell_name } + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title } - save_scope_as = potential_title + } + } + if = { + limit = { root = { - add_to_variable_list = { - name = target_titles - target = scope:potential_title + NOT = { has_variable = direct_only } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_barony + satisfy_spell_triggers_barony = { SPELL = root.var:current_spell_name } + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } } } } } } - } - else_if = { - limit = { - root = { - spell_target_title_subtype_county_trigger = { - SPELL = var:current_spell_name - RANK_VALUE = var:current_spell_rank + else_if = { + limit = { + root = { + spell_target_title_subtype_county_trigger = { + SPELL = var:current_spell_name + RANK_VALUE = var:current_spell_rank + } } } - } - every_held_title = { - limit = { - tier = tier_county + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } } - save_scope_as = potential_title - root = { - add_to_variable_list = { - name = target_titles - target = scope:potential_title + if = { + limit = { + root = { + NOT = { has_variable = direct_only } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } } } } - if = { + else_if = { limit = { root = { - NOT = { has_variable = direct_only } + spell_target_title_subtype_duchy_trigger = { + SPELL = var:current_spell_name + RANK_VALUE = var:current_spell_rank + } } } - every_vassal_or_below = { - every_held_title = { - limit = { - tier = tier_county + every_held_title = { + limit = { + tier = tier_duchy + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title } - save_scope_as = potential_title + } + } + if = { + limit = { root = { - add_to_variable_list = { - name = target_titles - target = scope:potential_title + NOT = { has_variable = direct_only } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_duchy + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } } } } } + } + } + } + else_if = { + limit = { + var:current_spell_name = flag:create_portal + } + if = { + limit = { + has_variable = previous_target } + remove_variable = previous_target } - else_if = { + every_empire = { limit = { - root = { - spell_target_title_subtype_duchy_trigger = { - SPELL = var:current_spell_name - RANK_VALUE = var:current_spell_rank - } + any_in_de_jure_hierarchy = { + tier = tier_barony + } + exists = holder + holder = { + is_landed = yes + in_diplomatic_range_trigger = { target = root } + is_independent_ruler = yes + highest_held_title_tier = tier_empire } } - every_held_title = { - limit = { - tier = tier_duchy + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title } - save_scope_as = potential_title - root = { - add_to_variable_list = { - name = target_titles - target = scope:potential_title - } + } + } + every_kingdom = { + limit = { + any_in_de_jure_hierarchy = { + tier = tier_barony + } + exists = holder + holder = { + is_landed = yes + in_diplomatic_range_trigger = { target = root } + is_independent_ruler = yes + highest_held_title_tier = tier_kingdom } } - if = { - limit = { - root = { - NOT = { has_variable = direct_only } - } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title } - every_vassal_or_below = { - every_held_title = { - limit = { - tier = tier_duchy - } - save_scope_as = potential_title - root = { - add_to_variable_list = { - name = target_titles - target = scope:potential_title - } - } - } + } + } + every_duchy = { + limit = { + any_in_de_jure_hierarchy = { + tier = tier_barony + } + exists = holder + holder = { + is_landed = yes + in_diplomatic_range_trigger = { target = root } + is_independent_ruler = yes + highest_held_title_tier = tier_duchy + } + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title } } } + every_county = { + limit = { + any_in_de_jure_hierarchy = { + tier = tier_barony + } + exists = holder + holder = { + is_landed = yes + in_diplomatic_range_trigger = { target = root } + is_independent_ruler = yes + highest_held_title_tier = tier_county + } + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } } } } @@ -1467,6 +1579,489 @@ player_has_spell_hack = { } } +player_has_create_portal = { + scope = character + is_valid = { + var:current_spell_name = flag:create_portal + } +} + +set_or_change_target_sgui_portal = { + scope = character + saved_scopes = { target } + effect = { + if = { + limit = { + scope:target = { + tier = tier_barony + } + } + set_variable = { + name = create_portal_destination + value = scope:target + } + pan_camera_to_title = scope:target + } + else = { + every_in_list = { + variable = target_titles + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles_old + target = scope:potential_title + } + } + } + if = { + limit = { + scope:target = { + tier = tier_county + } + } + clear_variable_list = target_titles + if = { + limit = { + has_variable = current_destination + } + set_variable = { + name = previous_target + value = var:current_destination + } + } + set_variable = { + name = current_destination + value = scope:target + } + scope:target = { + holder = { + every_held_title = { + limit = { + tier = tier_barony + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_barony + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + } + else_if = { + limit = { + scope:target = { + tier = tier_duchy + } + } + clear_variable_list = target_titles + if = { + limit = { + has_variable = current_destination + } + set_variable = { + name = previous_target + value = var:current_destination + } + } + set_variable = { + name = current_destination + value = scope:target + } + scope:target = { + holder = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + } + else_if = { + limit = { + scope:target = { + tier = tier_kingdom + } + } + clear_variable_list = target_titles + if = { + limit = { + has_variable = current_destination + } + set_variable = { + name = previous_target + value = var:current_destination + } + } + set_variable = { + name = current_destination + value = scope:target + } + scope:target = { + holder = { + every_held_title = { + limit = { + tier = tier_duchy + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_duchy + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + } + else_if = { + limit = { + scope:target = { + tier = tier_empire + } + } + clear_variable_list = target_titles + set_variable = { + name = current_destination + value = scope:target + } + scope:target = { + holder = { + every_held_title = { + limit = { + tier = tier_kingdom + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_kingdom + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + } + } + } +} + +old_titles_list_sgui = { + scope = character + + effect = { + clear_variable_list = target_titles + every_in_list = { + variable = target_titles_old + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + remove_variable = current_destination + remove_variable = previous_target + clear_variable_list = target_titles_old + } +} + +previous_target_titles_sgui = { + scope = character + + effect = { + if = { + limit = { + var:previous_target = { + tier = tier_empire + } + } + clear_variable_list = target_titles + var:previous_target = { + holder = { + every_held_title = { + limit = { + tier = tier_kingdom + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_kingdom + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + remove_variable = previous_target + } + else_if = { + limit = { + var:previous_target = { + tier = tier_kingdom + } + } + clear_variable_list = target_titles + var:previous_target = { + holder = { + every_held_title = { + limit = { + tier = tier_duchy + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_duchy + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + set_variable = { + name = previous_target + value = var:previous_target.empire + } + } + else_if = { + limit = { + var:previous_target = { + tier = tier_duchy + } + } + clear_variable_list = target_titles + var:previous_target = { + holder = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + set_variable = { + name = previous_target + value = var:previous_target.kingdom + } + } + else_if = { + limit = { + var:previous_target = { + tier = tier_duchy + } + } + clear_variable_list = target_titles + var:previous_target = { + holder = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_county + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + set_variable = { + name = previous_target + value = var:previous_target.duchy + } + } + else_if = { + limit = { + var:previous_target = { + tier = tier_county + } + } + clear_variable_list = target_titles + var:previous_target = { + holder = { + every_held_title = { + limit = { + tier = tier_barony + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + every_vassal_or_below = { + every_held_title = { + limit = { + tier = tier_barony + } + save_scope_as = potential_title + root = { + add_to_variable_list = { + name = target_titles + target = scope:potential_title + } + } + } + } + } + } + set_variable = { + name = previous_target + value = var:previous_target.county + } + } + } +} + +can_change_destination_sgui = { + scope = character + is_valid = { + custom_tooltip = { + text = WC_CANT_CHANGE_DESTINATION + OR = { + NOT = { var:current_spell_rank ?= 1 } + AND = { + var:current_spell_rank ?= 1 + var:spell_recipient = { is_travelling ?= no } + } + } + } + } +} # Sidebar GUI wc_in_diplo_range_sgui = { diff --git a/common/scripted_triggers/wc_magic_spells_triggers.txt b/common/scripted_triggers/wc_magic_spells_triggers.txt index 94625a6b43..1d75136c00 100644 --- a/common/scripted_triggers/wc_magic_spells_triggers.txt +++ b/common/scripted_triggers/wc_magic_spells_triggers.txt @@ -62,6 +62,7 @@ $TRIGGER$ = { SPELL = flag:icefury } $TRIGGER$ = { SPELL = flag:ice_structure } $TRIGGER$ = { SPELL = flag:eternal_winter } + $TRIGGER$ = { SPELL = flag:create_portal } } } @@ -424,6 +425,21 @@ all_requirements_for_casting_satisfied_trigger = { text = IS_STRANGULATED has_character_modifier = wc_strangulate_modifier } + custom_tooltip = { + text = wc_spell_create_portal + var:current_spell_name ?= flag:create_portal + NOR = { + NOT = { exists = var:create_portal_destination } + AND = { + var:current_spell_rank = 1 + var:spell_recipient = { is_travelling = no } + } + AND = { + var:current_spell_rank = 3 + var:spell_recipient = { is_army_in_combat = no } + } + } + } } } @@ -1128,6 +1144,35 @@ target_has_max_stacks_trigger = { } } } + trigger_else_if = { + limit = { + $SPELL$ = flag:create_portal + $RANK$ = 1 + } + OR = { + $TARGET$ = { has_character_flag = recently_teleported } + $TARGET$.current_travel_plan ?= { + any_entourage_character = { + has_character_flag = recently_teleported + } + } + } + } + trigger_else_if = { + limit = { + $SPELL$ = flag:create_portal + $RANK$ = 2 + } + $TARGET$ = { has_character_flag = recently_teleported } + + } + trigger_else_if = { + limit = { + $SPELL$ = flag:create_portal + $RANK$ = 3 + } + $TARGET$.army_commander = { has_character_flag = recently_teleported } + } trigger_else = { always = yes } @@ -1164,9 +1209,10 @@ target_and_root_has_modifier_trigger = { } spell_target_is_character_list_trigger = { # Multiple characters - #OR = { + OR = { AND = { $SPELL$ = flag:exorcism $RANK_VALUE$ = 2 } - #} + AND = { $SPELL$ = flag:create_portal $RANK_VALUE$ = 2 } + } } spell_target_is_province_or_title_trigger = { # One title @@ -1242,6 +1288,7 @@ spell_target_is_character_trigger = { # One character AND = { $SPELL$ = flag:soothing_waters $RANK_VALUE$ = 0 } AND = { $SPELL$ = flag:river_spirits_rage $RANK_VALUE$ < 3 } AND = { $SPELL$ = flag:frost_shock $RANK_VALUE$ < 3 } + AND = { $SPELL$ = flag:create_portal $RANK_VALUE$ = 1 } } } @@ -1302,10 +1349,11 @@ spell_target_is_self_trigger = { ## can be both friendly and enemy army but if they are in both triggers, they both must have different effects spell_target_is_friendly_army_trigger = { - OR = { - AND = { $SPELL$ = flag:flame_wall $RANK_VALUE$ = 0 } - AND = { $SPELL$ = flag:frostfire_bolt $RANK_VALUE$ = 0 } - } + OR = { + AND = { $SPELL$ = flag:flame_wall $RANK_VALUE$ = 0 } + AND = { $SPELL$ = flag:frostfire_bolt $RANK_VALUE$ = 0 } + AND = { $SPELL$ = flag:create_portal $RANK_VALUE$ = 3 } + } } spell_target_is_enemy_army_trigger = { @@ -1318,6 +1366,7 @@ spell_target_is_enemy_army_trigger = { AND = { $SPELL$ = flag:death_grip $RANK_VALUE$ = 0 } AND = { $SPELL$ = flag:blood_boil $RANK_VALUE$ = 0 } AND = { $SPELL$ = flag:river_spirits_rage $RANK_VALUE$ = 3 } + AND = { $SPELL$ = flag:create_portal $RANK_VALUE$ = 3 } } } @@ -1527,6 +1576,7 @@ spell_has_ranks_trigger = { $SPELL$ = flag:coagulation $SPELL$ = flag:summon_water_elemental $SPELL$ = flag:river_spirits_rage + $SPELL$ = flag:create_portal } } @@ -1544,6 +1594,7 @@ spell_is_ritual_trigger = { # RITUALS GO HERE $SPELL$ = flag:epidemic $SPELL$ = flag:crimson_binding $SPELL$ = flag:eternal_winter + $SPELL$ = flag:create_portal } } @@ -1606,6 +1657,7 @@ satisfy_spell_triggers = { $SPELL$ = flag:icefury $SPELL$ = flag:ice_structure $SPELL$ = flag:eternal_winter + $SPELL$ = flag:create_portal } } always = yes diff --git a/gui/spellbook_widget.gui b/gui/spellbook_widget.gui index ec6d70d1de..6ab8ac5f7a 100644 --- a/gui/spellbook_widget.gui +++ b/gui/spellbook_widget.gui @@ -242,7 +242,7 @@ window = { size = { 250 500 } layoutpolicy_horizontal = expanding visible = "[And(Not(GetPlayer.MakeScope.Var( 'spell_recipient' ).IsSet), Not(GetScriptedGui('has_targets_list_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)))]" - + hbox = { visible = "[GetScriptedGui('spell_target_is_province_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" button_standard = { @@ -310,6 +310,7 @@ window = { onclick = "[GetVariableSystem.Set('spell_province_window', 'yes')]" } } + } vbox = { # Target portrait view name = "target_portrait_box" @@ -336,7 +337,9 @@ window = { blockoverride "coa" {} } + } + vbox = { name = "target_portrait_box_single_title" visible = "[And(GetPlayer.MakeScope.Var( 'spell_recipient' ).IsSet, GetScriptedGui('spell_target_is_character_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End))]" @@ -383,7 +386,9 @@ window = { blockoverride "coa" {} } + } + scrollbox = { visible = "[And(GetScriptedGui( 'player_has_targets_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End), GetScriptedGui('spell_target_is_province_list_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End))]" @@ -529,6 +534,7 @@ window = { tooltip = "[Scope.Title.GetHolder.MakeScope.GetScriptValueDesc(Concatenate(Concatenate('wc_', PlayerGetVar('current_spell_class').GetFlagName), '_magic_resistance_value'))]" } } + portrait_body = { datacontext = "[Scope.Title.GetHolder]" @@ -576,6 +582,149 @@ window = { } } + } + scrollbox = { + visible = "[And(GetScriptedGui( 'player_has_targets_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End), GetScriptedGui('spell_target_is_character_list_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End))]" + + size = { 660 590 } + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + scrollbarpolicy_horizontal = as_needed + scrollbar_horizontal = { + using = Scrollbar_Horizontal + } + blockoverride "scrollbox_margins" {} + blockoverride "scrollbox_background" {} + blockoverride "scrollbox_background_fade" {} + blockoverride "scrollbox_content" + { + vbox = { + name = "target_portrait_box_multi_char" + layoutpolicy_horizontal = expanding + spacing = 10 + hbox = { + datamodel = "[GetPlayer.MakeScope.GetList( 'spell_targets_list' )]" + layoutpolicy_horizontal = expanding + item = { + vbox = { + datacontext = "[Scope.GetCharacter]" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + margin = { 15 10 } + background = { + using = Background_Area + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_vertical_up.dds" + blend_mode = alphamultiply + alpha = 0.5 + } + } + vbox = { + spacing = 5 + margin = { 5 0 } + button_standard = { + text = "CLICK_TO_REMOVE_TT" + tooltip = "CLICK_TO_REMOVE_TT" + onclick = "[GetScriptedGui('set_target_or_add_sgui').Execute(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'target', Character.MakeScope).End)]" + } + text_single = { + layoutpolicy_horizontal = expanding + default_format = "#T" + align = center + text = "[Character.GetShortUIName]" + } + + } + vbox = { + name = "char_stats" + layoutpolicy_horizontal = expanding + margin = { 0 10 } + spacing = 5 + + hbox = { + layoutpolicy_horizontal = expanding + text_single = { + text = "COMMANDER_MR_LABEL" + layoutpolicy_horizontal = expanding + default_format = "#clickable" + } + + text_single = { + default_format = "#high" + raw_text = "[Character.MakeScope.ScriptValue(Concatenate(Concatenate('wc_', PlayerGetVar('current_spell_class').GetFlagName), '_magic_resistance_value'))]" + tooltip = "[Character.MakeScope.GetScriptValueDesc(Concatenate(Concatenate('wc_', PlayerGetVar('current_spell_class').GetFlagName), '_magic_resistance_value'))]" + } + } + + portrait_body = { + size = { 100 400 } + blockoverride "portrait_texture" { + portrait_texture = "[Scope.GetCharacter.GetAnimatedPortrait('environment_body', 'camera_lifestyles', 'idle', PdxGetWidgetScreenSize(PdxGuiWidget.Self))]" + position = { 0 30 } + } + blockoverride "mask" { + mask = "gfx/portraits/portrait_mask_body.dds" + + } + blockoverride "opinion_box" + {} + blockoverride "portrait_icons" + {} + blockoverride "coa" + {} + + } + } + + } + + } + } + hbox = { + layoutpolicy_horizontal = expanding + button_standard = { + size = { 200 40 } + visible = "[GetScriptedGui('spell_target_is_character_list_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + + text = "ADD_NEW_TARGET" + tooltip = "[GetScriptedGui('can_add_more_targets_sgui').IsValidTooltip( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + enabled = "[GetScriptedGui('can_add_more_targets_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + icon = { + parentanchor = center + position = { -75 0 } + size = { 30 30 } + texture = "gfx/interface/icons/symbols/icon_plus.dds" + } + onclick = "[ToggleGameView( 'character_finder' )]" + onclick = "[GetVariableSystem.Set('character_finder_magic_selection', 'yes')]" + } + # Create Portal special gui + hbox = { + visible = "[GetScriptedGui('player_has_create_portal').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + button_standard = { + size = { 200 40 } + text_single = { + position = { 0 -2 } + parentanchor = center + text = "CHANGE_DESTINATION_TEXT" + visible = "[GetPlayer.MakeScope.Var( 'create_portal_destination' ).IsSet]" + } + text_single = { + position = { 0 -2 } + parentanchor = center + text = "CHOOSE_DESTINATION_TEXT" + visible = "[Not(GetPlayer.MakeScope.Var( 'create_portal_destination' ).IsSet)]" + } + enabled = "[GetScriptedGui('can_change_destination_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + onclick = "[GetScriptedGui('get_titles_list_sgui').Execute( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + onclick = "[GetScriptedGui('select_province_start_sgui').Execute( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + onclick = "[GetVariableSystem.Set('spell_province_window', 'yes')]" + } + } + } + } + } + } scrollbox = { visible = "[And(GetScriptedGui( 'player_has_targets_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End), GetScriptedGui('spell_target_is_character_list_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End))]" @@ -695,7 +844,7 @@ window = { } } - + vbox = { # For Single Targets only name = "target_info_box" visible = "[Not(GetScriptedGui('has_targets_list_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End))]" @@ -846,8 +995,11 @@ window = { raw_text = "[GetPlayer.MakeScope.Var( 'spell_recipient' ).Title.GetHolder.MakeScope.ScriptValue(Concatenate(Concatenate('wc_', PlayerGetVar('current_spell_class').GetFlagName), '_magic_resistance_value'))]" tooltip = "[GetPlayer.MakeScope.Var( 'spell_recipient' ).Title.GetHolder.MakeScope.GetScriptValueDesc(Concatenate(Concatenate('wc_', PlayerGetVar('current_spell_class').GetFlagName), '_magic_resistance_value'))]" } + + } + } hbox = { margin_top = 10 @@ -946,6 +1098,30 @@ window = { } } } + # Create Portal special gui + hbox = { + visible = "[GetScriptedGui('player_has_create_portal').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + button_standard = { + size = { 200 40 } + text_single = { + position = { 0 -2 } + parentanchor = center + text = "CHANGE_DESTINATION_TEXT" + visible = "[GetPlayer.MakeScope.Var( 'create_portal_destination' ).IsSet]" + } + text_single = { + position = { 0 -2 } + parentanchor = center + text = "CHOOSE_DESTINATION_TEXT" + visible = "[Not(GetPlayer.MakeScope.Var( 'create_portal_destination' ).IsSet)]" + } + tooltip = "[GetScriptedGui('can_change_destination_sgui').IsValidTooltip( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + enabled = "[GetScriptedGui('can_change_destination_sgui').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + onclick = "[GetScriptedGui('get_titles_list_sgui').Execute( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + onclick = "[GetScriptedGui('select_province_start_sgui').Execute( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + onclick = "[GetVariableSystem.Set('spell_province_window', 'yes')]" + } + } background = { using = Background_Area_Dark alpha = 0.5 @@ -954,8 +1130,12 @@ window = { } } + } + + + hbox = { name = "effects_box" @@ -1011,6 +1191,8 @@ window = { } } } + + } # Cast Spell Area @@ -1744,7 +1926,7 @@ window = { vbox = { using = Window_Margins - + spacing = 5 header_pattern_interaction = { layoutpolicy_horizontal = expanding @@ -1760,6 +1942,38 @@ window = { } banner_with_portrait = { + visible = "[GetScriptedGui('player_has_create_portal').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + layoutpolicy_horizontal = expanding + blockoverride "banner_with_portrait_text" + { + text = "SPELL_TARGET_GENERIC_TEXT_PORTAL" + margin_bottom = 20 + } + + hbox = { + margin_bottom = 10 + margin_left = 20 + layoutpolicy_horizontal = expanding + + } + + blockoverride "portrait" + { + portrait_head = { + datacontext = "[GetPlayer.MakeScope.Char]" + + blockoverride "portrait_transformation" + { + portrait_scale = { -1 1 } + portrait_offset = { 1 0 } + } + } + } + + } + banner_with_portrait = { + visible = "[Or(GetScriptedGui( 'spell_target_is_province_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End), GetScriptedGui( 'spell_target_is_province_list_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End))]" + name = "portrait_and_info" layoutpolicy_horizontal = expanding blockoverride "banner_with_portrait_text" @@ -1767,9 +1981,8 @@ window = { text = "SPELL_TARGET_GENERIC_TEXT" margin_bottom = 75 } - + hbox = { - visible = "[Or(GetScriptedGui( 'spell_target_is_province_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End), GetScriptedGui( 'spell_target_is_province_list_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End))]" margin_bottom = 10 margin_left = 20 layoutpolicy_horizontal = expanding @@ -1823,6 +2036,24 @@ window = { } } } + scrollbox = { + name = "titles_list_portal" + visible = "[GetScriptedGui('player_has_create_portal').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + blockoverride "scrollbox_empty" + { + visible = "[IsDataModelEmpty(GetPlayer.MakeScope.GetList( 'target_titles' ))]" + text = "SPELL_NO_TITLES" + } + + blockoverride "scrollbox_content" + { + vbox_list_spell_titles_selection_portal = { + layoutpolicy_horizontal = expanding + } + } + } scrollbox = { name = "armies_list" visible = "[GetScriptedGui( 'spell_target_is_army_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).End)]" @@ -1840,6 +2071,38 @@ window = { } } } + vbox = { + layoutpolicy_horizontal = expanding + visible = "[GetScriptedGui('player_has_create_portal').IsValid( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + spacing = 15 + hbox = { + datacontext = "[GetPlayer.MakeScope.Var( 'current_destination' ).Title]" + visible = "[GetPlayer.MakeScope.Var( 'current_destination' ).IsSet)]" + text_single = { + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + text = SPELL_TARGET_TEXT_PORTAL + } + } + hbox = { + name = "portal_destination_selection" + layoutpolicy_horizontal = expanding + button_standard = { + text = "SHOW_ALL_TITLES_TEXT" + visible = "[GetPlayer.MakeScope.Var( 'current_destination' ).IsSet)]" + onclick = "[GetScriptedGui('old_titles_list_sgui').Execute( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + } + button_standard = { + datacontext = "[GetPlayer.MakeScope.Var( 'previous_target' ).Title]" + text = "SHOW_PREVIOUS_TITLE_TEXT" + tooltipwidget = { + using = LandedTitleTooltip + } + visible = "[GetPlayer.MakeScope.Var( 'previous_target' ).IsSet)]" + onclick = "[GetScriptedGui('previous_target_titles_sgui').Execute( GuiScope.SetRoot( GetPlayer.MakeScope ).End)]" + } + } + } spacer = { size = { 0 10 } } @@ -2759,6 +3022,46 @@ types spellbooktypes { enabled = "[GetScriptedGui( 'is_spell_target_valid_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'target', Scope.Title.MakeScope).End)]" } + hbox = { + margin_left = 45 + margin_right = 5 + + text_single = { + name = "text" + default_format = "#V" + layoutpolicy_horizontal = expanding + raw_text = "[Scope.Title.GetNameNoTooltip]" + } + } + } + } + } + type vbox_list_spell_titles_selection_portal = vbox { + name = "titles_grid" + layoutpolicy_horizontal = expanding + spacing = 3 + datamodel = "[GetPlayer.MakeScope.GetList( 'target_titles' )]" + + item = { + widget = { + name = "title_list_item" + layoutpolicy_horizontal = expanding + size = { 0 45 } + datacontext = "[Scope.Title]" + button_standard = { + size = { 425 45 } + name = "title_button" + + coa_title_tiny_crown = { + position = { 0 -8 } + } + tooltipwidget = { + using = LandedTitleTooltip + } + down = "[GetScriptedGui( 'is_selected_target_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'target', Scope.Title.MakeScope).End)]" + onclick = "[GetScriptedGui('set_or_change_target_sgui_portal').Execute(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'target', Scope.Title.MakeScope).End)]" + } + hbox = { margin_left = 45 margin_right = 5 diff --git a/localization/english/gui/wc_magic_gui_l_english.yml b/localization/english/gui/wc_magic_gui_l_english.yml index a5bc4b6b20..82a3aff2e1 100644 --- a/localization/english/gui/wc_magic_gui_l_english.yml +++ b/localization/english/gui/wc_magic_gui_l_english.yml @@ -21,10 +21,16 @@ CHOOSE_SR_TEXT:0 "Choose $SPELL_RANK_TEXT$" CHOOSE_TITLE_TEXT:0 "Choose [title|E]" CHANGE_TITLE_TEXT:0 "Change [title|E]" + CHOOSE_DESTINATION_TEXT:0 "Choose [Concept('title', 'Destination')|E]" + CHANGE_DESTINATION_TEXT:0 "Change [Concept('title', 'Destination')|E]" CHOOSE_ARMY_TEXT:0 "Choose [army|E]" CHANGE_ARMY_TEXT:0 "Change [army|E]" SPELL_TARGET_TEXT:0 "Choose Spell Target" SPELL_TARGET_GENERIC_TEXT:0 "Choose a target valid under [GetPlayer.MakeScope.Var('original_recipient').Char.GetName] to cast on." + SPELL_TARGET_GENERIC_TEXT_PORTAL:0 "Choose a destination to teleport your target(s) to. If the destination is not a [barony|E], you will be able to choose a [barony|E] under the chosen [title|E]." + SPELL_TARGET_TEXT_PORTAL:0 "Current [title|E]: [GetPlayer.MakeScope.Var( 'current_destination' ).Title.GetName]" + SHOW_ALL_TITLES_TEXT:0 "Show all [titles|E]" + SHOW_PREVIOUS_TITLE_TEXT:0 "Previous [title|E]" ARMY_OWNER_TEXT:0 "#bold [Army.GetOwner.GetNamePossessiveNoTooltip]#! Army" ARMY_COMMANDER_TEXT:0 "#bold Commander:#! [Army.GetCommander.GetNameNoTooltip]" SELECT_TITLE_TEXT:0 "Select Title" diff --git a/localization/english/wc_decisions_l_english.yml b/localization/english/wc_decisions_l_english.yml index 799ed30fb5..9d9041bb99 100644 --- a/localization/english/wc_decisions_l_english.yml +++ b/localization/english/wc_decisions_l_english.yml @@ -272,4 +272,10 @@ go_into_hibernation_decision_desc:0 "Go into hibernation, gaining a massive boost in [health|E] while becoming vulnerable to [hostile_schemes|E]" go_into_hibernation_decision.effect_tt:0 "One [wc_injury|E] or [wc_poison|E] is removed" go_into_hibernation_decision_tooltip:0 "$go_into_hibernation_decision_desc$" - go_into_hibernation_decision_confirm:0 "$go_into_hibernation_decision$" \ No newline at end of file + go_into_hibernation_decision_confirm:0 "$go_into_hibernation_decision$" + + teleport_back_decision:0 "Teleport Back" + teleport_back_decision_desc:0 "Teleport back to your previous location" + teleport_back_decision_tooltip:0 "Take me home!" + teleport_back_decision_confirm:0 "$teleport_back_decision_tooltip$" + wc_teleport_back_decision_effect_tt: "Go back to [home.GetName]" \ No newline at end of file diff --git a/localization/english/wc_game_concepts_lifestyles_l_english.yml b/localization/english/wc_game_concepts_lifestyles_l_english.yml index 30d0d63e77..a4e7a5074e 100644 --- a/localization/english/wc_game_concepts_lifestyles_l_english.yml +++ b/localization/english/wc_game_concepts_lifestyles_l_english.yml @@ -10,6 +10,8 @@ game_concept_wc_shadow_magic_lifestyle_desc:0 "The $game_concept_wc_shadow_magic_lifestyle$ is suitable for Characters who want to $shadow_magic_lifestyle_desc$" game_concept_wc_disorder_magic_lifestyle:0 "Fel Magic $game_concept_lifestyle$" game_concept_wc_disorder_magic_lifestyle_desc:0 "The $game_concept_wc_disorder_magic_lifestyle$ is suitable for Characters who want to $disorder_magic_lifestyle_desc$" + game_concept_wc_order_magic_lifestyle:0 "Arcane Magic $game_concept_lifestyle$" + game_concept_wc_order_magic_lifestyle_desc:0 "The $game_concept_wc_order_magic_lifestyle$ is suitable for Characters who want to $order_magic_lifestyle_desc$" game_concept_wc_Order_magic_lifestyle:0 "Arcane Magic $game_concept_lifestyle$" game_concept_wc_Order_magic_lifestyle_desc:0 "The $game_concept_wc_Order_magic_lifestyle$ is suitable for Characters who want to $order_magic_lifestyle_desc$" game_concept_wc_life_magic_lifestyle:0 "Nature Magic $game_concept_lifestyle$" diff --git a/localization/english/wc_game_concepts_magic_l_english.yml b/localization/english/wc_game_concepts_magic_l_english.yml index 0e5e9f8744..7387ce60a4 100644 --- a/localization/english/wc_game_concepts_magic_l_english.yml +++ b/localization/english/wc_game_concepts_magic_l_english.yml @@ -82,8 +82,8 @@ game_concept_wc_spell_school_shadow_desc:0 "The forces of Shadow represent the individual will of beings to enforce their will, and extend from eldritch beings lost in the vastness of time. Users of Shadow magic must be vigilant against the influence of these powerful entities. The spells in the school of Shadow focus on bending others to one's will, concealing one's motivation and identity, and increasing one's power at others' expense. " game_concept_wc_spell_school_disorder:0 "Fel School" game_concept_wc_spell_school_disorder_desc:0 "Originating from the betrayal of the great demonic titan Sargeras in the depths of early time, the Fel seeks to subvert and destroy all life in the [wc_cosmos|E]. As such, Fel magics focus on entropic decay, enforcing control, and physical destruction. Consorting with the demonic creatures at the source of the Fel can be quite dangerous." - game_concept_wc_spell_school_order:0 "Arcane School" - game_concept_wc_spell_school_order_desc:0 "The forces of the Arcane represent the physical laws of the [wc_cosmos|E] itself. Underlying the properties of the [wc_spell_school_elemental|E], the Arcane is a seething and disorderly font of energy that can empower spellcasters to change reality at a fundamental level. Arcane spells serve a variety of functions; chief among them control of the [wc_elements|E], and the fundamental manipulation of magic and time." + game_concept_wc_spell_school_Order:0 "Arcane School" + game_concept_wc_spell_school_Order_desc:0 "The forces of the Arcane represent the physical laws of the [wc_cosmos|E] itself. Underlying the properties of the [wc_spell_school_elemental|E], the Arcane is a seething and disorderly font of energy that can empower spellcasters to change reality at a fundamental level. Arcane spells serve a variety of functions; chief among them control of the [wc_elements|E], and the fundamental manipulation of magic and time." game_concept_wc_spell_school_life:0 "Nature School" game_concept_wc_spell_school_life_desc:0 "Life permeates the [wc_cosmos|E], and the interplay between altruistic harmony and avaricious competition creates an interplay of complexity that has given rise to a great source of strength for all living beings. This is known as Nature Magic and it focuses on growth, harmony, and balance between and among living things. As such it focuses on healing, voluntary cooperation, and brute strength. \nBecause of the emergent similarities between living and elemental beings, an association between Life and the [wc_spell_school_elemental|E] known as Spirit." game_concept_wc_spell_school_death:0 "Death School" diff --git a/localization/english/wc_game_concepts_magic_spells_l_english.yml b/localization/english/wc_game_concepts_magic_spells_l_english.yml index 28e7caa611..1250e52323 100644 --- a/localization/english/wc_game_concepts_magic_spells_l_english.yml +++ b/localization/english/wc_game_concepts_magic_spells_l_english.yml @@ -625,3 +625,23 @@ wc_spell_eternal_winter_targets:0 "[duchy|E]" wc_spell_eternal_winter_effects:0 "The target [duchy|E] as well as two surrounding duchies are drained on some of their [income|E] and [dynasty_prestige|E] which is instead given to the caster. In addition, during the winter months the target areas are inflicted with a powerful [wc_spell_blizzard|E]." wc_learn_spell_eternal_winter:0 "Learn the spell: [wc_spell_eternal_winter|E]" + + + game_concept_wc_spell_create_portal:0 "Ritual: Create Portal" + game_concept_wc_spell_create_portal_desc:0 "Open a portal to another province, allowing for swift travel between the two locations." + wc_spell_create_portal_type:0 "[wc_spell_type_ritual|E]" + wc_spell_create_portal_targets:0 "[barony|E], [character|E], [army|E], [entourage|E]" + wc_spell_create_portal_effects:0 "[wc_spell_rank|E] 1: Create a portal between the target character's location to any other province. If target is in a travel [Concept('entourage', 'Groups')|E], they will be teleported as well.\n[wc_spell_rank|E] 2: Portal can now teleport multiple characters.\n[wc_spell_rank|E] 3: Portal can now teleport entire armies." + wc_learn_spell_create_portal:0 "You learn [wc_spell_create_portal|E]" + wc_spell_create_portal:0 "You must have a destination selected to cast this spell, and/or the army cannot be in combat." + wc_spell_create_portal_tt: "[portal_recipient.GetName] will teleport to [portal_destination.GetName]" + wc_spell_create_portal_tt_army: "[army_recipient.GetName] will teleport to [portal_destination.GetName]" + wc_spell_create_portal_tt_army_warning: "#warning @warning_icon! If the army is teleported onto another hostile army, they will automatically enter combat with it.#!" + wc_spell_create_portal_tt_army_not: "#warning @warning_icon! [army_recipient.GetName] is already in or near [portal_destination.GetName] and will not be teleported.#!" + wc_spell_create_portal_tt_not: "#warning @warning_icon! [portal_recipient.GetName] is already in or near [portal_destination.GetName]#!" + wc_spell_create_portal_tt_entourage: "[portal_recipient.GetNamePossessive] [travel|E] [entourage|E] will also teleport to [portal_destination.GetName]" + WC_TRAVEL_ENTOURAGE_TOOLTIP:0 "Because [this_recipient.GetName] is part of a [travel|E] [entourage|E], the destination has automatically been set to the next destination in the [entourage|E]'s path." + WC_TRAVEL_ENTOURAGE_TOOLTIP_BAD:0 "#warning @warning_icon! [portal_recipient.GetName] is part of a [travel|E] [entourage|E], and cannot be teleported away from the rest of the group. If you'd like to teleport [portal_recipient.GetFirstNameNoTooltip] and the rest of [portal_recipient.GetHerHis] [entourage|E], you must use [wc_spell_rank|E] 1 on [portal_recipient.GetFirstNameNoTooltip].#!" + WC_ARMY_TOOLTIP_BAD:0 "#warning @warning_icon! [portal_recipient.GetName] is commanding an [army|E], and cannot be teleported away from the rest of the group. If you'd like to teleport [portal_recipient.GetFirstNameNoTooltip] and the rest of [portal_recipient.GetHerHis] [army|E], you must use [wc_spell_rank|E] 3 on [portal_recipient.GetFirstNameNoTooltip].#!" + WC_CANT_CHANGE_DESTINATION:0 "You cannot change the destination if the target is part of a [travel|E] [entourage|E]" + WC_TELEPORT_TOOLTIP_CD:0 "[portal_recipient.GetFirstNameNoTooltip] will not be able to take another portal for #V 6#! months. [portal_recipient.GetSheHe] will be able to teleport back to their location using the [GetDecisionWithKey('teleport_back_decision').GetName] decision." \ No newline at end of file