Legend_of_the_Invincibles
Legend_of_the_Invincibles copied to clipboard
enemy (at least) wrath not wrathing very wrathfully
I noticed recently that lesser lethargy doesn't seem to do much. The wrath is getting set, but it doesn't seem to do anything. I know wrath on side 1 was working in the past, I haven't checked recently.
In the attached, BZB has -2 wrath_intensity. Serves him right. Attack him with the dwarf just to his north and you'll see the attack GUI says he'll do 10 damage, and he does.
Reload, and attack BZB with Argan's great underwear (advance him and take crossbow marksman first?). In my case, BZB's wrath intensity went to -5. Attack him with the dwarf just to his north and you'll see the attack GUI says he'll do 10 damage, and he does.
Lethargy and wrath don't work on units controlled by AI. This is not intended.
Not intended as in it's not working correctly, or it's not intended that wrath/lethargy work for AI units (in which case, why have a lesser lethargy special available to the player)?
Not intended as it's not working correctly. Human controlled units are given a hidden weapon special called latent_wrath which causes the wrath/lethargy variable to have an effect. It's missing on other units, probably as an oversight while moving that code into lua.
The latent_wrath weapon special should be changed to an ability and added to every unit without it by the code that modifies the wrath variable.
I now see how the latent_wrath works and why AI units don't.
What I don't get is how you would change that from a weapon special to an ability. Don't you need the [damage] weapon special to adjust the damage (before slow/resistance/etc)?
If a weapon special appears in [abilities]
, it behaves as an ability that grants the weapon special. It's a relatively new addition.
Cool. I'm starting to step through this now, I've moved it from attacks to abilities and I'm starting in on the various levels of events. I'm really wondering if there is (or will be) any reason to have unit.variables.wrath_intensity now, since it's (probably) just going to match unit.abilities.damage.add.
I'm really wondering if there is (or will be) any reason to have unit.variables.wrath_intensity now, since it's (probably) just going to match unit.abilities.damage.add.
The problem is that there may be multiple [damage]
abilities other than wrath.
I'm not seeing the problem. There could be other [damage] abilites, but we won't conflict with them as we only touch the one with id=latent_wrath.
Your question was not explaining it properly. It's not an issue when I see it in your Pull Request.
Yeah, I knew when I wrote unit.abilities.damage.add that I was leaving out the "where unit.abilities.damage.id = latent_wrath" part, but I didn't know how to express that.
I just got an error from my new [set_wrath_intensity] at the start of a scenario. There was a unit on the recall list that had a wrath_intensity and it was trying to decay, but wesnoth.units.get doesn't look at the recall list (I assume, this seems the obvious cause).
I've never paid much attention, so I'm not sure how it's supposed to work. I thought wrath carried over (though I recently ran into something in ch5 which made me think it wanted to be reset at end of scenario), but I've never considered what happens to units on the recall list. Does (should) their wrath_intensity decay as if they were on the map?
All wrath should be reset to zero at scenario end. Some time is supposed to pass between scenarios, long enough for all wrath to cool down.
Before I go looking, any idea where that used to happen?
Hmm, I see it. I even updated it. Now I need to troubleshoot it.
[event]
name=start,victory
first_time_only=no
[store_unit]
[filter]
ability=latent_wrath
[/filter]
variable=wrathful
[/store_unit]
[for]
variable=h
array=wrathful
[do]
[set_wrath_intensity]
id=$wrathful[$h].id
set=0
[/set_wrath_intensity]
[/do]
[/for]
{CLEAR_VARIABLE wrathful}
``` [/event]
Shoot, I know why that wasn't working. I had the part that actually removed the ability wrapped inside if debug.