project-ethea / Invasion_from_the_Unknown

Invasion from the Unknown, a Battle for Wesnoth add-on campaign.
Other
10 stars 4 forks source link

[23B Until Death] Argan can only absorb part of the dmg if it greater than 10 (per hit) #61

Closed Konrad22 closed 6 years ago

Konrad22 commented 6 years ago

That means, if I deal more than 10 dmg, I can actually lower his hitpoints. Is that allowed?

irydacea commented 6 years ago

Depends on where in the boss battle you are. Here's a rough outline based on the WML for three stages of the sequence:

[...]
    #
    # Argan absorbs all damage throughout stage 1 once it's possible to land
    # hits on him (i.e. once the player can no longer cast the Union on him).
    #
[...]
    [event]
        name=boss stage 2
[...]
    #
    # In this stage Argan can only take full damage from the Union. Other forms
    # of damage will be absorbed. However, because he has a lot more HP than
    # Elyssa and we need to bring him down to 0%, we only want him to
    # regenerate a percentage of the inflicted damage rather than always go
    # back to 100% on each hit (the most common gameplay complaint about legacy
    # IftU).
    #
    # Some code in these three event handlers is supposed to match the
    # equivalent in BOSS_ABSORB_DAMAGE_EX.
    #

    [event]
        name=argan absorb damage
        first_time_only=no
        [filter_second_attack]
            [not]
                special=union
            [/not]
        [/filter_second_attack]

        [set_variables]
            name=unit
            mode=merge
            [value]
                # HACK: cross-event variable!
                hitpoints={BOSS_REGEN_ATTACK_DAMAGE {DIFF 0.60 0.85 0.90}}
            [/value]
        [/set_variables]
[...]
    #
    # Advance to stage 3 once Argan goes down to 0 HP from the Union.
    #
[...]
    [event]
        name=boss stage 3
[...]
    #
    # Argan can take hits from everyone for this stage but Elynia must be the
    # one to inflict the killing blow.
    #

    {BOSS_IMMORTALITY Argan ({VARIABLE_NUMERICAL_EQUALS boss_stage 3}) {DIFF 25 40 50}}
[...]
        {BUG_ON ({VARIABLE_LEXICAL_NOT_EQUALS second_unit.id Elynia}) ("Boss died to an unexpected unit with id $second_unit.id (cheating?)")}

        {BUG_ON (
            [not]
                [have_unit]
                    id=Elynia
                    [filter_adjacent]
                        id=Argan
                    [/filter_adjacent]
                [/have_unit]
            [/not]
        ) ("Boss and Elynia not adjacent")}
[...]
Konrad22 commented 6 years ago

Oh. Stage 2.