Combo Attack special

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Varkarrus
Posts: 26
Joined: March 16th, 2013, 6:40 pm

Combo Attack special

Post by Varkarrus »

Hey, I wanted to add a special to one of my attacks where the final hit would deal double damage. Something like

Code: Select all

    [damage]
        id=combostrike
        name= _ "combo strike"
        description= _ "Your final attack deals double damage."
        multiply=2
        cumulative=yes
    [/damage]
but with a filter to make it only apply to the final attack in the chain. That possible?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Combo Attack special

Post by zookeeper »

No, I don't think there's any way to do that. You could write an event-based hack solution of some kind, but that wouldn't show up in damage calculations which is kind of essential.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Combo Attack special

Post by gfgtdf »

I don't know when exactly filters for weapon specials are evaluated during attack prediction but since it's possible to have a filter like hitpoints < max_hitpoints / 2 It'd make sense that the game calculates the damage again after every hit.

If the game enginge does evalulate filters after every hit you can use a lua filter with an internal counter that returns true every third time (asuming your attack has 3 strikes). Of course this is highly dangerous and even if it turned out to be working in the current wesnoth version it may not wokr in a later wesnoth version.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Samonella
Posts: 381
Joined: January 8th, 2016, 5:41 pm
Location: USA

Re: Combo Attack special

Post by Samonella »

Slows affects damage mid-battle, and damage calculations take it into account... maybe (maybe?) you could slow him at the beginning of the battle, and unslow him before the last hit?
The last few months have been nothing but one big, painful reminder that TIMTLTW.

Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Combo Attack special

Post by zookeeper »

Samonella wrote:Slows affects damage mid-battle, and damage calculations take it into account...
That's because the damage calculations code is hardcoded to specifically take slows into account.
Samonella wrote:maybe (maybe?) you could slow him at the beginning of the battle, and unslow him before the last hit?
This would still be an event-based solution which the damage calculations code couldn't have any knowledge of.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Combo Attack special

Post by gfgtdf »

gfgtdf wrote:I don't know when exactly filters for weapon specials are evaluated during attack prediction but since it's possible to have a filter like hitpoints < max_hitpoints / 2 It'd make sense that the game calculates the damage again after every hit.
Ok i tested this and it turned out that although in the actual fight the damage does change during the fight it does not during the attack prediction. I filed a bugreport at https://github.com/wesnoth/wesnoth/issues/1836
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Post Reply