Terrain Defense
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.
Terrain Defense
I am trying to make a weapon special which checks for your chance to be hit and if it detects that it is above 50% then it sets it to 50%. However, I am having trouble making it work. It seems that all attacks that have a chance to hit below 50% are being set to 50% instead.
Code: Select all
#define WEAPON_SPECIAL_
[chance_to_hit]
id=
name= _ ""
description= _ ""
value=50
max_value=50
cumulative=no
[filter_base_value]
more_than=50
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
#enddef
Re: Terrain Defense
Thats because of
value=50
I guess.-
- Code Contributor
- Posts: 172
- Joined: October 6th, 2017, 12:57 pm
Re: Terrain Defense
try that
filter_base_value not write correctly and max_value not used in weapon specials
Code: Select all
#define WEAPON_SPECIAL_BELOW_50
[chance_to_hit]
id=cth_50
name= _ ""
description= _ ""
value=50
cumulative=no
[filter_base_value]
greater_than=50
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
#enddef
-
- Code Contributor
- Posts: 172
- Joined: October 6th, 2017, 12:57 pm
Re: Terrain Defense
the problem is what if opponent use weapon_special_magical, his chance to hit remain 70%, it is wanted or not?
Re: Terrain Defense
If that happen you can put innewfrenchy83 wrote: ↑May 4th, 2023, 4:24 pm the problem is what if opponent use weapon_special_magical, his chance to hit remain 70%, it is wanted or not?
this will disable the ability against magical attacks. You could also use this to make it so that the magical special is disabled against this attacks with this special[filter_opponent]
[filter_weapon]
[not]
special_id=magical
[/not]
[/filter_weapon]
[/filter_opponent]
-
- Code Contributor
- Posts: 172
- Joined: October 6th, 2017, 12:57 pm
Re: Terrain Defense
if you want affect attack using marksman or special magical, then this code more conveniant
Code: Select all
#define WEAPON_SPECIAL_ABOVE_50
[chance_to_hit]
id=cth_60
name= _ ""
description= _ ""
sub=10
cumulative=no
[filter_base_value]
greater_than_equal_to=60
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
[chance_to_hit]
id=cth_70
sub=10
cumulative=no
[filter_base_value]
greater_than_equal_to=70
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
[chance_to_hit]
id=cth_80
sub=10
cumulative=no
[filter_base_value]
greater_than_equal_to=80
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
[chance_to_hit]
id=cth_90
sub=10
cumulative=no
[filter_base_value]
greater_than_equal_to=90
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
[chance_to_hit]
id=cth_100
sub=10
cumulative=no
[filter_base_value]
equals=100
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
#enddef
Re: Terrain Defense
That worked thanks
Also found that this fixes my original problem
Also found that this fixes my original problem
#define WEAPON_SPECIAL_
[chance_to_hit]
id=
name= _ ""
description= _ ""
value=50
max_value=50
cumulative=no
[filter_base_value]
greater_than_equal_to=50
[/filter_base_value]
apply_to=opponent
[/chance_to_hit]
#enddef
-
- Code Contributor
- Posts: 172
- Joined: October 6th, 2017, 12:57 pm
Re: Terrain Defense
maw_value not effect in weapon_specials only in [resistance] and [illuminates] abilities