Skip to content

Commit

Permalink
cant cancel ritual casts
Browse files Browse the repository at this point in the history
  • Loading branch information
helloruhe committed Sep 16, 2024
1 parent 1aee971 commit 4933f6b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
14 changes: 14 additions & 0 deletions common/scripted_guis/wc_magic_guis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,20 @@ cancel_cast_sgui = {
}
}

can_cancel_cast_sgui = {
scope = character
saved_scopes = { spell }

is_valid = {
custom_description = {
text = cant_cancel_ritual_trigger
NOT = {
spell_is_ritual_trigger = { SPELL = scope:spell }
}
}
}
}

test_sgui = {
scope = character

Expand Down
9 changes: 9 additions & 0 deletions common/trigger_localization/wc_magic_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,13 @@ only_target_self_trigger = {

spell_cant_be_hacked_trigger = {
first = WC_CANT_HACK_SPELL
}

spell_is_ritual_trigger = {
first = WC_SPELL_IS_RITUAL
first_not = WC_SPELL_IS_NOT_RITUAL
}

cant_cancel_ritual_trigger = {
first_not = WC_CANT_CANCEL_RITUAL_NOT
}
2 changes: 2 additions & 0 deletions gui/spellbook_widget.gui
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,8 @@ widget = {

button_standard = {
text = "CANCEL_CAST_BUTTON"
tooltip = "[GetScriptedGui('can_cancel_cast_sgui').IsValidTooltip( GuiScope.SetRoot( GetPlayer.MakeScope ).AddScope( 'spell', MakeScopeFlag(Scope.GetFlagName)).End)]"
enabled = "[GetScriptedGui( 'can_cancel_cast_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'spell', MakeScopeFlag(Scope.GetFlagName)).End)]"
onclick = "[GetScriptedGui( 'cancel_cast_sgui' ).Execute(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'spell', MakeScopeFlag(Scope.GetFlagName)).End)]"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@
WC_ONLY_TARGET_SELF_FIRST_NOT:0 "You can only target yourself."
WC_CANT_HACK_SPELL:0 "Can't hack this spell."
WC_CANT_REDUCE_RITUAL_SPELL:0 "Can't reduce the cooldown of rituals."
WC_CANT_REVERSE_RITUAL_SPELL:0 "Can't reverse the causality of rituals."
WC_CANT_REVERSE_RITUAL_SPELL:0 "Can't reverse the causality of rituals."
WC_SPELL_IS_RITUAL:0 "This is a ritual spell."
WC_SPELL_IS_NOT_RITUAL:0 "This is not a ritual spell."
WC_CANT_CANCEL_RITUAL_NOT:0 "Can't cancel a ritual cast."

0 comments on commit 4933f6b

Please sign in to comment.