Tsukihime

effect
Thorn Mail

25 posts in this topic

Effect: Thorn Mail

-Tsukihime

 

This script adds "thorn mail" effect to your armors.

When a battler attacks you, the enemy will receive damage in return.

 

Download

 

Script: Download here

Required: Effect Manager

 

Usage

 

Tag your armors with

 

<eff: thorn_mail x>
Where x is the amount of damage that will be inflicted.

Note that you can use a formula (without spaces) with the following keywords:

 

user - the person that is attacking you

self - you

 

<eff: thorn_mail user.def>
This will deal damage equal to the attacker's def. Edited by Tsukihime

Share this post


Link to post
Share on other sites

Guessing someone has played League of Legends? (dunno if thornmail is anywhere else haha)

 

I'm really liking all these effects you've got going. Nice job.

Share this post


Link to post
Share on other sites

I think you just have to write

 

alias :state_effect_thorn_mail_guard :armor_effect_thorn_mail_guard

 

Under it.

Otherwise you will have to copy the definition

 

def state_effect_thorn_mail_guard
  #copy from armor effect
end

 

Or separate it into its own method and just have each type call it.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I know you don't do compatibility... but I noticed with your Thornmail and Vampire weapon scripts, they don't popup the reflected damage or vampire healing with Yanfly's popup scripts (although the damage/healing is noted in the text box). Since you don't have a popup script of your own, I was hoping there was an easy solution. Any help? Thanks!

Share this post


Link to post
Share on other sites

There is no easy solution.

If you added yanfly's popups, you will be getting one popup for EVERY effect. This means that if you had 10 effects, you will get 10 different popups.

 

Yanfly's popups are not flexible in the sense that it displays as soon as there is something to display.

That is not intuitive because if you took 200 damage, your shield absorbed 100 damage, and you reflected 50 damage, it would be ugly to see yourself get hit for 200, heal for 100, and then somehow reflect 50 by healing another 50?

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I can see your point, if you use a lot of your modification scripts. Although, I'm wondering if it really looks that bad. Do you have a screenshot? :P Some people like seeing lots of numbers.

 

If you get hit with thornmail, there's a popup on you for damage and on the enemy for damage. And for vampire, it's also damage on enemy and healing on you. Those don't sound so bad, as the popups are on different targets. Mana Shield added in to that mix would get confusing. But you could do popups for the others and not mana shield, if you wanted...

 

Anyway, thanks for the response.

Edited by ekomega

Share this post


Link to post
Share on other sites

I did a quick test the other day since someone also requested it and it looked really bad.

 

First, there is a random null popping up.

Second, thorn mail popups aren't working properly: if the attacker took damage from thorn mail, it wouldn't show up. I imagine this is because the default engine doesn't support anything like this and therefore there was no need to implement it.

 

U6JGU.jpg

 

And third it just isn't intuitive.

Here, I did 50 damage, and OF that 50 damage I absorbed 10.

These popups make it look like I did 60 damage.

 

It is trivial to make the popups: simply assign values to the result (eg: result.hp_damage, result.hp_drain, result.mp_damage, result.critical, etc)

 

 def armor_effect_thorn_mail_guard(user, armor, effect)
   return if user == self
   damage = eval(effect.value1[0])
   user.hp -= damage
   user.perform_collapse_effect if user.dead?

   user.result.hp_damage = damage # new
   @result.effect_results.push("%s takes %s damage!" %[user.name, damage])
   @result.success = true
   make_damage_popups(user) # new
 end

 

But it's not working for thorn mail.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

 

I think you just have to write

 

alias :state_effect_thorn_mail_guard :armor_effect_thorn_mail_guard

Under it.

Otherwise you will have to copy the definition

 

def state_effect_thorn_mail_guard
   #copy from armor effect
end

Or separate it into its own method and just have each type call it.

@omen: hime already answer that question

Share this post


Link to post
Share on other sites

Is there any way I could either have it so I tag skills that I want to be included to cause response from the thorn armor, a tag to un-included skills from causing a response,

or that I can have it so only skills with Same As Attack applied cause a response?

'Cause the way you have it, all physical skills cause a reaction.

I have several physical spells like Jagged Rock where the power is determined by the user's MAT and the enemy's DEF, but it is counted as a physical attack. This is to be effected by things such as Damage from Physical Skills and whatnot.

Share this post


Link to post
Share on other sites

Hello Hime,

 

If I want achieve this result:

 

- If the ennemy hit me, it deal the EFFECT of Thorn Mail  <<= Already functional.

- If the Hero hit the ennemy, it deal the EFFECT of Thorn Mail <<= how achieve this in the code?

 

I'm wondering how it could be achieved as I want. (want add I use this on State Effect not on Armor/Skill/Item or any other ways.)

 

 

Thanks by advance (also if someone know how to make that, please.. help :)) !

Edited by Ata Nacius

Share this post


Link to post
Share on other sites

@Ata Nacius

 

This is my Vice Versa state. It's edited Thorn Mail effect.

 

Tag your state with ex. <eff: vice_versa 0.5>, then whenever a battler with that state recive damage original caster recive half of that damage.

If you use <eff: vice_versa -0.5> then attacker will gain hp = 1/2 damge dealted to battler with vice versa state.

=begin
#==============================================================================
 ** Effect: Vice Versa
 Require: Hime - Effect Manager
Modified version of Thorn Mail effect.
Thorn Mail Author: Hime
------------------------------------------------------------------------------   
 ** Terms of Use (from Hime Thorn Mail)
 * Free to use in non-commercial projects
 * Contact me for commercial use
 * No real support. The script is provided as-is
 * Will do bug fixes, but no compatibility patches
 * Features may be requested but no guarantees, especially if it is non-trivial
 * Preserve this header
------------------------------------------------------------------------------
------------------------------------------------------------------------------   
 Tag your state with:
    <eff: vice_versa x>
    (ex. <eff: vice_versa 0.5>)
    
 Where x is the amount of damage they will receive.
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Effect_ViceVersa"] = true
#==============================================================================
# ** Rest of the script
#==============================================================================
module Effect
  module Vice_Versa
    Effect_Manager.register_effect(:vice_versa)
  end
end

class Game_Battler < Game_BattlerBase
 
  def effect_vice_versa(user, item, effect)
    return if user == self
    return if @result.hp_damage <= 0
    #damage = eval(hp.damage).to_i
    
    mod = eval(effect.value1[0]) #rescue 1
      #damage = (@result.hp_damage * mod).to_i
    hp_damage = (@result.hp_damage * mod).to_i
    #damage = @result.hp_damage
    #user.hp -= damage
    #user.hp -= @result.hp_damage
    user.hp -= hp_damage
    user.perform_collapse_effect if user.dead?
    @result.effect_results.push("%s takes %s damage!" %[user.name, hp_damage])
    @result.success = true
    if $imported["YEA-BattleEngine"]
      if mod > 0
        user.create_popup(hp_damage, "HP_DMG")
      elsif mod < 0
       user.create_popup(hp_damage, "HP_HEAL")
      end
    end
  end
 
  alias :state_effect_vice_versa_guard :effect_vice_versa
  alias :enemy_effect_vice_versa_guard :effect_vice_versa
  alias :actor_effect_vice_versa_guard :effect_vice_versa
end

class Game_Actor < Game_Battler
 
  alias :armor_effect_vice_versa_guard :effect_vice_versa
  alias :weapon_effect_vice_versa_guard :effect_vice_versa
end

Otherwise if you asking about backfire effect try use Hime Effect: Vampiric Weapon and give it negative value ex. <eff: vampiric_weapon -0.5>, should work.

Edited by Player One

Share this post


Link to post
Share on other sites

Hello Player One, I read your code and I come back after some time for tell if it is ok.

 

For the moment, I THANKS YOU really so much for taking your time to helping me, much appreciated!

 

Really.

Share this post


Link to post
Share on other sites

Ok, Player One, with your sample for which I was learning how works HimeWorks - Effects Manager

 

I ended finally to create the effect I wanted to achieve.

 

This take me some time and also some coffee lol, but, well, I'm happy with it.

 

Later I will publish it as a "Finalized Script" in the appropriate section.

 

(as I'm French, I must just translate my script before publish it. Héhé)

Share this post


Link to post
Share on other sites

I seem to be having a small issue.  I have a character that uses a defensive skill that applies a thornmail state to all party members.  However, upon applying the state to the party, the actor applying the state takes thornmail damage.  What do I need to do to prevent that from happening?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.