Better method for this skill?

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

Better method for this skill?

Post by wuxiangjinxing »

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
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Better method for this skill?

Post by josteph »

Code: Select all

[filter_opponent]
    formula = 'level > 4'
[/filter_opponent]
Or lua_function.
User avatar
Celtic_Minstrel
Developer
Posts: 2207
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Better method for this skill?

Post by Celtic_Minstrel »

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.
Former maintainer of Steelhive.
Post Reply