Chain Lightning (Weapons Special)

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Chain Lightning (Weapons Special)

Post by Efinari »

I recently finished a small add-on (available on the 1.10 server and soon to arrive on the 1.12 server). It's just one weapons special (for now), but I thought it interesting enough to submit.

*EDIT*: Now with an additional special: Battle Vigor
How Chain Lightning works
When a unit is hit by an attack having this special:
1. Any adjacent units (except for the attacker) are hit with half the initial damage, corrected for resistance.
2. Any units adjacent to them (except ones that have already been hit) are hit for a quarter of the initial damage, corrected for resistance.
3. This process repeats until the fraction of the initial damage drops below 1 damage.

4. A filter can be set inside the unit file to exclude some units. Currently incorporeal units (the undead Spirit units) will not be counted as units in the chain - damage will not target them, nor will it pass through them to adjacent units.
Some tips for gameplay with Chain Lightning
1. One obvious tip for fighting against this special is, don't bunch your units together. The chain special is completely powerless if there are no adjacent units.
2. Another tip for fighting them is, stand next to the opponent's units. The chain special will target its own side just as surely as it would target yours.
3. Put someone highly resistant to the special's damage type in the front. Every unit affected by the chain will correct for their own resistance, but the damage they are adjusting is determined by the unit attacked. For example, if you have a drake going up against a cold attack, everyone receives massively more damage than if an elf was the unit first hit.

4. For those attacking with the special, make sure your own units aren't touching the chain. Your units will be targeted and harmed by the chain damage just as much as your opponent's units.
5. Try to make the initial damage (what you see in the attack dialog) as high as possible (i.e., attack units with poor resistance to your damage type). This will result in higher chain damage and often in more units struck by the chain damage.
How Battle Vigor works
When a unit kills another unit using this attack:
1. The victorious unit gets to move and attack again.
2. The battle vigor attack loses 1 (one) damage point.
3. The victorious unit loses 1 (one) mp.
4. The unit does not recover its strength until its next turn.
In the add-on I included several modified mainline units, along with a modified 'default' era. This is mostly for the sake of demonstration. It can be fun to play around with, but ultimately I feel these specials are so powerful they should be reserved for special units.

If any of you want to include them in any campaigns/units you're designing, I'd love to know! Please reply below (or PM me) and tell me how you're using them - it helps me understand what direction any possible future 'tweaks' should go.

Also, if you find any bugs or have any sort of feedback, leave a reply below.

I'd love to possibly make this a whole pack of abilities/weapon specials resources. I've made a start by adding battle vigor, but if you have any ideas for other abilities or weapon specials that you like but can't (or don't want to) code, leave a reply below and I'll see what I can do with it. I love doing really crazy things with the wml.

Some items I hope to work on and get functional (not all of them will necessarily be implemented):
TODO List
1. Animate the chain spreading to other units.
2. Implement a "spread across water" technique, where chain damage can spread two hexes on conductive terrains (see Edwylm's post below).
3. Factor in defense? I'm toying with that idea, but honestly there isn't really any valid way to defend against chain damage. Besides, it'd be really difficult to code. :lol:
4. Reset the 'resting' flag when a unit gets hit by chain damage, so they don't heal 2 hp right after getting hurt.
5. Apply additional weapon specials and/or abilities? That way a unit killed by indirect fire from a plague attack will be reanimated just as if he had been directly killed. Not sure if I want to do that or not.
Bugs; potential and real; things I haven't had time, inclination, and/or know-how to fix:
BUGS
1. The same filter has to be defined in each unit (basically copy and paste your implementation of the special). You can't have one unit whose chain damage doesn't affect Ghosts and one whose does. Because of the way the macro works, I'm fairly confident whichever file gets loaded first will override the other one - either everyone will be able to hit Ghosts or no one will.
2. The lack of animation might be considered a bug.
3. Animation or no, the attack sequence tends to be a bit jerky and detract from the overall effect.
Last edited by Efinari on May 12th, 2016, 3:10 am, edited 4 times in total.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
User avatar
Paulomat4
Moderator Emeritus
Posts: 730
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: Chain Lightning (Weapons Special)

Post by Paulomat4 »

I'd love to include this weapon special for my leader in my campaign the rising who casts lightnings. I don't have access to a computer currently, but i'll pm you as soon as i have.
Just an idea, have you animated the ability? Would be nice to see a lightning zapping from unit to unit, although you'd have to see how to animate it.
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
Bob_The_Mighty
Posts: 870
Joined: July 13th, 2006, 1:15 pm

Re: Chain Lightning (Weapons Special)

Post by Bob_The_Mighty »

Ditto - I'd make a great bonus for magicians in Bob's RPG Era.

Animations would be a nice touch, but a pain to pull off I imagine. Have you had an ideas along these lines?
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

I have dreams of adding animations. I would love to be able to copy the initial attack's animation from the defender to adjacent units. However, that may be too complicated. I'll probably poke at it a bit when I have time.

If I can do any animations at all, I could simply suffice with a lightning animation no matter what the attack. Or I could put another tag in the special (after the {FILTER} tag) for the user to include their own animation. However, I'm worried that no animations will be permitted since the macro fires during an attack sequence - I'm severely limited in what I can do while a unit is attacking.

In summary, yes, I would love to include animations and I will look into the possibility as soon as I have time. Don't set your hopes too high on this one though; that's why I released it without animation in the first place.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
User avatar
firefox
Posts: 121
Joined: September 7th, 2009, 6:26 am
Location: Berlin

Re: Chain Lightning (Weapons Special)

Post by firefox »

the meteor attack from LotI targets all units in an area.
for animation it uses a large halo frame sequence and immediately after the animation has finished the damage is inflicted.
if your special affects all units in all directions, you could just use a circular lightening animation around the attacker.
may the source be with you
=(^.^)= nyan~
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

Thanks, that'll be good for reference.

I'm kind of steering away from just one big anim. Yeah, it affects all adjacent units, but if there's not a unit standing there, the lightning shouldn't branch out to an empty hex.

It might actually be nice to do it all as one big anim though, so there's a lot of merit in the suggestion. There are a couple ways I could play it:

1. Just swallow the non-realism of the chain striking an empty hex. This is also an issue if some units (Ghosts in my example era) are immune to the chain.
2. I could perhaps have image files for every possible arrangement of units (which would be way too many image files) and figure which one to use when the attack is used. This would probably be the worst possible solution.
3. It may be possible to 'construct' an image on the spot where the anim passes to all the units struck. This would be the best solution if it's doable. I don't have as much experience with anim wml, but I'll look into it.

So, some ideas for me to play around with. I'm still not 100% sure I'll be able to make the animation work at all.

As per firefox's suggestion, anyone using this special could simply give their unit's attack an animation that covers the whole field of units. It would work decently for your purposes.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
User avatar
Edwylm
Posts: 238
Joined: August 24th, 2015, 11:18 pm

Re: Chain Lightning (Weapons Special)

Post by Edwylm »

This is a good idea and I would like to add this to 2 of my dwarves "dwarvish shocktrooper and dwarvish stormtrooper" in my campaign "Rise of a Outcast". It will also allow a good use of 2 lightning attacks for them.

However I do have some concerns. Electricity goes though the path of least resistance, lightning gets amplified when it hits water and will case more damage to a person standing in water, if there is no one in the surrounding hexes it would still affect the spaced units if they too were in water.. But do to it being magical it might not go by the rules.
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

Thank you very much for bringing that up. You've hit on another feature I hope to implement besides the animations.
Edwylm wrote:Electricity goes though the path of least resistance
Is this a preface to the following, or a separate clause? If you mean the electricity should go through elves faster than through dwarves (or something like that), that starts getting more complicated.
Edwylm wrote:lightning gets amplified when it hits water and will case more damage to a person standing in water
That I'm not so sure about. Electricity does more damage to people in water simply because it conducts better. I could however look into implementing a damage modifier for certain terrains - perhaps villages are equipped with lightning rods that dispel some of the damage or something.
Edwylm wrote:if there is no one in the surrounding hexes it would still affect the spaced units if they too were in water
This I absolutely want to get implemented. Basically I'm thinking two water hexes count as one land hex - units standing in water will pass the chain on to adjacent units and units standing two hexes away. However, they would all (or maybe just the adjacent units?) have to be standing in water, which leads to some very complicated coding.
Edwylm wrote:But do to it being magical it might not go by the rules.
Wait...that's a good point. I intend for this to be usable for any kind of attack - sure, I (and everyone else) thinks "lightning" (which is why it's part of the add-on's name), but you could potentially use it for any attack. So maybe I should give an option whether or not to make it spread across water like electricity does. Or perhaps even create different behaviors for different damage types...that would be interesting, but mostly pointless.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

Thanks for all the responses so far.

I thought I should give you a heads up. I will be traveling back to college tomorrow (Saturday, 8/28), and it's unlikely I'll be able to access the forums (and unlikely I'll have time to keep up). Please continue to post, but I'm afraid I probably won't be able to respond until sometime in November at the earliest.

Keep enjoying Wesnoth and my add-ons. :)

P.S. Sorry for the double post; it seemed more appropriate to say this separately than in my response to Edwylm.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
User avatar
Edwylm
Posts: 238
Joined: August 24th, 2015, 11:18 pm

Re: Chain Lightning (Weapons Special)

Post by Edwylm »

Efinari wrote:
Edwylm wrote:Electricity goes though the path of least resistance
Is this a preface to the following, or a separate clause? If you mean the electricity should go through elves faster than through dwarves (or something like that), that starts getting more complicated.
Well that would be complicated but undead "like corpses and skeletons" would have a reduction as they don't feel pain they would only receive the burn damage. Unless if you want it to do it that way a simple thing would be that it weakens the necromancy magic.
Efinari wrote:
Edwylm wrote:lightning gets amplified when it hits water and will case more damage to a person standing in water
That I'm not so sure about. Electricity does more damage to people in water simply because it conducts better. I could however look into implementing a damage modifier for certain terrains - perhaps villages are equipped with lightning rods that dispel some of the damage or something.
That would be a good idea about terrain difference but that might end up into being complicated.
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

Well, I'm finally done with my year at college (as it happens my final year) and back to the forums and the coding.

As a sort of "Hello and welcome back," I have taken my first step towards turning this into a whole pack of specials/abilities by adding a weapon special.

You can read about it up top in the edited original post, but here's a quick fly-by:
Battle Vigor is a weapon special which, upon a kill, grants the victorious unit the opportunity to move and fight again.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
kjn
Posts: 46
Joined: March 4th, 2016, 4:26 pm

Re: Chain Lightning (Weapons Special)

Post by kjn »

Here are a couple of ideas for new weapons/combat specials:
  • "Press the attack": for every successful attack, the attacker gets to do one additional attack. Once the base attacks are exhausted, they get to attack once again for each successful attack in the previous round. Eg, say the attacker have four attacks base, of which three hit. They get to attack three times in a second round, of which one hit. In the third round, they have one attack, which hits, so they get a single attack in a fourth round, which misses and ends the entire combat.
  • "Outflanking": This one probably wouldn't be an attack special as it changes all combats. If a unit has enemy units on its flanks when it is attacked, its return damage is reduced. Eg, if the attacker has an attacker at position 1, and another enemy at position 3 (ie at 120 degrees angle), the the defender does only 75% of their normal retaliation damage. If the defender has enemy units at positions 1 and 4 (ie at 180 degrees separation, just as backstab), then their retaliation damage is reduced to 50%. Attacks when surrounded/flanked should probably be left unchanged.
  • Mirror defense: A defender will retaliate with exactly the same attack as they are attacked with.
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

These are some great ideas; thanks kjn.
kjn wrote:"Press the attack": for every successful attack, the attacker gets to do one additional attack. Once the base attacks are exhausted, they get to attack once again for each successful attack in the previous round. Eg, say the attacker have four attacks base, of which three hit. They get to attack three times in a second round, of which one hit. In the third round, they have one attack, which hits, so they get a single attack in a fourth round, which misses and ends the entire combat.
This has some potential, but I'm a little worried that it would be too strong - what if the attacker hits every single time (which never happens with a human player, but often does with an opposing AI)?
I'm thinking I could implement it where they get "successful attacks" minus one - so if they hit three times in the first round they would only get two swings in the second round.
Also, would this have any effect on moves? Restoring moves would make it too similar to battle vigor, but leaving moves at 0 (which is what they're set to when you attack a unit) would render the special less effective - although it would actually be good to "press the attack" against just the one foe, so leaving moves at 0 wouldn't be that bad.
kjn wrote:"Outflanking": This one probably wouldn't be an attack special as it changes all combats. If a unit has enemy units on its flanks when it is attacked, its return damage is reduced. Eg, if the attacker has an attacker at position 1, and another enemy at position 3 (ie at 120 degrees angle), the the defender does only 75% of their normal retaliation damage. If the defender has enemy units at positions 1 and 4 (ie at 180 degrees separation, just as backstab), then their retaliation damage is reduced to 50%. Attacks when surrounded/flanked should probably be left unchanged.
I really like this one. I'm thinking something like this:
"Outflank" will be an ability. Each unit with this ability will lower an adjacent defending unit's retaliation damage by a certain amount. It's basically a cumulative, reverse leadership ability.
kjn wrote:Mirror defense: A defender will retaliate with exactly the same attack as they are attacked with.
Again, this would likely be an ability held by the defending unit. This could be both a blessing and a curse - for instance, it's great if you're defending against a Wraith's arcane touch. It's not so great if you're defending against a drake's fire breath.
This one looks like it would be a little trickier to code, but I'll definitely look into it.
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
kjn
Posts: 46
Joined: March 4th, 2016, 4:26 pm

Re: Chain Lightning (Weapons Special)

Post by kjn »

@Efinari: No, I don't expect any of these abilities or specials to interact with movement.

I'm looking at "Press the attack" as something a little less powerful, but also less risky, than Berserker. One could of course limit the maximum number of attacks, eg the original number of attacks times two or three.

I imagine your take on "Outflank" will be quite different from how I envisioned it, not so much about adding more benefits of tactical positioning and outnumbering, but on using a specific unit in a specific way. I'm not even sure it should use "Outflank" as a name, for that reason, but I can't come up with something good yet. I'd probably also think of putting in some sort of limit, say 50%, on how much the retaliation damage could be reduced. (Note: the attacker itself should probably never benefit from their own ability here.)

Another way to do it could be to make it a more limited Slow that always hits, but you have to make an attack first, but maybe that's too similar.

Yeah, "Mirror defense" would be an ability where you really would have to think about how you place and use such a unit, which to me would be part of the fun with it.
User avatar
Efinari
Posts: 103
Joined: January 25th, 2011, 3:07 am
Location: Grakvr Peak, Eastlands

Re: Chain Lightning (Weapons Special)

Post by Efinari »

kjn wrote:I'm looking at "Press the attack" as something a little less powerful, but also less risky, than Berserker. One could of course limit the maximum number of attacks, eg the original number of attacks times two or three.
Ah, so it's like berserker with a limited number of responses, based on how many hits were successful each time? Would this work when defending, or just while attacking?
kjn wrote:I imagine your take on "Outflank" will be quite different from how I envisioned it
I'd like to create this ability/special the way you envision it. I'm just trying to understand how exactly it would work. I constructed a little case study for some clarification:
case1.png
case1.png (75.67 KiB) Viewed 4847 times
So, Charley attacks Grog and Grog defends himself.
Grog's sword deals 8 damage, +2 against Charley's lack of armor for a total of 10 damage.
I'm assuming Charley has the outflank ability/special?
Since there is no one else around, Grog deals the full 10 damage to Charley.
case2.png
case2.png (65.45 KiB) Viewed 4847 times
Now Charley has a friend, a Spearman named Bill.
Does Bill need to have the outflank ability/special or does he not?
Since Grog has two foes standing next to him (he is outflanked?), he only deals ~8 damage (~75% of 10) to Charley on a retaliation swing.
case3.png
case3.png (66.75 KiB) Viewed 4847 times
In this case, Charley has two friends, Bill and Joe.
Again, do Bill and Joe have the ability/special or not?
This time Grog, with three foes outflanking him, will only respond with 5 damage (50% of 10) when Charley attacks him.
case4.png
case4.png (66.39 KiB) Viewed 4847 times
And what about now? Is Grog affected by outflank or not?

Let me know how these line up or don't line up with what you're thinking - I'd like to create this ability/special as you envision it. :)
Kallin Efinari
---Creator of "LOTE Unit Release", "7p - Afterwards", and "Chain Lightning"
(Working on 1.12 port of "7p - Afterwards")
Managing compatibility between 4000K people's ideas of what happens? Forget it!
Post Reply