teroparvinen / foundry-wire

10 stars 4 forks source link

Better Aura Options #55

Closed lacktheknack closed 1 year ago

lacktheknack commented 1 year ago

I'm trying to implement Spray Stench (a flumph ability) as written:

"Each creature in a 15-foot cone originating from the flumph must succeed on a DC 10 Dexterity saving throw or be coated in a foul-smelling liquid. A coated creature exudes a horrible stench for 1d4 hours. The coated creature is poisoned as long as the stench lasts, and other creatures are poisoned while within 5 feet of the coated creature."

This isn't doable with WIRE alone, because having an effect behave like an aura automatically (and only) takes the main item target line. I can't have the item have a 5 foot radius while administering the effect via a 15 foot cone.

image

image

I tried enabling Active Auras and WIRE at the same time, and it ALMOST worked, except that the Active Auras aura is lost while applying the effect to the targets. If I manually remake the active aura on the target, it does what I want, but that's not feasible in a game situation.

Potential solution: Allow manual configuration of effect auras in WIRE.

teroparvinen commented 1 year ago

This is an example of how the dnd5e system doesn't contain enough fields to implement all spells and abilities properly. There's a trade off between implementing a plethora of new fields to support things like this and making maintainable functionality that is not likely to break with system updates. I'm wary of overriding pieces of system UI and I only do it if it can't really be helped, like the half/full damage fields for damage rows (adding new stuff is generally better, like the variants etc.). On the other hand, I don't want to have the "same thing" configurable in multiple places because that is really confusing for new users and that's the reason I started WIRE in the first place.

I implemented a fix that will be in the next upcoming version that better tracks auras created on targets other than the caster, which will help in implementing stuff like this.

I would take a cue from stuff like Delayed Blast Fireball and Call Lightning for the actual implementation of the feature, and have one of the target areas in script. In this case, I think it would be more convenient to do it for the cone and have the aura be in the standard fields. This script did it in my tests:

this.registerFlowStep("applySprayTemplate", true, async (activation) => {
    const templateData = await game.wire.placeTemplate({
        t: "cone",
        user: game.user.id,
        distance: 15,
        direction: 0,
        x: 0,
        y: 0,
        fillColor: game.user.color
    });
});

return this.pick(
    this.isImmediateApplication(
        this.performCustomStep("applySprayTemplate",
            this.confirmTargets(
                this.performSavingThrow(
                    this.applyEffects()
                )
            )
        )
    ),
    this.defaultFlow()
);

(This will still need the next update to work properly all the way.)

I will still keep this issue in mind and see if a more elegant solution pops into my head at some point.

lacktheknack commented 1 year ago

Useful, thanks. I suppose what I'd find helpful for situations like this is a page on the wiki giving a bullet list of usable arguments for WIRE's functions, ie. I wouldn't have known off-hand what to put in the game.wire.placeTemplate object.

teroparvinen commented 1 year ago

That is a never-ending work in progress... The best way to find all this if you have the patience is to go through all the stuff in the WIRE SRD, most of it is used somewhere there.

lacktheknack commented 1 year ago

Fair enough. Reverse-engineering time!