Skip to content
JasperLorelai edited this page Nov 16, 2023 · 13 revisions

Source Code

spell-class: ".MultiSpell"

Description:

MultiSpells can be used to combine spells to form new spells, to cast more than one spell at once, or to randomly cast one of several spells.

Configuration:

Since Beta 13 some of these options support dynamic values through numeric or string expressions.

Option Description Type Default Supports expressions
enable-custom-spell-cast-chance Defines whether to use custom spell cast chances. Boolean false true
cast-random-spell-instead Whether to cast a random spell from the list instead of casting all the spells. Boolean false true
enable-individual-chances If this is true, each spell will be handled individually, meaning its random chance will be calculated separately, and it will be possible for each spell to be cast. If this is false, the spells will be handled together, so only one of the spells will be cast. Boolean false true
spells A list of sub-spells the MultiSpell should cast. By default, spells will all be cast at the same time. You can use sub-spell cast modes to apply spell cast chances and delay. Alternatively, for delay you may list DELAY <delay> or the ranged variant DELAY <minDelay> <maxDelay> after which all subsequent spells will be cast after that delay. For spell chances, if enable-custom-spell-cast-chance is set to true, you can specify the chance by listing the spell like this: subSpell:<chance>. String List false

Examples:

Example 1:

With DELAY:

froghop:
    spell-class: ".MultiSpell"
    spells:
        - froghop_leap1
        - DELAY 12 #(wait 0.6 seconds)
        - froghop_leap2
        - DELAY 16 #(wait 0.8 seconds)
        - froghop_leap3

froghop_leap1:
    spell-class: ".instant.LeapSpell"
    forward-velocity: 2
    upward-velocity: 2

froghop_leap2:
    spell-class: ".instant.LeapSpell"
    forward-velocity: 4
    upward-velocity: 4

froghop_leap3:
    spell-class: ".instant.LeapSpell"
    forward-velocity: 6
    upward-velocity: 6

Example 2:

With cast-random-spell-instead:

coinflip:
    spell-class: ".MultiSpell"
    cast-random-spell-instead: true
    spells:
        - coinflip_heads(mode=full)
        - coinflip_tails(mode=full)

coinflip_heads:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The coin came up heads!"

coinflip_tails:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The coin came up tails!"

Example 3:

With enable-custom-spell-cast-chance:

rigged_coinflip:
    spell-class: ".MultiSpell"
    cast-random-spell-instead: true
    enable-custom-spell-cast-chance: true
    spells:
        - rigged_coinflip_heads(mode=full):1
        - rigged_coinflip_tails(mode=full):10

rigged_coinflip_heads:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The coin came up heads!"

rigged_coinflip_tails:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The coin came up tails!"

Example 4:

With enable-individual-chances:

flowergarden:
    spell-class: ".MultiSpell"
    cast-random-spell-instead: true
    enable-individual-chances: true
    str-cast-self: "----------"
    spells:
        - flower1(mode=full):75 #(75% chance to be cast, regardless of the other two spells)
        - flower2(mode=full):50 #(50% chance to be cast, regardless of the other two spells)
        - flower3(mode=full):25 #(25% chance to be cast, regardless of the other two spells)

flower1:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The rose bloomed!"

flower2:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The violet bloomed!"

flower3:
    spell-class: ".instant.DummySpell"
    str-cast-self: "The morning glory bloomed!"

Clone this wiki locally