Hime-Works / Requests

Bug reports and requests that may require longer discussions and is not suitable to leave on the blog
http://himeworks.com/
GNU General Public License v2.0
7 stars 9 forks source link

Bug report: Thorn Mail (as a state) returns damage from anything #249

Open Peter-13 opened 9 years ago

Peter-13 commented 9 years ago

I've tried the Thorn Mail script (http://www.rpgmakervxace.net/topic/7525-thorn-mail/) and finally managed to make it work as I wanted. I'm not very used to scripting to it took me some time, but it's great and THANKS A LOT for putting it up!

However, if someone gives a potion to someone affected with the Thorn state, they will suffer thorn damage. Here's the note tag I added to the Thorn state:

eff: thorn_mail $game_variables[15]-user.mdf

alias :state_effect_thorn_mail_guard :armor_effect_thorn_mail_guard

Variable 15 is the caster's magic attack, so thorn damage is the caster's magic attack minus the attacker's magic defence. This works perfectly. Yet, friends who give Potions or cast healing magic/state inflicting magic will also suffer Thorn damage. Is there any way to remedy this?

Thanks a lot in advance!

Peter-13 commented 9 years ago

Also, on a sidenote, thorn damage doesn't trigger when hit by a critical hit.

Is there a way to limit it to physical hits? (doesn't return damage when hit by a magical hit, a potion, a state inflicting magic, etc.)

HimeWorks commented 9 years ago

However, if someone gives a potion to someone affected with the Thorn state, they will suffer thorn damage.

Which is expected. The script simply provides functionality for damaging the user when they do something to you.

Yet, friends who give Potions or cast healing magic/state inflicting magic will also suffer Thorn damage. Is there any way to remedy this?

If you want it to only occur under certain conditions, you'd have to explicitly write them. Given the nature of the effect scripts, they're meant to be small and easily modified to suit your own needs. This also provides an opportunity for people to learn to write ruby scripts because all you need to do is figure out what you want, look up how to check it, and then write it in one line or two.

There are any number of ways this can be done. You can check if the item is a potion (this assumes enemies do not use potions on you). You can check if the user is an actor (again, assumption that only actors will use potions on you, and actors cannot be enemies).

Also, on a sidenote, thorn damage doesn't trigger when hit by a critical hit.

The Effect Manager is written so that critical attacks are separate from normal attacks. It's a bit unintuitive now that I think about it, but you would basically need to add an alias to register critical hits to apply thorn mail effect as well. You can see that in the scripts, I have a bunch of aliases for weapons, armors, actors, enemies, etc. Look at the instructions for Effect Manager to figure out how to add "critical attack"

Is there a way to limit it to physical hits? (doesn't return damage when hit by a magical hit, a potion, a state inflicting magic, etc.)

Check if the item is a physical type. See RM help manual for this.

Peter-13 commented 9 years ago

Thanks for your quick and in depth answer. I won't be able to work on this in the next couple of days, but I'll definitely let you know when I make it work. I am learning scriptingas I need it at the moment, so i guess I'll have some more to do. Thanks!