Skip to content

Commit

Permalink
SotA: Have Ardonna & Shynal profiles handled by objects instead of ev…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
sigurdfdragon committed May 29, 2019
1 parent ddd8d3e commit b118af3
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 132 deletions.
Expand Up @@ -366,7 +366,6 @@ With further observation, I have determined that this is probably not the way to
[/event]

{HERO_DEATHS}
{MANAGE_PROFILE}
{MAKE_BATS_NORMAL}
{ZOMBIES}

Expand Down
Expand Up @@ -931,7 +931,6 @@ Well, I might as well do my experiment and worry about leaving later."
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}

#undef PLACE_GUARD
#undef MOVE_AND_PLACE_GUARD
Expand Down
Expand Up @@ -273,7 +273,6 @@ Even with the delay at the graveyard, I reached the outskirts of Llorvin at firs
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}

#undef THEY_ARE_UNDEAD
[/scenario]
Expand Up @@ -644,7 +644,6 @@ The journey started well enough, but on the dawn following our departure, the wi
{HERO_DEATHS}
{TRANSFORM_BATS_FOR_SHIP}
{ZOMBIES}
{MANAGE_PROFILE}

#undef PLACE_SAILOR
#undef OPEN_DOOR
Expand Down
Expand Up @@ -437,7 +437,6 @@ When the captain retained his memories, I reasoned that it may have been because
{HERO_DEATHS}
{TRANSFORM_BATS_FOR_SHIP}
{ZOMBIES}
{MANAGE_PROFILE}

#undef SHOW_SAILS_MENU_ITEM
#undef HIDE_SAILS_MENU_ITEM
Expand Down
Expand Up @@ -607,7 +607,6 @@ I was so sure I had the answer! I was wrong. I wanted to believe that I was imag
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}

#undef MOVE_AND_PLACE_BAT
#undef CAVE_TERRAINS
Expand Down
Expand Up @@ -256,5 +256,4 @@ Rastaban seems like an acceptable ally. He is quite different from the stodgy te
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
[/scenario]
Expand Up @@ -396,7 +396,6 @@ My primary objective was met, and I had been able to press a number of ghosts in
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}

#undef MAX_NUMBER_OF_WOSES
#undef WOSES_PER_TURN
Expand Down
Expand Up @@ -264,6 +264,5 @@ We reached the Ford of Abez as the dawn light spread behind the mountain peaks t
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]
Expand Up @@ -408,6 +408,5 @@ We have reached a pass through the mountains that Ras-Tabahn knew of. The air is
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]
Expand Up @@ -528,6 +528,5 @@ We crossed the high plateaus, and forded the Arkan-thoria. Then we headed up int
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]
Expand Up @@ -281,11 +281,6 @@ Now the process is complete for both of us. I posted a guard so nothing could ha
[/filter]
[/modify_unit]

# Update the profile in case Ardonna didn't level here.
[fire_event]
name=ardonna_profile
[/fire_event]

# For some reason, the handling of Ardonna (and not Ras-Tabahn) causes her
# to not have full mp at the start of the scenario, so fix that.
[heal_unit]
Expand Down Expand Up @@ -528,7 +523,6 @@ Now the process is complete for both of us. I posted a guard so nothing could ha
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}

#undef CHANGE_SPIDER_MOVES
Expand Down
Expand Up @@ -160,6 +160,5 @@ We continued down the tunnel in utter darkness for a time. The darkness presente
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]
Expand Up @@ -818,6 +818,5 @@ We left the fires of the mountain behind and plunged once more into darkness. Af
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]
Expand Up @@ -910,6 +910,5 @@ We finally made it out of the mountains. We crossed the Ford of Abez late this m
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
{KIDS_ADVANCE}
[/scenario]
63 changes: 61 additions & 2 deletions data/campaigns/Secrets_of_the_Ancients/utils/characters.cfg
Expand Up @@ -5,12 +5,34 @@
type=SotA Dark Adept
id=Ardonna
name= _ "Ardonna"
profile=portraits/ardonna.png
gender=female
canrecruit=yes
[modifications]
{TRAIT_QUICK}
{TRAIT_RESILIENT}
[object]
# Ardonna is a normal unit, but uses mostly custom portraits.
# This object handles the necessary changes.
[effect]
# Default portrait, only overridden if any below are applied.
apply_to=profile
portrait="portraits/ardonna.png"
[/effect]
[effect]
[filter]
type=SotA Necromancer
[/filter]
apply_to=profile
portrait="portraits/humans/necromancer+female.png"
[/effect]
[effect]
[filter]
type=SotA Lich, SotA Ancient Lich
[/filter]
apply_to=profile
portrait="portraits/ardonna-lich.png"
[/effect]
[/object]
[/modifications]
#enddef

Expand Down Expand Up @@ -52,12 +74,49 @@
type=Delinquent
id=Shynal
name= _ "Shynal"
profile="portraits/shynal-outlaw.png"
gender=female
{IS_LOYAL}
[modifications]
{TRAIT_LOYAL}
{TRAIT_RESILIENT}
[object]
# Shynal uses a couple custom portraits.
# This object handles the necessary changes.
[effect]
# Default portrait, only overridden if any below are applied.
# Has outlaw theme if not advanced to dark adept.
apply_to=profile
portrait="portraits/shynal-outlaw.png"
[/effect]
[effect]
[filter]
type=SotA Dark Adept, Dark Adept, SotA Dark Sorcerer, Dark Sorcerer
[/filter]
apply_to=profile
portrait="portraits/shynal-adept.png"
[/effect]
[effect]
[filter]
type=SotA Necromancer, Necromancer
[/filter]
apply_to=profile
portrait="portraits/humans/necromancer+female.png"
[/effect]
[effect]
[filter]
type=Lich
[/filter]
apply_to=profile
portrait="portraits/lich.png"
[/effect]
[effect]
[filter]
type=Ancient Lich
[/filter]
apply_to=profile
portrait="portraits/brown-lich.png"
[/effect]
[/object]
[/modifications]
#enddef

Expand Down
115 changes: 5 additions & 110 deletions data/campaigns/Secrets_of_the_Ancients/utils/sota-utils.cfg
Expand Up @@ -310,59 +310,6 @@
[/event]
#enddef

# Ardonna is a normal unit, but uses mostly custom portraits. These events cause the
# portrait to change as necessary. The profile event is called automatically by the
# post_advance event or can be called manually. This macro is included in every scenario.
#define MANAGE_PROFILE
[event]
name=post_advance
first_time_only=no
[filter]
id=Ardonna
[/filter]

[fire_event]
name=ardonna_profile
[/fire_event]
[/event]

[event]
name=ardonna_profile
first_time_only=no

[store_unit]
[filter]
id=Ardonna
[/filter]
variable=Ardonna_stored
[/store_unit]
[switch]
variable=Ardonna_stored.type
[case]
value=SotA Necromancer
[set_variable]
name=Ardonna_stored.profile
value="portraits/humans/necromancer+female.png"
[/set_variable]
[/case]
[case]
value=SotA Lich, SotA Ancient Lich
[set_variable]
name=Ardonna_stored.profile
value="portraits/ardonna-lich.png"
[/set_variable]
[/case]
# Other values should not change it from "profile=portraits/ardonna.png"
[/switch]
[unstore_unit]
variable=Ardonna_stored
[/unstore_unit]
[clear_variable]
name=Ardonna_stored
[/clear_variable]
[/event]
#enddef

# If one of the two kids is advanced to something other than a Dark Adept, they complain.
# The player is given the choice to reconsider. They say something about being very
# powerful which may clue the player in to the fact that they can become Ancient Liches,
Expand All @@ -388,63 +335,6 @@
[/fire_event]
[/then]
[/if]

[if]
# Shynal uses a couple custom portraits. We manage them here.
[variable]
name=unit.id
equals=Shynal
[/variable]
[then]
[store_unit]
# Her type may have just changed, so we will store a fresh
# copy of the unit.
[filter]
id=$unit.id
[/filter]
variable=Shynal_stored
[/store_unit]
[switch]
variable=Shynal_stored.type
[case]
value=SotA Dark Adept, Dark Adept, SotA Dark Sorcerer, Dark Sorcerer
[set_variable]
name=Shynal_stored.profile
value="portraits/shynal-adept.png"
[/set_variable]
[/case]
[case]
value=SotA Necromancer, Necromancer
[set_variable]
name=Shynal_stored.profile
value="portraits/humans/necromancer+female.png"
[/set_variable]
[/case]
[case]
value=Lich
[set_variable]
name=Shynal_stored.profile
value="portraits/lich.png"
[/set_variable]
[/case]
[case]
value=Ancient Lich
[set_variable]
name=Shynal_stored.profile
value="portraits/brown-lich.png"
[/set_variable]
[/case]
# Other values should not change it from its original
# outlaw-themed value.
[/switch]
[unstore_unit]
variable=Shynal_stored
[/unstore_unit]
[clear_variable]
name=Shynal_stored
[/clear_variable]
[/then]
[/if]
[/event]

# This event is split from above for readability.
Expand Down Expand Up @@ -876,6 +766,11 @@
name=trait
variable=stored_necromancer.modifications.trait[1]
[/insert_tag]
# Ardonna & Shynal have an object handling their portraits, so copy that as well
[insert_tag]
name=object
variable=stored_necromancer.modifications.object[0]
[/insert_tag]
[/modifications]

to_variable=new_lich # Don't create the unit yet. Just store it.
Expand Down

0 comments on commit b118af3

Please sign in to comment.