[engine] Different defences for melee and ranged attacks
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
-
- Posts: 161
- Joined: April 26th, 2014, 4:44 pm
[engine] Different defences for melee and ranged attacks
People could make unit-terrain-combinations that have higher defence against melee than ranged attacks. Some other unit-terrain-combinations would have higher defence against ranged than melee attacks.
There are very much electrochemical currents in my brain.
Re: [engine] Different defences for melee and ranged attacks
Based on the wiki, since 1.15.0 you can already do this with the
It's actually quite a nice idea
EDIT:
Sorry, you meant defense, not resistance.
That's easily possible in the current stable versions as well, through a weapon special with
[resistance]
ability tag, because you can filter on the weapons. (so you can have one for melee and one for a ranged second_weapon.)It's actually quite a nice idea
EDIT:
Sorry, you meant defense, not resistance.
That's easily possible in the current stable versions as well, through a weapon special with
[chance_to_hit]
, where you can also filter on the range of weapons.Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
-
- Posts: 161
- Joined: April 26th, 2014, 4:44 pm
Re: [engine] Different defences for melee and ranged attacks
To get understood better, I tell an imaginary example: Let's modify Iron Mauler slightly. Now he has 40 % defence against every non-magical melee attack. He still has 30 % defence against every ranged attack.
EDIT:
Oops! I forgot to say: on flat terrain.
EDIT:
Oops! I forgot to say: on flat terrain.
There are very much electrochemical currents in my brain.
Re: [engine] Different defences for melee and ranged attacks
Here's the example code, let's say you apply this mod to every iron mauler that appears:Spirit_of_Currents wrote: ↑February 24th, 2019, 11:29 amLet's modify Iron Mauler slightly. Now he has 40 % defence against every non-magical melee attack. He still has 30 % defence against every ranged attack. on flat terrain.
Code: Select all
[event]
name=unit placed
first_time_only=no
[filter]
type=Iron Mauler
[/filter]
[object]
[filter]
x,y=$x1,$y1
[/filter]
[effect]
# the actual mod
apply_to=attack
# theoretically you could filter here for range=melee, but let's keep it universal and apply to all attacks and we'll filter inside the special
[set_specials]
mode=append
[chance_to_hit]
id=different_defense_modifyer
apply_to=opponent
add=-10
[filter_self]
[filter_weapon]
range=melee # filter here for range
[/filter_weapon]
[filter_location]
terrain= # filter here for flat, I don't know the exact terrain codes by heart
[/filter_location]
[/filter_self]
# doesn't apply to magical
[filter_opponent]
[not]
[filter_weapon]
special=magical
[/filter_weapon]
[/not]
[/filter_opponent]
[/change_to_hit]
[/set_specials]
[/effect]
[/object]
[/event]
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
-
- Posts: 161
- Joined: April 26th, 2014, 4:44 pm
Re: [engine] Different defences for melee and ranged attacks
I hope interface would show both defence percentages so that they can be seen easily.
There are very much electrochemical currents in my brain.