Outcomes

From Wildermyth Wiki
Revision as of 21:31, 12 December 2019 by Pbelanger (talk | contribs) (Added DoFirstValid, DoOneRandom, Test, IfPlayerChose, IfRolesArePresent, SetRole, IfAnyTrigger, AttackRoll, Damage, Animate, ActionPoints, and GrantActionPoints)

Outcomes are things that happen! Generally, you'll be seeing these in the context of Effects. Outcomes can make a lot of things happen, usually via events and abilities. Event Outcomes usually include things like granting resources or relationship points, applying a Theme or Aspect to a hero, starting a Mission, or causing another event to happen. Ability Outcomes generally include things like making an attack roll, dealing damage, moving, adjusting stats in some way, or modifying scenery on the map.

(For some less technical descriptions, take a look at the Types of Outcomes we support. For a more general overview of how outcomes relate to other parts of Wildermyth, see the Data Format Overview)

General

All Outcomes have the following fields:

  • STUB: for developer-facing documentation, or to note unimplemented but intended functionality.
  • choose: Sometimes there is more than one target for a given role. If so, does this outcome apply to all targets? or one at random?
  • target: Who (or what) does this outcome affect? All of the individual pieces will target this entity.

Description

Show a story dialog! This shows a story with no player choices at the end (unlike CHOICE targets, which are used to show stories with choices at the end)

  • lightweight: If true and if the context is appropriate, show this content in-world instead of in a full Story Dialog. (i.e. the comic panels will be shown at the bottom of the screen instead of full-screen, like with callDownVolleyOfArrows)
  • blockOtherChanges: If true, the outcomes after this won't occur until after this Description is over. Useful for cases when you want this event to grant an item or add calamities after the comic shows.
  • finalButtonText: Should the final button of this comic have specific text? (By default, the final button will show "Done")
  • script: The actual comic panels to show. (Edit using the comics editor)

RelationshipPoints

Adds relationship points to the given roles, or changes the relationship between roles.

  • amount: The number of relationship points to grant
  • who: Who to grant the relationship points to (RP is distributed evenly between all relationship pairs)
  • scaling: What to multiply the amount by. None: Distribute exactly the amount of RP given. People: Multiply by the number of individuals in the given roles. Ships: multiply by the number of relationship pairs. (i.e. each relationship will get the given amount of RP)
  • forceChangeRelationshipTo: Force the relationship type between individuals (for lover/rival, "who" must contain exactly two individuals)

GrantXP

Grant XP to the given target

  • grantXP: The amount of XP to grant

UpgradeGear

Shows a Gear Choice popup allowing heroes to replace an existing item.

  • query: Run this query on the target (hero) and offer the results to the player
    • forceItemId:
    • chapterModifier: Add this modifier to the chapter we pick gear for (i.e. if chapterModifier=1, the created gear will be better tier, something you would generally expect to see in the next chapter)
    • allowArmor: Can the created item be armor?
    • allowWeapon: Can the created item be a weapon?
    • allowAugment: Can the created item be an augment?
    • allowOffhand: Can the created item be an offhand?
    • specificAugment: Create a specific type of augment
    • element: Create an elemental weapon! This is commonly used with UpgradeGear.upgradeWeapon to turn a weapon into an elemental weapon. Note that granting an elemental weapon will always unlock that weapon group for crafting.
  • chapterModifier: If not null, add this modifier to the chapter we pick gear for (i.e. if chapterModifier=1, the created gear will be better tier, something you would generally expect to see in the next chapter) (Overwrites query.chapterModifier, useful if you want to use an Expression)
  • restrictTo: If not null, this item can only be given to the provided role(s)
  • upgradeWeapon: The specific weapon being upgraded. This is used with upgradeFromSpirit or element to try and create a similar elemental weapon.
  • upgradeFromSpirit: If this is an elemental upgrade from a spirit, this is the Role of the spirit, from which an elemental type is taken.

Mission

MissionDefault.png

Starts a fight to the death. A fair amount of stuff can be specified here.

  • goal: What is this fight about? Used by mission victories and followups to tell the right stories.
  • combatants: Who is fighting in this Mission? By default, it's "party" against "foes", but any roles can be put in (More info below)
  • combatModifiers: Add advantages or disadvantages to the player (More info below)
  • site: The site this Mission is taking place at
  • missionPlanOverride: Overrides the site plan (environment) that the mission takes place in (cave, forest shrine, library, etc.)
  • format: Overrides the format of the mission (assault, defense, ambushed, or arena)
  • musicOverride: Overrides the music played during the mission
  • skipDefaultPlots: If true, don't use the regular plot based on the format - a custom plot is being used.
  • mutators: Apply mutators that affect the layout of the mission in certain ways. (e.g. randomFires, closeAllDoors, forbidSpirits, etc.)
  • victoryEventIds: If set, the mission victory will be one of these events (testing from first to last), or no event if none match. (The event type this links to should usually be set to OTHER)
  • failureEventIds: If set, the mission failure will be one of these events (testing from first to last), or no event if none match. (The event type this links to should usually be set to OTHER)

Combatants

The people and monsters fighting in this battle.

You can set the role of a combatant and their side. You don't need to use party or foes, so if you want an event with only one player fighting, go for it. You can also put NPCs on your side, which you'll be able to control. (Even monsters! Though, maybe use with caution? It's not really supported right now?)

Use roles (instead of the above role) to group several roles into a single combatant; useful for displaying multiple roles on a single enemy card.

You can specify a customThreat, which can include a flavor and strength (if not set, they use the defaults), or you can specify specific monsterTracks.

You can add custom items to humans, either via ID or by Role. By ID is nice and easy, standard items. By Role is probably for when you want an item to have certain aspects, and you create it beforehand in the implications. In both cases, items will be equipped to the combatant for the duration of the mission. If you want a player to keep an item afterward, you can add an AddGear Outcome to manage that.

Specify a customCard if you want to override the default way the enemy shows up in cards at the start of a mission.

CombatantCustomCard.png

  • role: Who is fighting?
  • roles: Use this list (instead of the above role) to group several roles into a single combatant; useful for displaying multiple roles on a single enemy card
  • side: What side is this role fighting for? Note that you shouldn't put a hero on the enemy side unless you actually want them to die. (For things like facing a possessed hero, use implications and set "cloneRelatedEntity" to true in the query)
  • addAspects: Add aspects to this combatant for the duration of the mission
  • customThreat: Contains custom options for specifying threats
    • threatFlavor: If set, this will override the threat flavor, i.e. gorgons, drauven, etc.
    • threatStrength: If non-zero, this will override the threat strength, i.e. how many cards are drawn
    • useExtraChapterCards: Should this threat use extra cards based on what chapter it is?
    • monsterTracks: If set, this threat will use the given monster cards instead of random ones. threatFlavor and threatStrength will be ignored.
  • customIndividuals: Create the given individuals by ID
  • customItemsById: these items (created by ID) are added to the combatant for the duration of the mission
  • customItemsByRole: these items (chosen by Role) are added to the combatant for the duration of the mission
  • customCard: Can be used to give specific combatants custom name and description that show up on the monster card at the beginning of the mission. (Doesn't work with threats, only specific individuals or groups)

Combat Modifiers

Add advantages or disadvantages to the player faction

  • type: Should the player have an advantage, or a disadvantage?
  • number: How many advantages/disadvantages should the player have? (This many will be picked randomly based on the type)
  • specificModifiers: If set, these specific modifiers will override the type and number fields.

Modifiers include the following:

Advantages:

  • Fortitude: All party members gain 1 temporary hitpoint
  • Courage: All party members gain +1 damage/potency (3 turns)
  • Cunning: Flanking attacks this combat deal +1 damage
  • Intimidation: All foes suffer 2 damage to start the mission
  • Insight: Double the stunt chance for all party members
  • Endurance: All party members gain 1 armor and 1 warding (2 turns)

Disadvantages:

  • Nausea: All party members lose 1 hitpoint.
  • Disorder: Walling provides no armor this combat.
  • Misalignment: All augment bonuses are nullified this combat.
  • Dismay: All foes gain 1 hitpoint to start the mission.
  • Wound: One party member loses half hit points to start combat.
  • Disable: One party member gains stun(2) to begin combat

Some Other Notes on Missions

  • If you want to fight someone from your party (as a doppelganger or possessed or whatever), don't just put the actual player on the enemy side, because then they'll actually die. Instead, make a clone of them in Implications!

MissionExtension

"HA! You thought it was over?!" -the enemies, probably

An extension to a mission. Returns to the Mission (with all heroes where they left off), generally spawning a new entity that must be defeated. (See missionVictory_jigsawPart2 for an example of use)

  • createEntities: What should be spawned for this mission extension? Typically, you'll want setLocation = true, and setLocationType = closestPossible, which will spawn the entity near the target for this Outcome. (For more on creating entities, see the createEntity section)
  • victoryEventIds: If set, the mission victory will be one of these events (testing from first to last), or no event if none match. (The event type this links to should usually be set to OTHER)
  • failureEventIds: If set, the mission failure will be one of these events (testing from first to last), or no event if none match. (The event type this links to should usually be set to OTHER)

ModifyStats

Modifies an individuals stats by a value. This can be used for gameplay stats (health, injury, potency, etc.) and personality stats (bookish, snark, etc.), and can be permanent or only last for the mission or chapter.

  • stat: Stat to modify
  • value: How much to modify the stat by
  • lifespan: How long should this stat modification last?

Aspects

Add, remove, or consume Aspects.

  • addAspects: list of aspects to add/merge
    • id: The id of the aspect
    • value: The value to add/remove to the aspect
    • merge: How should this value be added to the existing value?
    • atTiles: add a templated region aspect by passing in a list of coords from a matched target
    • inRelationTo: The aspect is a relationship that must be templated with an entity id. (ex: interfusedWithMystic|_ENTITY_) (See also: Aspect Parameters)
    • mutual: if this aspect is in relation to another entity, also add a corresponding mutual aspect.
  • consumeAspects: list of aspects to consume partially
    • Same fields as addAspects
  • removeAspects: list of aspects to remove entirely
  • consume: Consume the aspect associated with this effect.

CopyAspects

Copies temporary advantage or disadvantage aspects from one entity to another. (Useful if you want to transform an entity into another entity, but still keep status effects etc. See thrixlBuffThrusk for an example)

  • copyTo: The Role to copy temporary aspects to

AddHistory

Add History lines to this entity. This should generally be used if you want to apply permanent aspects and effects to an entity due to some event that happens.

  • inlineHistory: Create a history line and add it to the target
    • id: The id of the history line; should be unique!
    • text: What the history line will say.
    • associatedAspects: These aspects will be added along with the history line
    • forbiddenAspects: For human history generation - don't apply this history line if the entity has any of these aspects.
    • persistOverLegacy: Should this history line persist when you recruit a legacy hero with it?
    • showInSummary: Should this history entry show up in the character sheet?
    • removeAspects: If these aspects are on the entity, they will be removed.
    • name: Set the name of the target
    • nameGenData: Use if generating related names (e.g. children)
    • staticName: Sets the name of the target to a localizable name
    • itemLayers: Add images to the skin (e.g. eyepatch)
    • relationships: Bind an entity to this history line so we can reference it by name in the text
  • addHistory: Add an existing history line to the target

AddResources

Adds the given resources to the company.

  • resourceName: Selects a resource type based on name (overrides resourceType, useful for if you want to pass in a resource string as a parameter to an effect)
  • resourceType: The type of resource to add
  • amount: How much of the resource to add

ApplyTheme

Apply a Theme or add a theme piece to an individual

  • theme: The theme to apply
  • piece: A specific theme piece from the given theme to apply
  • historyTextKey: Key for history text associated with getting this theme, if any
  • replaceInjuredLimbs: Should all injured (maimed) limbs be replaced with theme pieces, where possible?
  • oneRandom: If true, grants one random theme piece

RemoveTheme

Remove a theme or specific theme piece or theme slot from an individual

  • specificTheme: Theme to remove (removes full theme if specificPiece is null)
  • specificPiece: Specific theme piece to remove
  • clearSlot: Clear this specific theme slot of any theme pieces

DoAll

Executes all Outcomes within this

DoFirstValid

Execute each Outcome until one succeeds

  • outcomes: Execute each of these outcomes until one succeeds

DoOneRandom

Select one outcome randomly from a weighted list

  • weightedOutcomes: The weighted list of outcomes to choose from

Test

Defines a test that can be passed or failed, leading to different outcomes. Roll will PASS if roll evaluates to equal or greater than target.

  • value: The value to test
  • threshold: If value is greater than or equal to this expression, Pass. Otherwise, Fail.
  • onPass: Outcome to execute if value >= threshold
  • onFail: Outcome to execute if value < threshold

IfPlayerChose

Executes an outcome if the player chose the given option for the given choice target.

  • ifPlayerChose: Execute this outcome if the player selected the given option. (Note: this field can be edited by clicking the outcome's header)
  • playerChoiceTarget: Which choice are we talking about? (usually there's only one.) (Note: this field can be edited by clicking the outcome's header)
  • then: Execute this outcome if the player chose the given option
  • otherwise: Execute this outcome if the player didn't choose the given option

IfRolesArePresent

Executes outcomes based on whether or not a given role is present

  • rolesArePresent: Roles to check
  • then: If all the given roles are present, execute this outcome
  • otherwise: If not all the given roles are present, execute this outcome

SetRole

Sets the given role to the target. This can be useful when used with choose=oneRandom (ex: mysticRecipeDiscus uses it to choose a random second target)

  • role: The role to set

IfAnyTrigger

Fires the given trigger on the target, executing further outcomes depending on whether any matches were found. For example, injuryLeadsToDeath uses this to check whether there are any ENCOUNTER_DEATH_CHOICE triggers, and if not, kills the entity immediately.

  • ifAnyTrigger: Fire this trigger on the target, resolving immediately, and execute the rest of the outcome only if at least one match was found.
  • then: Execute if a match was found
  • otherwise: Execute if no matches were found

AttackRoll

Most mission attacks and abilities should go through this outcome. This handles things like who is attacking or defending, the strength (accuracy) of the ability, how the defender defends against the ability, what happens when the ability hits or misses, as well as handling a large amount of animation timing, sounds, and effects. This includes things like updating health bar visuals and showing damage and status effect text at the right time.

Note that due to all the animation handling this outcome does, it's useful for abilities that aren't attacks too, despite its name.

  • defender: this target will be marked as the "defender" and used as the target of the onHit or onMiss, depending on the result of the roll
  • intermediateRole: If set, the attacker will be treated as "attacking" this role, and the defenders will be treated as "defending" against this role. Specifically useful for mystic interfusion recipes.
  • attackAnimationType: What type of attack should this animate as? If null, uses defenseRollTags to figure it out as a fallback.
  • showAbilityName: Should this effect stop to show its name above the character using it?
  • stopBlockingTime: When should the associated attack animation stop blocking other scripts? By default, it blocks until slightly after the entire animation is over, but this isn't what we want for certain situations, like nested AttackRolls, when we want another attack animation to start partway through.
  • minimumBlockTime: This attack roll will block for at least this much time, in milliseconds
  • minimumBlockTimeOnMiss: This attack roll will block for at least this much time, in milliseconds, if the attack misses
  • timingOverride: Used to override different timings of the attack animation
  • particles: Any particles that this AttackRoll should spawn
  • audioOverride: Play specific audio during the attack
  • attackerAnimationOverride: Override the attacker's animation (empty string for no animation)
  • defenderAnimationOverride: Override the defender's animation (empty string for no animation)
  • markForFlanking: Does this attack allow subsequent attacks to flank?
  • flankMarkOrigin: if non-null, the role which should be used to calculate the origin of the flank mark. If null, attacker (=self) is the origin of the mark
  • flankingBoostsAttackRoll: If this attack is considered flanking, does it get an attack roll bonus?
  • defenseRollTags: What defenses apply?
  • attackStrength: The attack roll
  • separateRolls: If true, each defender faces a separate attack roll. Useful for AOE, if you want to roll separately for each.
  • wield: [DEPRECATED]
  • applyCover: Should cover protect adjacent units from this attack?
  • always: This Outcome always happens, regardless of success or failure of the AttackRoll.
  • onHit: Do this if the attack hits
  • onMiss: Do this if the attack misses
  • onAbilitySuccess: Do this if there was a successful attack roll (or no defenders)
  • onAbilityFailure: Do this if all attack rolls failed
  • onHitCover: Do this if the attack hits cover

Damage

Deal damage and/or shred to the target. (This will most often be seen within AttackRolls)

  • originator: Who's dealing the damage?
  • amount: Amount of damage to deal to the subject
  • flankingBonusDamage: if attack is flanking, do extra damage
  • shred: Shred deals damage to armor. Shred is applied before damage is applied, so shred counts toward this attack as well.
  • type: What type of damage? (Generally meaning, can armor or warding protect against this damage? Armor protects against PHYSICAL, warding protects against MAGIC, nothing protects against TRUE)
  • pierce: how much armor or warding to ignore
  • minRemainingHealth: Don't take the target below this health threshold.
  • weapon: The weapon being used to do this attack. Might be null. Stunt effects will be determined using this.
  • useEquippedWeaponForStunt: If true, this damage will use the equipped weapon to calculate stunts
  • overrideStuntDamage: If not null, this expression will be used for stunt damage instead of the default weapon-based damage calculation
  • numDefenders: The chance to stunt is divided by this number, so that attacks that hit multiple targets aren't OP
  • showSpecialAnimationEffectIf: If this expression evaluates to >=1, show the ability's specialAnimationEffect
  • showInTooltip: Should this damage be shown in tooltips? (ex: set to false for damage that interfusion abilities do to scenery)

Animate

Play a specific animation script, swap a scenery image, or spawn particles

  • script: id of the script to run (client side animation)
  • swapSceneryImage: If the target is scenery, swap the current scenery image with this image
  • particles: Spawn particles

ActionPoints

Consumes action points. This is generally used in the "cost" of the "self" target for abilities.

(To make an ability that doesn't cost anything, just don't add in any Action Point cost)

  • actionPoints: Consume this number of action points
    • one: requires and consumes one action point
    • two: requires and consumes two action points
    • attack: by default, require one action point, consume all. certain conditions (abilities: battledance) can modify the cost of attacks.
    • all: require one, consume all. e.g. turn-ending abilities like "guard"
    • any: consume any action points, but don't require any. e.g. "wait"
    • free: (renamed "swift") a hero can use one swift action for free every turn; after that, swift actions cost one

GrantActionPoints

Grants the given number of action points to the target

  • actionPoints: The number of action points to grant

TempHP

ChangeSceneryState

ModifyOverlandTile

Trigger

Branch

BranchAbility

CreateJobAtSite

SnapshotFollowup

AllowFollowup

Impact

DefenseResults

NewJob

NewPlot

Spawn

Interrupt

ChangeControl

ChangeControl.png

Used to assign control of the given target to a given controller.

Using something like becomeAllyOf: party and makeHero: true will recruit the given role to your party!

AddPet

Interact

MoveEntity

FormParty

AssignToPlot

AddGear

EquipCarriedItem

AssociatedLight

MapRegion

Delete

Special

RevealHiddenEntities

AddCalamities

UnlockLegacyAspect

EncounterResult