Terrain Defence As Damage Reduction?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
averyimaginativename
Posts: 245
Joined: August 21st, 2010, 12:40 pm
Location: /dev/null

Terrain Defence As Damage Reduction?

Post by averyimaginativename »

I apologise if this has been asked before - I have searched, but there's so many RNG complaints show up in the results, I might have missed something...

I'm working on my first campaign, and for a special weapon in a single scenario, I want to change the behaviour of terrain defence, but I can't work out how to do it.

Is it possible using WML to change the chance to hit to 100%, and also to reduce the damage taken by the defence percentage of the terrain they're on?

For example, an attack dealing 10 damage is guaranteed to hit, but when used on an elf on a forest tile would only do 3 damage.

(If it's too complicated for somebody to tell me exactly how to do it, a yes/no answer would be fine - I'm happy to work it out for myself as long as I know it's possible).
UMC Story Images web gallery

On an indefinite Wesbreak for health reasons - please only try to get my attention for UMC story images website issues.
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Terrain Defence As Damage Reduction?

Post by SkyOne »

averyimaginativename wrote:(If it's too complicated for somebody to tell me exactly how to do it, a yes/no answer would be fine - I'm happy to work it out for myself as long as I know it's possible).
Thank you.:)
averyimaginativename wrote:I'm working on my first campaign, and for a special weapon in a single scenario, I want to change the behaviour of terrain defence, but I can't work out how to do it.
The terrain defense on each unit is based on his/her move-type that is on "core/unit.cfg" (in the defense tag) AFAIK.
averyimaginativename wrote:Is it possible using WML to change the chance to hit to 100%
Yes, it is. (well, I haven't tried it though.)
Refer WEAPON_SPECIAL_MARKSMAN or MAGICAL on "core / macros / abilities.cfg".
averyimaginativename wrote:and also to reduce the damage taken by the defence percentage of the terrain they're on?
Still yes, but how to do depends on how you would like to do.

Hopefully, these are going to help you.
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Terrain Defence As Damage Reduction?

Post by zookeeper »

Here's such a system made into a multiplayer era, you can copy over the events from that. You might need to change them a little bit to prevent the same unit from receiving the modification several times (once per scenario), or to make sure that recalled units get it too.

The code is a couple years old but I think it'll still work.
Spoiler:
User avatar
averyimaginativename
Posts: 245
Joined: August 21st, 2010, 12:40 pm
Location: /dev/null

Re: Terrain Defence As Damage Reduction?

Post by averyimaginativename »

I'm heading in the right direction now - thanks a lot, you've saved me from lots of headaches.
UMC Story Images web gallery

On an indefinite Wesbreak for health reasons - please only try to get my attention for UMC story images website issues.
Post Reply