Skip to content

Commit

Permalink
Rework charm, heal and protect spells to use targeted decision #13
Browse files Browse the repository at this point in the history
It simplifies things a lot and it's easier for the player:
- Simplify the spell events (3 per spell type)
- Remove the associated plots
- Use scrippted trigger can_cast_spell_trigger to reduce duplication
- Add some logging for casted spells (game.log), for future balance
  • Loading branch information
rquinio committed Jul 24, 2016
1 parent dd5e8fa commit b9ae13d
Show file tree
Hide file tree
Showing 9 changed files with 605 additions and 1,006 deletions.
284 changes: 0 additions & 284 deletions MOD/Witcher/common/objectives/W_plots.txt
Original file line number Diff line number Diff line change
@@ -1,287 +1,3 @@
# Charm character
plot_charm_character = {
type = realm_characters_plus

# Plotter scope
potential = {
OR = {
AND = {
OR = {
trait = sorcerer
trait = source
}
NOT = { has_character_modifier = drained }
prisoner = no
NOT = { trait = incapable }
}
job_mage = {
OR = {
trait = sorcerer
trait = source
}
NOT = { has_character_modifier = drained }
prisoner = no
NOT = { trait = incapable }
}
}
}

# Target allow trigger for when players target a specific character in the GUI
player_allow = {
NOT = { culture = wilderness }
is_within_diplo_range = FROM
ai = yes # To keep AI from using it against a player
NOT = {
has_opinion_modifier = { who = FROM modifier = opinion_charmed }
}
}

# Target character scope
allow = {
NOT = { culture = wilderness }
is_within_diplo_range = FROM
ai = yes # To keep AI from using it against a player
NOT = {
has_opinion_modifier = { who = FROM modifier = opinion_charmed }
}
FROM = {
OR = {
spouse = { character = ROOT }
any_lover = { character = ROOT }
liege = { character = ROOT }
}
}
}

chance = {
factor = 1
modifier = { factor = 0.1 }
modifier = { factor = 0.1 FROM = { has_job_title = job_mage } }
# Rank
modifier = { factor = 2.0 ROOT = { liege = { character = FROM } } }
modifier = { factor = 1.5 ROOT = { higher_tier_than = duke } }
modifier = { factor = 1.5 ROOT = { higher_tier_than = king } }
modifier = { factor = 1.5 ROOT = { higher_tier_than = FROM } }
# Traits
modifier = { factor = 2.0 FROM = { trait = mystic } }
modifier = { factor = 2.0 FROM = { trait = kind } }
modifier = { factor = 2.0 FROM = { trait = gregarious } }
modifier = { factor = 2.0 FROM = { trait = charitable } }
# Opinion
modifier = { factor = 2.0 NOT = { opinion = { who = FROM value = 0 } } }
modifier = { factor = 2.0 NOT = { opinion = { who = FROM value = -25 } } }
modifier = { factor = 2.0 NOT = { opinion = { who = FROM value = -50 } } }
modifier = { factor = 2.0 NOT = { opinion = { who = FROM value = -75 } } }
}

creation_effect = {
hidden_tooltip = { character_event = { id = plots.1 } }
}

success = {
has_opinion_modifier = { who = FROM modifier = opinion_charmed }
}

effect = {
custom_tooltip = { text = plot_charm_character_tooltip }
}

abort = {
is_alive = no
}
}
# Heal character
plot_heal_character = {
type = realm_characters_plus

# Plotter scope
potential = {
OR = {
AND = {
OR = {
trait = sorcerer
trait = source
}
NOT = { has_character_modifier = drained }
prisoner = no
NOT = { trait = incapable }
}
job_mage = {
OR = {
trait = sorcerer
trait = source
}
NOT = { has_character_modifier = drained }
prisoner = no
NOT = { trait = incapable }
}
}
}

# Target allow trigger for when players target a specific character in the GUI
player_allow = {
NOT = { culture = wilderness }
is_within_diplo_range = FROM
OR = {
is_ill = yes
trait = wounded
trait = maimed
trait = infirm
trait = blinded
trait = eunuch
}
}

# Target character scope
allow = {
NOT = { culture = wilderness }
is_within_diplo_range = FROM
OR = {
is_ill = yes
trait = wounded
trait = maimed
trait = infirm
trait = blinded
trait = eunuch
}
FROM = {
OR = {
spouse = { character = ROOT }
any_child = { character = ROOT }
}
}
}

chance = {
factor = 1
modifier = { factor = 0.1 }
modifier = { factor = 0.1 FROM = { has_job_title = job_mage } }
# Traits
modifier = { factor = 2.0 FROM = { trait = kind } }
modifier = { factor = 2.0 FROM = { trait = gregarious } }
modifier = { factor = 2.0 FROM = { trait = charitable } }
# Family
modifier = { factor = 5.0 dynasty = FROM }
modifier = { factor = 10.0 spouse = { character = FROM } }
modifier = { factor = 10.0 father = { character = FROM } }
modifier = { factor = 10.0 mother = { character = FROM } }
modifier = { factor = 10.0 any_lover = { character = FROM } }
# Opinion
modifier = { factor = 2.0 reverse_opinion = { who = FROM value = 25 } }
modifier = { factor = 2.0 reverse_opinion = { who = FROM value = 50 } }
modifier = { factor = 2.0 reverse_opinion = { who = FROM value = 75 } }
modifier = { factor = 0 NOT = { reverse_opinion = { who = FROM value = 0 } } }
}

creation_effect = {
hidden_tooltip = { character_event = { id = plots.10 } }
}

success = {
NOT = {
is_ill = yes
trait = wounded
trait = maimed
trait = infirm
trait = blinded
trait = eunuch
}
}

effect = {
custom_tooltip = { text = plot_heal_character_tooltip }
}

abort = {
is_alive = no
}
}
# Protect character
plot_protect_character = {
type = realm_characters_plus

# Plotter scope
potential = {
NOT = { culture = wilderness }
OR = {
AND = {
OR = {
trait = sorcerer
trait = source
}
NOT = { has_character_modifier = drained }
prisoner = no
NOT = { trait = incapable }
}
job_mage = {
OR = {
trait = sorcerer
trait = source
}
NOT = { has_character_modifier = drained }
prisoner = no
NOT = { trait = incapable }
}
}
}

# Target allow trigger for when players target a specific character in the GUI
player_allow = {
NOT = { culture = wilderness }
is_within_diplo_range = FROM
NOT = { has_character_modifier = protection_spell }
}

# Target character scope
allow = {
NOT = { culture = wilderness }
is_within_diplo_range = FROM
NOT = { has_character_modifier = protection_spell }
FROM = {
OR = {
spouse = { character = ROOT }
any_child = { character = ROOT }
}
}
}

chance = {
factor = 1
modifier = { factor = 0.1 }
modifier = { factor = 0.1 FROM = { has_job_title = job_mage } }
# Traits
modifier = { factor = 2.0 FROM = { trait = kind } }
modifier = { factor = 2.0 FROM = { trait = gregarious } }
modifier = { factor = 2.0 FROM = { trait = charitable } }
# Family
modifier = { factor = 5.0 dynasty = FROM }
modifier = { factor = 10.0 spouse = { character = FROM } }
modifier = { factor = 10.0 father = { character = FROM } }
modifier = { factor = 10.0 mother = { character = FROM } }
modifier = { factor = 10.0 any_lover = { character = FROM } }
# Opinion
modifier = { factor = 2.0 reverse_opinion = { who = FROM value = 25 } }
modifier = { factor = 2.0 reverse_opinion = { who = FROM value = 50 } }
modifier = { factor = 2.0 reverse_opinion = { who = FROM value = 75 } }
modifier = { factor = 0 NOT = { reverse_opinion = { who = FROM value = 0 } } }
}

creation_effect = {
hidden_tooltip = { character_event = { id = plots.20 } }
}

success = {
has_character_modifier = protection_spell
}

effect = {
custom_tooltip = { text = plot_protect_character_tooltip }
}

abort = {
is_alive = no
}
}
# Discredit fellow vassal - more accessible version of weaken fellow vassal
plot_discredit_fellow_vassal = {
type = realm_characters
Expand Down
11 changes: 11 additions & 0 deletions MOD/Witcher/common/scripted_triggers/W_scripted_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,15 @@ can_be_mage_trigger = {
NOT = { has_opinion_modifier = { who = PREV modifier = opinion_left_council } }
NOT = { has_opinion_modifier = { who = PREV modifier = opinion_refused_council } }
}
}

# Checks that character is a capable spellcaster
# Does not check for drained modifier
can_cast_spell_trigger = {
OR = {
trait = sorcerer
trait = source
}
prisoner = no
NOT = { trait = incapable }
}
Loading

0 comments on commit b9ae13d

Please sign in to comment.