Making a unit more susceptible to ranged damage than melee.

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
User avatar
Bilbo_Sacket
Posts: 35
Joined: February 28th, 2021, 4:27 am

Making a unit more susceptible to ranged damage than melee.

Post by Bilbo_Sacket »

Okay, so does any of you have a good idea of an elegant method that could be used to make a unit more susceptible to ranged damage than melee, or vice-versa. As in affecting resistance. I am also willing to take ideas for behemoth creatures which might need an extra edge to illustrate their gargantuan size in the attack list. I am interested in any good ideas you come up with, so put on your thinking cap (though of course some of us might wonder why you ever took it off.)
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Making a unit more susceptible to ranged damage than melee.

Post by WhiteWolf »

How about an ability with a [resistance] tag that's reducing every resistance value for melee/ranged weapons?
You need Wesnoth >= 1.15 to be able to filter a weapon in a resistance tag though.

If you're on 1.14, the bit more cumbersome workaround would be to make it a weapon special instead with a [damage] tag, filtering on the range, and on the type of enemy units whom you want this feature to apply to.
You'll have to auto-add the weapon special to every unit in the game, you can do that with a "unit placed" event.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
User avatar
octalot
General Code Maintainer
Posts: 777
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Making a unit more susceptible to ranged damage than melee.

Post by octalot »

You could give the creature a ranged attack, so that it'll use it as a counterattack when defending, and then put a damage-multiplier special on that attack.
User avatar
Bilbo_Sacket
Posts: 35
Joined: February 28th, 2021, 4:27 am

Re: Making a unit more susceptible to ranged damage than melee.

Post by Bilbo_Sacket »

Thanks for the feedback, I'll go see if your ideas work. Also I am beginning to think that 1.15 is probably a good idea. (For simplicities sake.)
Post Reply