Effect: Recoil Damage

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This effect is activated when an attack is successfully made.
The user will take some amount of damage according to the effect.

effect_recoilDamage

Download

Script: download here
Required: Effects Manager

Installation

Place this script below Effect Manager and above Main.

Usage

Tag effect objects with

<eff: recoil_damage formula element_id>

Where the formula is any valid ruby statement that evaluates to a number.

The element_id is the ID of the element you want the recoil damage to be. Look up the ID in the Terms tab. If you set it to -1, then it will be the “atk element” of the target which can be set using features.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

28 Responses

  1. Chris says:

    I am trying to get the recoil damage to work as a curse on a weapon. I am not sure what I did wrong, but when I test it, the weapon doesn’t recoil on the user, instead when a monster attacks, damage is recoiled on it…

  2. Hanni says:

    My message didn't post….

    I was wondering about two things
    1) How can I prevent the self-damage from being fatal? (ie. I want the user to survive with 1HP if they use a skill with recoil that would kill them)

    2) How can I prevent the recoil damage from happening per enemy hit? If I use a skill that hits all enemies, it applies the recoil damage for each enemy hit.

    Thanks!

    • Hime says:
      1. This is an older script so it doesn't provide special variables for you to use. Ideally you would set the maximum damage to be one less than the user's current HP, but modifications to the script would be needed to support it.

      2. You'd need to modify the script for that. This script was simply to demonstrate how recoil damage could be implemented.

  3. Hanni says:

    Late to the party, but have two questions –

    When I apply this to an attack that hits multiple enemies, I take recoil for each enemy hit – is there a way to change it so that I only take recoil once?

    Also, is there a way to make the recoil damage not kill you? Like leave you at 1 HP if it would otherwise kill you.

    Thanks!

  4. Gallagador says:

    Hello,
    I was using your script in my game and started getting errors every time an enemy killed itself from recoil. The error seems to be from Jet's Animated Battlers script but it only happens if the enemy dies from recoil. I will consult Jet about the problem too, but I was wondering if maybe there was just one little thing that could be changed to make the scripts work together.

    Jet's Animated Battlers Script: http://pastebin.com/raw.php?i=4Gagm2mM
    Error:
    Script 'Jet_Animated_Battlers' line 643:NoMethodError occured.
    undefined method `item' for nil:NilClass

    I'm only asking you about this because it's the only script that is causing this error to pop up.

    • Hime says:

      Pretty sure the battle script would crash if the attacker died as a result of the action (eg: suicide attack).

      • Gallagador says:

        Oh… um… Do you know if there's any way around that… possibly… maybe…?

        • Hime says:

          Change

          if @subject.current_action.item.physical?
          

          to

          if @subject.current_action &amp;&amp; @subject.current_action.item.physical?
          
          • Gallagador says:

            Trying to start the game with the code you gave gives the error:

            Script ‘Jet_Animated_Battlers’ line 643:SyntaxError occured.

            unexpected tAMPER
            … @subject.current_action &amp;&amp; @subject.current_action…

            Am I supposed to be formatting the code a certain way? I feel like it might be something with the "&amp;"s (I don't know RUBY or RGSS3, but the error just makes it seem like that).

          • Hime says:

            Those should be &&

            WordPress seems to automatically convert them.

          • Gallagador says:

            Thank you so much Hime!

  5. kizzo212 says:

    This is my first time using an external script and it appears that there is no “Effect manager” in my script. how do i get it?

  6. RogueDeus says:

    Just had a chance to add the new changes,
    I am now getting this error:

    line141: SyntaxError
    unexpected $end, expecting ‘=’

  7. RogueDeus says:

    Request?

    Is it possible to specify the damage type dealt by the recoil? Thus resistances/weaknesses can add another level of complexity.

    Thanks!

  8. Tsukihime says:

    Didn’t set a guard trigger for states. I have updated it so that all objects have a guard trigger as well.

  9. Inominavel says:

    Thus the marked enemy with that tag receives recoil damage. I expected the enemy marked with this tag could damage back to the attacker.
    Thus:
    Hime attacks Hedgehog!
    Hedgehog took 603 damage!
    Hime took 60 damage from the recoil!

    Hedgehog is an enemy that has the tag
    As the ability to Pokemon, Rough Skin:
    http://bulbapedia.bulbagarden.net/wiki/Rough_Skin_(Ability)

    • Tsukihime says:

      I forgot, you will need to use the -guard trigger to specify that it should only activate when the enemy is targeted by an action. The script is very generic and provides many different ways to trigger the effect. To achieve your desired effect you would add the trigger type to the name of the effect like this

      <eff: recoil_damage-guard .... >
      
      • Inominavel says:

        Sorry … I guess I did not quite understand. Should I use the tag below?

        I used it in the status, but the character with this status is not returning rand(300) damage.

        What did I do wrong?

  10. Inominavel says:

    This applies only to skills (and the user receives damage back) or can be applied to an enemy (and any attack against it results in damage back)?

    I would like something like your script Thorn Mail, but applies to an enemy and status, not the equipment.

    • Tsukihime says:

      It can be applied to any database object.

      • Inominavel says:

        How?
        All I got was to add a probability of returning all damage, using counter-attack. The idea is to return 10% of damage (for example) 100% of the time.

        Sorry if this question is too trivial, and thanks for the help.
        I’m really happy to speak directly to you, I am a big fan of his work.

  11. Sangmanjin says:

    Thank you!
    This is a useful addon if you want to create a fight more,exciting!
    Makes you think before you act.More useful if you have limited heal-ups!

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax