Non-Fatal Wounds: Maimed Edition

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

This is an extension of the Non-Fatal Wounds add-on by Octalot and Armagedonus that adds lasting injuries to your units whom nearly escaped death.
current injuries
amnesia (resets exp)
broken arm (-20% non-magical damage)
broken leg (-20% mp)
broken rib (-10% impact resistance)
burned (-10% fire resistance)
captured (increased recall cost based on level untill you recall them)
concussion (-20% magical damage)
coward (-10% accuracy)
fear of weapon (reduced strikes against what wounded them)
fear of terrain (increased move cost for the terrain they were wounded on)
fear of the dark/light (reduced strikes during the time they were wounded)
frostbite (-10% cold resistance)
gash (-10% blade resistance)
infection (chance to be poisoned)
insanity (berserk on melee attacks)
maimed (-15% hp)
short-term memory loss (lose 1 xp/round)
wild magic (magical attacks now are 50% chance)
injuries that can be toggled off
death (they are dead)
paper cut (the second worst thing to ever happen)
stepping on a lego (the worst thing to ever happen)
turning into a ghost (custom ghost, cant advance beyond level 2)
turning into a zombie (custom zombie, heavily debuffed ranged attacks)
Injury healing system
Injured units receive an AMLA for removing the injury
injuries that can be toggled off cant be healed
*fear of terrain: 10% chance of recovery when defeating an opponent while standing on the terrain unit is scared of
*fear of weapon: 20% chance of recovery when defeating an opponent wielding the weapon the unit is scared of
*fear of dark/light: 20% chance of recovery when defeating an opponent during the day/night
Features I want to add
alternative injury healing systems
conditional death (if overkilled, raised as zombie, or died to vulnerability, bypass random wounds and kill the unit when enabled)
captured units having a chance of receiving an additional wound if not recalled
Last edited by CookieLord on August 22nd, 2022, 10:09 pm, edited 3 times in total.
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

Apparently the dependencies are set wrong and I don't know how to fix it.
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Non-Fatal Wounds: Maimed Edition

Post by Atreides »

Nice idea! I kind of wished for something like this.

However I've tried it and while it shows messages for maiming when units (incl. enemy) are killed when I recall mine next scenario they don't seem to have any maimage. I lost a bowman in one scenario at the end and saw he was amnesiad but in the next when I recalled all my bowmen none had 0 xp.
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

Do you have both Non-Fatal Wounds and my mod installed and activated?

The original Non-fatal wounds is needed to add your dead unit to the recall list.
Last edited by CookieLord on July 29th, 2022, 5:17 pm, edited 1 time in total.
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

The messages for enemy deaths is a side affect of allowing the player to see the messages when it is not their turn.

Eventually I would like to change that, but I felt knowing what happened to your own units was more important than the increased number of messages on screen.
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Non-Fatal Wounds: Maimed Edition

Post by Atreides »

CookieLord wrote: July 29th, 2022, 5:00 pm Do you have both Non-Fatal Wounds and my mod installed and activated?

The original Non-fatal wounds is needed to add your dead unit to the recall list.
Of course. The problem isn't that they're not on the recall list. They are. But they're not maimed. The original is working but the maiming isn't. I've updated to 1.03 also and tried it again and still none of the wounded units show any maiming in the next scenario.

Oh and don't worry about that the msg appears on enemy units, I think that's just fine. I was merely amused to think that the ai can't recall those maimees. ; ) In fact it's quite a bit of fun to see the enemy being maimed. Muahaha! <evil grin>
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

My guess is that wesnoth is loading Non-Fatal before it loads Maimed Edition, causing it to copy units to the recall list before the maimed effects are applied.

Assuming this is the problem ive updated the add-on to force the load order, but this means that Non-Fatal needs to be disabled (but still installed).
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Non-Fatal Wounds: Maimed Edition

Post by Atreides »

CookieLord wrote: August 1st, 2022, 5:57 pm My guess is that wesnoth is loading Non-Fatal before it loads Maimed Edition, causing it to copy units to the recall list before the maimed effects are applied.

Assuming this is the problem ive updated the add-on to force the load order, but this means that Non-Fatal needs to be disabled (but still installed).
Hi, I had a peek into your add-on's code and it appears you are using traits for the maiming. Alas, as I found out the hard way, you can't add traits to units. I believe you could do it using abilities. Sorry about the bad news. : (
dwarftough
Posts: 481
Joined: August 4th, 2019, 5:27 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by dwarftough »

Atreides wrote: August 1st, 2022, 6:42 pm Alas, as I found out the hard way, you can't add traits to units.
Not true, you can add traits. In LotI GEARED trait is added/removed when you equip an item/unequip all items. In World Conquest the "trained" trait is randomly added for trained units
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Atreides
Posts: 1059
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Non-Fatal Wounds: Maimed Edition

Post by Atreides »

dwarftough wrote: August 2nd, 2022, 12:41 am
Atreides wrote: August 1st, 2022, 6:42 pm Alas, as I found out the hard way, you can't add traits to units.
Not true, you can add traits. In LotI GEARED trait is added/removed when you equip an item/unequip all items. In World Conquest the "trained" trait is randomly added for trained units
Interesting, I just looked into WC and it appears to use lua to do it. Can it also be done via wml as Cookielord is trying to? (I don't have Lotl so I couldn't see how it did it)
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

in my own testing it was working. A quick way to test if the traits are working is to change the last_breath event to a recruit event in the randomizer file.

health modifications and the dead trait wont trigger until the following scenario.
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

Also originally I was going to use objects, but i wanted there to be a way for players to see what is modifying their units at a glance.

the only way i can think of for objects to display themselves would be a custom overlay for each wound.
dwarftough
Posts: 481
Joined: August 4th, 2019, 5:27 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by dwarftough »

Atreides wrote: August 2nd, 2022, 3:33 pm Interesting, I just looked into WC and it appears to use lua to do it. Can it also be done via wml as Cookielord is trying to? (I don't have Lotl so I couldn't see how it did it)
This code from Hejnevar's PYR adds a trait to 7 moves leaders with pure wml

Code: Select all

    [event]
        name = prestart
        [modify_unit]
            [filter]
                canrecruit = yes

                [filter_wml]
                    max_moves = 7
                [/filter_wml]
                [not]
                    trait = lazy
                [/not]
            [/filter]

            {TRAIT_LAZY}
            [effect]
                apply_to = hitpoints
                heal_full = yes
            [/effect]
        [/modify_unit]
    [/event]
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

Finished the base versions of the injuries I was planning on adding.
Next I will probably swap the traits to objects using dummy specials to inform the player of the injury (the remove_trait tag wasn't working for me).

edited original post to reflect current add-on version
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: Non-Fatal Wounds: Maimed Edition

Post by CookieLord »

v1.3.0
-changed most traits to objects with specials to allow removing them (left dead, undead_ghost, undead_corpse unchanged)
-changed undead_corpse image change to an overlay of a soulless
-added the sick wound to the random wound table
Post Reply