MegaGlest Forum

Archives (read only) => Glest Advanced Engine => General discussion => Topic started by: MoLAoS on 21 April 2012, 02:04:35

Title: Magic Resistance
Post by: MoLAoS on 21 April 2012, 02:04:35
...
Title: Re: Magic Resistance
Post by: Omega on 21 April 2012, 06:41:01
There's no real way to do it, but if you really wanted a non-coding method, you could give every unit in the game its own armour type, so they'd all have just one type of armour, allowing each one to still have the strengths and weaknesses of their original armour, with an added value for magic resistance. Then you could use GAE's techtree/faction translation feature (https://docs.megaglest.org/GAE/Translations) to make this unique armour type have the same name as before.

For example, "unit_a" has the armour type "unit_a", but in the techtree XML, you state that in-game, it will appear as "metal". This way "unit_b" can have the unique armour type "unit_b", yet it could also appear as "metal" in-game. Since it's actually a different value, you can assign different damage multipliers (including one when being hit by magic) in the techtree XML (https://docs.megaglest.org/XML/Techtree). In-game, the text (in the unit's info window) will still read "metal", even though the actual type is "unit_b". If that sounds confusing, just remember that a translation doesn't affect the data at all, it simply changes the text string that's shown in game.
Title: Re: Magic Resistance
Post by: John.d.h on 21 April 2012, 17:53:48
You'll need to be much more specific about what you want. Lots of different ways to interpret magic resistance.
Title: Re: Magic Resistance
Post by: John.d.h on 21 April 2012, 18:08:06
You can use effect tags. For example, maybe this spell has effect x against humans but effect y against plants and undead.
Title: Re: Magic Resistance
Post by: John.d.h on 21 April 2012, 18:22:43
You may be better off tweaking the armor system. Anything else is going to be an ugly work-around of some sort.