[solved] damage_type within [harm_unit]
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.
-
- Posts: 1310
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
[solved] damage_type within [harm_unit]
1.19.something
With POWER=48, this is doing 48 damage to enemies with fire resistance 30%. Am I missing something here?
With POWER=48, this is doing 48 damage to enemies with fire resistance 30%. Am I missing something here?
Code: Select all
#define ABILITY_BURNING_AURA POWER
[harm_unit]
id=burning_aura {POWER}
name= _ "burns foes ("+{POWER}+_")"
female_name= _ "female^burns foes ("+{POWER}+_")"
description= _ "The unit singes adjacent enemies at the beginning of your turn, causing fire damage of "+{POWER}+_" HP (max. down to 1 HP, never kills)"
amount={POWER}
damage_type=fire
affect_self=no
affect_allies=no
affect_enemies=yes
kill=no
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
[/harm_unit]
#enddef
damage_type: if present, amount will be altered by unit resistance to the damage type specified.
Last edited by white_haired_uncle on March 19th, 2024, 9:22 pm, edited 1 time in total.
Speak softly, and carry Doombringer.
Re: damage_type within [harm_unit]
You seem to be trying to use actionWML tag as if it were ability.
-
- Posts: 1310
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: damage_type within [harm_unit]
I guess so? I'm really not sure what that means.
Here is where the macro is invoked.
Code: Select all
[advancement]
max_times=1
id=burning_aura3
strict_amla=yes
description= _ "dealing more damage with burning aura"
image=attacks/fire-beam.png
require_amla="burning_aura2"
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_BURNING_AURA 40}
[/abilities]
[/effect]
[effect]
apply_to=new_ability
[abilities]
{ABILITY_BURNING_AURA 48}
[/abilities]
[/effect]
{AMLA_DEFAULT_BONUSES}
[/advancement]
Last edited by white_haired_uncle on March 19th, 2024, 2:33 pm, edited 1 time in total.
Speak softly, and carry Doombringer.
-
- Code Contributor
- Posts: 179
- Joined: October 6th, 2017, 12:57 pm
Re: damage_type within [harm_unit]
[harm_unit] must be implemented in a [event]name=attacker hits for what it is work
-
- Posts: 1310
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: damage_type within [harm_unit]
Okay, looking a bit further, it looks like [abilities] takes certain tags, of which [heals] is one (according to the wiki). And anything else will display, but do nothing. So I guess I need to implement a turn refresh event to do the actual harm.
But what I'm still not clear on, why does this partially work? If [harm_unit] is not valid inside [abilities], why is it doing any damage at all?
EDIT: Because your saved game still has the old ability. Changing the definition doesn't change existing abilities. Idiot.
P.S. Since I'm going to be working on this next, is there a filter I can use to check for units with an ability, something on the order of
I know that code is wrong, but hopefully demostrates the idea of what I want to accomplish. I just learned about filter_wml which seems useful but I don't think it will get me to the level of abilities. I suspect this will end up being much easier in lua.
But what I'm still not clear on, why does this partially work? If [harm_unit] is not valid inside [abilities], why is it doing any damage at all?
EDIT: Because your saved game still has the old ability. Changing the definition doesn't change existing abilities. Idiot.
P.S. Since I'm going to be working on this next, is there a filter I can use to check for units with an ability, something on the order of
Code: Select all
[store_unit]
side=1
[filter_wml]
ability.id=burns_foes
[/filter_wml]
....
Last edited by white_haired_uncle on March 19th, 2024, 9:22 pm, edited 1 time in total.
Speak softly, and carry Doombringer.
Re: damage_type within [harm_unit]
[filter_wml] lets you do [filter_wml][abilities][harm_unit]value=48. If you want to work with ability id only then use regular filter not [filter_wml].