Filter for hidden unit

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
Vyncyn
Forum Regular
Posts: 514
Joined: April 6th, 2013, 5:51 pm

Filter for hidden unit

Post by Vyncyn »

Am stuck with a new ability that I'm trying to implement

A unit has an Ambush ability (id=vr_trapping).When an enemy moves next to it, the enemy is slowed

My problem is, that I can't figure out how to make sure that the unit only traps enemies while it's invisible.
For now it traps while on forest tile and only has 1 enemy next to it.

tried with:
attacks_left
resting=yes
status uncovered=no
none of them seem to do anything

Code: Select all

[event]
		name=enter_hex
		first_time_only=no
		id=vr_trapped
		[filter]
			x,y=$x1,$y1
			[filter_adjacent]
				ability=vr_trapping
				is_enemy=yes
				attacks_left=1
				resting=yes
				[status]
					uncovered=no
				[/status]
				[filter_location]
					terrain=*^F*
				[/filter_location]
				[filter_adjacent]
					is_enemy=yes
					count=1
				[/filter_adjacent]
			[/filter_adjacent]
		[/filter]
		[modify_unit]
			[filter]
				x,y=$x1,$y1
			[/filter]
			[effect]
				apply_to=status
				add=slowed
			[/effect]
		[/modify_unit]
	[/event]

Edit:
nevermind, I got it to work now. Filter was set wrong

Code: Select all

[not]
	status=uncovered
[/not]
Post Reply