Any way to change damage type vs specific opponent?
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.
- Spannerbag
- Posts: 535
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Any way to change damage type vs specific opponent?
I'm tweaking an item in my UMC and decided it'd be great for game balancing if it did a different damage type (arcane rather than impact) against certain unittypes (mudcrawler variants to be precise). It already has additional effects against these unittypes but I cannot see any any (easy) way to implement a temporary change to damage type. Simply modifiying damage is an option but I'd prefer to preserve existing attack damage and temporarily change the attack type if possible, hence this post
Damage type seems to only be modifiable via
I could, I suppose, use
I had thought maybe
I do have various ideas and work-arounds but ideally I'd like to have this neatly wrapped up inside an
Am I missing something? Happy to use lua if that's an option.
Thanks in advance for any advice!
Cheers,
--Spannerbag
Damage type seems to only be modifiable via
[effect]
so I was wondering if some sort of short lifetime (for a single melee combat to be specific) [object]
could be wrapped around [effect]
?I could, I suppose, use
[event]
to [modify_unit]
prior to an attack vs appropriate unittypes then restore the original damage type post-combat using logic similar to the force chance to hit macro. But I'd prefer a more elegant method, if there is one.I had thought maybe
[effect]
[set_specials]
[damage]
with [filter_opponent]
might do the trick, but [damage]
does not seem to support changing damage type.I do have various ideas and work-arounds but ideally I'd like to have this neatly wrapped up inside an
[effect]
if at all possible.Am I missing something? Happy to use lua if that's an option.
Thanks in advance for any advice!
Cheers,
--Spannerbag
- Celtic_Minstrel
- Developer
- Posts: 2211
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Any way to change damage type vs specific opponent?
You could always add an
I don't know of any way that supports AI and attack prediction, but if any such thing exists, it would not use
[object]
in attack start
and remove it in attack end
. That wouldn't allow the AI to understand it and would probably break the attack prediction dialog too, but I think it would make it function.I don't know of any way that supports AI and attack prediction, but if any such thing exists, it would not use
[effect]
.- Spannerbag
- Posts: 535
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Any way to change damage type vs specific opponent?
Many thanks for the information, much appreciated.Celtic_Minstrel wrote: ↑August 2nd, 2022, 5:47 pm You could always add an[object]
inattack start
and remove it inattack end
. That wouldn't allow the AI to understand it and would probably break the attack prediction dialog too, but I think it would make it function.
I don't know of any way that supports AI and attack prediction, but if any such thing exists, it would not use[effect]
.
I've been testing simply multiplying the damage and for simplicity I'll use that, given the alternatives.
I think if I add many more events to this campaign my computer will melt...
Cheers!
--Spannerbag
Re: Any way to change damage type vs specific opponent?
There are multiple options with different side effects.
1) event based way mentioned before
2) define custom damage type where resistance defaults to impact, but for specific units you change their resistance https://wiki.wesnoth.org/UnitsWML#.5Bre ... efaults.5D
3) give your unit 2 attacks with different damage types, possibly with filter that either can only be used against correct enemies
1) event based way mentioned before
2) define custom damage type where resistance defaults to impact, but for specific units you change their resistance https://wiki.wesnoth.org/UnitsWML#.5Bre ... efaults.5D
3) give your unit 2 attacks with different damage types, possibly with filter that either can only be used against correct enemies
- Spannerbag
- Posts: 535
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Any way to change damage type vs specific opponent?
Wow, I like #2Ravana wrote: ↑August 3rd, 2022, 12:20 am There are multiple options with different side effects.
1) event based way mentioned before
2) define custom damage type where resistance defaults to impact, but for specific units you change their resistance https://wiki.wesnoth.org/UnitsWML#.5Bre ... efaults.5D
3) give your unit 2 attacks with different damage types, possibly with filter that either can only be used against correct enemies
Many thanks for your post, very enlightening!
However, I've playtested a simple x3 damage multiplier and (so far) it produces results very close to what I wanted.
That said, I'll certainly keep your suggestions in mind!
Thanks again for the advice, much appreciated.
Cheers,
--Spannerbag