Unit Ability: Elusive
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.
-
- Posts: 188
- Joined: March 31st, 2007, 3:53 pm
- Location: The Void, usually.
Unit Ability: Elusive
I'm trying to make an ability which halves an opponent's chance to hit while the unit is defending. I'd tell you how far I've gotten so far and ask if you have any idea what I'm doing wrong, but so far there's nothing I've tried which I didn't already know would fail miserably. Do I have to do a trick with Events? I s'pose I could make an event which stores the unit's side as a variable and halves his chance-to-be-hit when that side's turn ends while doubling it again when that side's turn begins, but that's a messy last resort. Any other suggestions?
Chosen to be: Avatar of the God of Vengeance
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Wow, I'm surprised. This actually works:
I didn't test how it interacts with magical or marksman.
Code: Select all
[chance_to_hit]
id=elusive
name= _ "elusive"
description= _ "Elusive:
When attacking or retaliating using this attack, the enemy always has only half the normal chance to hit."
multiply=0.5
apply_to=opponent
[/chance_to_hit]
-
- Posts: 188
- Joined: March 31st, 2007, 3:53 pm
- Location: The Void, usually.
Added some actual documentation about some of these undocumented keys: http://www.wesnoth.org/mw/index.php?tit ... rcid=13548.
-
- Posts: 188
- Joined: March 31st, 2007, 3:53 pm
- Location: The Void, usually.
Sweet. Thanks again. It does work indeed.
Here's the ability in its final form, in case anyone else wants to use it. It's pretty overpowered, though, but I'm sure one could find a balanced use for it for some units which are weak enough in other aspects.
Here's the ability in its final form, in case anyone else wants to use it. It's pretty overpowered, though, but I'm sure one could find a balanced use for it for some units which are weak enough in other aspects.
Code: Select all
#define ABILITY_ELUSIVE
[chance_to_hit]
id=elusive
name= _ "elusive"
description= _ "Elusive:
Attackers have only half the usual chance to hit this unit."
multiply=0.5
apply_to=opponent
active_on=defense
[/chance_to_hit]
#enddef
Chosen to be: Avatar of the God of Vengeance
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
-
- Posts: 188
- Joined: March 31st, 2007, 3:53 pm
- Location: The Void, usually.
Meh. I didn't edit a thing since that last post, and suddenly, when I re-opened Wesnoth, Elusive stopped working. ¿Por qué?
Chosen to be: Avatar of the God of Vengeance
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
-
- Posts: 188
- Joined: March 31st, 2007, 3:53 pm
- Location: The Void, usually.
...Aha. That's why I didn't think of your idea earlier: I wanted to make an ability, not a weapon special. Meh. The weapon special will work if necessary, but I'd really like it to be an ability. Any ideas on how I can do that?zookeeper wrote:Did you try to use it as an ability, instead of a weapon special (your macro naming and the description would imply this)?
I've pretty much got the aforementioned last-resort event trigger coded.
Chosen to be: Avatar of the God of Vengeance
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Well, if your unit has both a ranged and a melee attack, then you just give both attacks this special. Make the specials be invisible in-game and write an ability that just provides the description, so it looks like it's the ability and not the specials that provide the effect. If the unit doesn't have both a ranged and a melee attack, then I don't really see how you'd do it without resorting to [event] trickery, with which it probably would indeed be possible.Ultimatum479 wrote:...Aha. That's why I didn't think of your idea earlier: I wanted to make an ability, not a weapon special. Meh. The weapon special will work if necessary, but I'd really like it to be an ability. Any ideas on how I can do that?zookeeper wrote:Did you try to use it as an ability, instead of a weapon special (your macro naming and the description would imply this)?
-
- Posts: 188
- Joined: March 31st, 2007, 3:53 pm
- Location: The Void, usually.
Ah. Should work. I was debating that earlier, but wasn't sure how to make 'em invisible. Now I just realized it. Thanks.
Chosen to be: Avatar of the God of Vengeance
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
Duty-bound to be: Last chance for the oppressed non-humans of the world
Accidentally became: Co-founder of the Council of Linac Mux
Self-nominated (pending election): Forum SUPERMOD!
I have already done it :
Shocktroopers in my scenarii have a ranged attack of 1-0 (wesnoth want at least 1 damage per strike) named (and iconified) Tower Shield. With number of strike = 0 this shocktroopers don't attack but have a weapon special named "Tower Shield Ranged" that cut by 2 the chance to hit of an opponent ranged attack.
It works well.
The only things is that you can stupidly choose the tower shield attack, which does nothing except forcing an opponent to use his ranged attack against you
attack_weight=0 must be insert in [attack], preventing AI controller doing this stupid things.
Shocktroopers in my scenarii have a ranged attack of 1-0 (wesnoth want at least 1 damage per strike) named (and iconified) Tower Shield. With number of strike = 0 this shocktroopers don't attack but have a weapon special named "Tower Shield Ranged" that cut by 2 the chance to hit of an opponent ranged attack.
It works well.
The only things is that you can stupidly choose the tower shield attack, which does nothing except forcing an opponent to use his ranged attack against you
attack_weight=0 must be insert in [attack], preventing AI controller doing this stupid things.
-- please don't blame me about my bad english spoken ! --