Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burns poisoned foes (or not) #695

Open
white-haired-uncle opened this issue Mar 15, 2024 · 19 comments
Open

Burns poisoned foes (or not) #695

white-haired-uncle opened this issue Mar 15, 2024 · 19 comments

Comments

@white-haired-uncle
Copy link
Collaborator

white-haired-uncle commented Mar 15, 2024

Just noticed Krux's happy little burns foes(48) isn't working against a rather nasty demon. It seems, so far, that burns foes does not affect poisoned enemies, and as a matter of fact it looks like it even protects them from being poisoned?

I assume the latter is due to poison=slowed. (Probably affects deathaura,etc as well?).

For the former, I think some effects (Deathaura) say they do not affect poisoned enemies, but this isn't one of them.

What is the intended behaviour here?

@Discontinuum
Copy link
Contributor

incinerate is claimed to not work against poisoned enemies, but I noticed a lot of times that if you have an incinerating and poisoning attack (maybe in some order) then you can both incinerate and poison an enemy. Looks like either the check isn't working at all or if the specials are in some preferred order. To be honest, I would advise to allow them stack and remove "doesn't work against poisoned enemies" from descriptions

@Dugy
Copy link
Owner

Dugy commented Mar 15, 2024

Just noticed Krux's happy little burns foes(48) isn't working against a rather nasty demon.

Yes, it's implemented as negative healing, and healing either cures poisoned enemies or prevents the poison from applying, but in either case, the healing is not applied. I think it's even mentioned in some description, with a handwave that it damages virulent molecules of poison preferentially.

To fix it, it would have to be reimplemented as harming adjacent units every turn, which isn't hard to do.

@white-haired-uncle
Copy link
Collaborator Author

In that case it probably makes sense to change to poison=cured. Keep the behaviour as described, but let the burn kill the poison so the strange effect only lasts one turn. And find some way to describe this in a short enough fashion that still makes sense for the description.

Had I known how all this, I would not have crafted Intoxicator for Krux. I only wanted it for slows, but...

@Dugy
Copy link
Owner

Dugy commented Mar 17, 2024

I would probably still prefer to change it to be an event-based ability that actually deals damage of the given type, rather than does a negative heal and interacts counterintuitively with poison.

@white-haired-uncle
Copy link
Collaborator Author

So, Krux has burns foes(48) and deathaura(10). An enemy adjacent to him would take how much damage?

What if said enemy was also adjacent to a CM with burns foes(33)?

@Dugy
Copy link
Owner

Dugy commented Mar 17, 2024

I assume the same damage, except for changes done by damage type.

@white-haired-uncle
Copy link
Collaborator Author

So 91? Burns foes says it ignores all resistance, and deathaura simply says "damage" which implies the same.

No limit for damage from one unit (Krux can do 48+10=58)? No limit for number of damagers (Krux and CM both damage same enemy)?

Also, burns foes says it can not kill, deathaura doesn't say anything about killing. I can't think of any others, but it would be interesting if at least one could and others could not.

@Dugy
Copy link
Owner

Dugy commented Mar 17, 2024

Yes, I was thinking about putting there some configuration, so that they would be more different.

I am thinking that burns foes could deal fire damage and be unable to kill, while deathaura would deal arcane damage and be able to kill. And they would stack, it shouldn't be a much of a buff given that now resistances apply.

Btw, since both were implemented as negative heal, resistances simply could not apply and they could not kill.

@white-haired-uncle
Copy link
Collaborator Author

I've always thought that burns foes was over powered, so having it limited by resistances is generally a good thing. But, Krux is (almost always?) the most vital unit in the hardest chapter (perhaps more accurately stated "the hard chapter"), so anything that messes with him is a little concerning. I wonder if he shouldn't get some fire penetration AMLAs or lesser redeem upgrades, and/or some inherent fire penetration. Normally I'd just say let the player work it out with gear, but chapter 10.

It's too bad it's called burns foes, as IMO fire is already well represented (incinerate, from the ashes, whatever the reflect-like thing is that does fire damage). Oh well.

@Dugy
Copy link
Owner

Dugy commented Mar 18, 2024

Renaming it isn't a problem if you suggest changing the damage type to something else. What do you think would be more suitable?

@white-haired-uncle
Copy link
Collaborator Author

white-haired-uncle commented Mar 18, 2024

Deathaura sounds like something that shouldn't affect undead/mechanical.

The only units I can think of with burns foes are Krux, Stormrider, and Cel Mess, all of which are probably way too powerful/useful, so I really don't mind weakening an overpowered ability (again, with consideration to Krux in ch10). That said, I think probably the most important aspect to consider is the CM's conviction -- if you want to minimize the impact of making burns foes dependent on damage type, cold seems like the clear choice, to maximize make it anything physical. On a similar note, I believe impact has the least amount of available penetration through items.

I'd also point out that burns tends to come later in the game, when enemies are more/most likely to be demons/mechanical. I don't have a point here, except it's probably worth thinking about.

Since there's only a few unit types affected and the name may change, there's no reason they all have to be the same.

Other than perhaps Krux, random might be fun. This could be a damage type assigned when the ability is acquired, or it could be undetermined until it is actually used (perhaps even choosing the enemy's greatest weakness on easy).

It's worth looking at how/if these will affect Verminous Sewers, particularly if they did random damage type.

With all that said, my first instinct would be cold. It just seems like it should be non-physical, fire is already well-used, and deathaura may be arcane. Just have to make sure the name does not imply that it slows.

EDIT: Just checked and deathaura wasn't doing anything when Krux held Worshiper of Darkness, but worked for Delly. Probably because Krux is a healer which trumps [heal_unit]? Nope. Changed it to [harm_unit] and it still doesn't work for him. Perhaps [harm_unit] don't stack?

@white-haired-uncle
Copy link
Collaborator Author

Turns out, you can't just swap out [heals] with [harm_unit] within [abilities]. It almost works, which I think is a bfw bug (not supposed to work at all). This works when called from a turn refresh (assuming "deathaura" renamed like "deathaura 8" to match burning_aura):


function wesnoth.wml_actions.loti_harming_ability()
        for _,source in pairs(wesnoth.units.find_on_map{ side = wesnoth.current.side }) do
                for _,abilities in pairs(wml.child_array(source.__cfg, "abilities")) do
                        for _,ability in pairs (abilities) do
                                if string.sub(ability[2].id,1,12) == "burning_aura" then
                                        local power = tonumber(string.sub(ability[2].id,14))
                                        wml.fire("harm_unit", { wml.tag.filter { wml.tag.filter_adjacent { id = source.id, is_enemy = "yes" } },
                                                amount = power, damage_type = "fire", kill = "no"})
                                end
                                if string.sub(ability[2].id,1,9) == "deathaura" then
                                        local power = tonumber(string.sub(ability[2].id,11))
                                        wml.fire("harm_unit", { wml.tag.filter { wml.tag.filter_adjacent { id = source.id, is_enemy = "yes" } },
                                                amount = power, damage_type = "arcane", kill = "yes"})
                                end
                        end
                end
        end
end

It seemed pretty slow when I was debugging it, but I haven't tried to compare to the old way. And my cpus are maxed out with handbrake, so maybe it's okay.

Backward compatability: Have to change any unit with [heals] to [dummy], and deathaura to the new format. I don't think this can be done with preload, since units could be in a stored array (maybe, assuming for example Worshiper of Darkness is available in part 1, for example). I was thinking prerecruit, but I don't know if that applies to units which are recalled and/or "recalled" at start of scenario, and it could be a touch slow. We could check in the above code if id="burning_aura..." and we're in [abilities][heals] easy enough and update the unit then (once), however I think this would mean that it would work the old way the first time (heals happens before turn refresh), which isn't that big of a deal unless you're me.

I guess it'd be "faster" if I switched to elseif, but not noticably.

@Dugy
Copy link
Owner

Dugy commented Mar 20, 2024

What you are trying to do should work, but it requires serialising every unit into WML structures every time it has its turn. It can be made more efficient by asking the C++ engine to do the filtering for you, by changing the filter to wesnoth.units.find_on_map{ side = wesnoth.current.side, ability_type_active = "periodic_damage" } (this will give you only units that actually have an ability named [periodic_damage]). I would also not use the ability's name to distinguish between deathaura and burning aura, I would turn both into [periodic_damage] ability with different properties.

I will do it when I'll have time, but right now, I have a lot of other stuff to do.

@white-haired-uncle
Copy link
Collaborator Author

white-haired-uncle commented Mar 20, 2024

Nice. I wondered if there was something that could be sent to find_on_map to narrow things down, but I wouldn't have come up with ability_type_active.

EDIT: note to check flaming radiance

@Dugy
Copy link
Owner

Dugy commented Mar 20, 2024

Okay, I have changed their implementations. Now:

  • Burning aura now deals fire damage and can kill
  • Deathaura now deals arcane damage and poisons
  • Krux deals more damage with burning aura

Upgrading will not change Krux unless he takes an upgrade to his aura, which will bug out and cause him to have two burning auras that stack.

@white-haired-uncle
Copy link
Collaborator Author

I'm giving enemy leaders some auras to try to make it harder for E/L to smash through the usually one unit in the castle needed to move next to the leader for a kill on the next turn. Trying to mix it up a little to make interesting. Thought of one that could be fun: DISTANT_ATTACK_AURA or ABILITY_DISTANTATTACK_LEADERSHIP. Seems like it would be great for castle defense. Kind of drawing a blank on how to code it.

@Dugy
Copy link
Owner

Dugy commented Apr 9, 2024

I don't know what are those abilities supposed to do.

@white-haired-uncle
Copy link
Collaborator Author

Grant distant attack (unit can attack with no retaliation) to adjacent allies. So the castle defenders, at least adjacent to the leader which is normally pretty much all of them, would be much better defenders.

@Dugy
Copy link
Owner

Dugy commented Apr 9, 2024

You need to combine ABILITY_CHARGE_LEADERSHIP with the application to enemy and setting to zero of WEAPON_SPECIAL_DISTANT_ATTACK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants