Better method for this skill?

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
wuxiangjinxing
Posts: 53
Joined: December 23rd, 2008, 5:01 am

Better method for this skill?

Post by wuxiangjinxing » October 10th, 2019, 1:22 am

Code: Select all

    [damage]
        id=slayer
        name= _ "slayer"
        description= _ "this unit deals 50% more damage when attacking enemies of level 5 or higher"
        apply_to=self
		multiply=1.5
		active_on=offense
        [filter_opponent]
            [not]
				level=0
				[or]
					level=1
				[/or]
				[or]
					level=2
				[/or]
				[or]
					level=3
				[/or]
				[or]
					level=4
				[/or]
			[/not]
        [/filter_opponent]
    [/damage]
Although this skill does work, I believe there shall be better methods for the same sake. Anyone can give me some help? Thanks a lot.

User avatar
josteph
Developer
Posts: 738
Joined: August 19th, 2017, 6:58 pm

Re: Better method for this skill?

Post by josteph » October 10th, 2019, 3:26 am

Code: Select all

[filter_opponent]
    formula = 'level > 4'
[/filter_opponent]
Or lua_function.

User avatar
Celtic_Minstrel
Developer
Posts: 1522
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Better method for this skill?

Post by Celtic_Minstrel » October 20th, 2019, 11:44 pm

I believe this would also work:

Code: Select all

[filter_opponent]
	[not]
		level=0,1,2,3,4
	[/not]
[/filter_opponent]
That said, even if that works, I'd probably recommend josteph's method since it's clearer what you mean.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

Post Reply