Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> ~[EVA/HIT/CRI States]~ version 2.0, A simple script to add more flavor in the battle
YanXie
post Jun 25 2008, 04:37 AM
Post #1


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




~[EVA/HIT/CRI States]~

Version 2.0 revision 3
Author puppeto4
Release Date 25/06/2008
Last Update 18/08/2008

Introduction

Want skill effects like those in pokemon games? The one that modify accuracy,critical and evasion. Use this script for that tongue.gif

Features


Enable you to create state that increase/decrease character's evasion rate/hit rate/critical rate.

Script



Copy from codebox in the spoiler below

[Show/Hide] Evasion State Script

CODE
#==============================================================================
# ** EVA/HIT/CRI States
#------------------------------------------------------------------------------
# Author  : puppeto4 (puppeto5@hotmail.com)
# Version : 2.0 revision 3
# Date    : 25 / 06 / 2008
# Note    : Ougi Lied,Rolo Died;_;
# Email me for request and support  :)
#------------------------------------------------------------------------------
# Function : Enable you to create state that increase/decrease
#            character's evasion rate/hit rate/critical rate.
# Change Log :
#  version 1.5(28/06/2008)
#   - Added decrese evasion feature.
#  version 2.0(18/08/2008)
#   - Added increase/decrease hit & cri feature.
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  EVADE_TEXT  = "EVA+"
  DEVADE_TEXT = "EVA-"
  HIT_TEXT    = "HIT+"
  DEHIT_TEXT  = "HIT-"
  CRI_TEXT    = "CRI+"
  DECRI_TEXT  = "CRI-"
  #--------------------------------------------------------------------------
  # * Determine if hit bonus is included
  #--------------------------------------------------------------------------
  def extra_hit?
    states.each do |state|
      return true if state.note.include?(HIT_TEXT)
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine if hit bonus is included
  #--------------------------------------------------------------------------
  def reduce_hit?
    states.each do |state|
      return true if state.note.include?(DEHIT_TEXT)
    end
    return false
  end  
  #--------------------------------------------------------------------------
  # * Get Hit Rate
  #--------------------------------------------------------------------------
  alias puppet_extra_hit hit
  def hit
    if extra_hit?
      hit_bonus
    elsif reduce_hit?
      lower_hit
    else
      return puppet_extra_hit
    end
  end  
  #--------------------------------------------------------------------------
  # * Give Hit Bonus
  #--------------------------------------------------------------------------
  def hit_bonus
    states.each do |state|
      if state.note[/#{Regexp.quote HIT_TEXT}\[(\d+)\]/].to_a[0]
        if two_swords_style
          n1 = weapons[0] == nil ? 95 : weapons[0].hit
          n2 = weapons[1] == nil ? 95 : weapons[1].hit
          n = [n1, n2].min + $1.to_i
        else
          n = weapons[0] == nil ? 95 + $1.to_i : weapons[0].hit + $1.to_i
        end
        return n
      end
    end      
  end  
  #--------------------------------------------------------------------------
  # * Reduce hit rate
  #--------------------------------------------------------------------------
  def lower_hit
    states.each do |state|
      if state.note[/#{Regexp.quote DEHIT_TEXT}\[(\d+)\]/].to_a[0]
        if two_swords_style
          n1 = weapons[0] == nil ? 95 : weapons[0].hit
          n2 = weapons[1] == nil ? 95 : weapons[1].hit
          n = [n1, n2].min - $1.to_i
        else
          n = weapons[0] == nil ? 95 - $1.to_i : weapons[0].hit - $1.to_i
        end
        return n
      end
    end
  end    
  #--------------------------------------------------------------------------
  # * Determine if evade bonus is included
  #--------------------------------------------------------------------------
  def extra_evade?
    states.each do |state|
      return true if state.note.include?(EVADE_TEXT)
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine if evade bonus is included
  #--------------------------------------------------------------------------
  def reduce_evade?
    states.each do |state|
      return true if state.note.include?(DEVADE_TEXT)
    end
    return false
  end  
  #--------------------------------------------------------------------------
  # * Get Evasion Rate
  #--------------------------------------------------------------------------
  alias puppet_extra_eva eva
  def eva
    if extra_evade?
      evade_bonus
    elsif reduce_evade?
      lower_evade
    else
      return puppet_extra_eva
    end  
  end  
  #--------------------------------------------------------------------------
  # * Give Evasion Bonus
  #--------------------------------------------------------------------------
  def evade_bonus
    states.each do |state|
      if state.note[/#{Regexp.quote EVADE_TEXT}\[(\d+)\]/].to_a[0]
        n = 5 + $1.to_i
        for item in armors.compact do n += item.eva end
        return n
      end
    end      
  end  
  #--------------------------------------------------------------------------
  # * Reduce evasion rate
  #--------------------------------------------------------------------------
  def lower_evade
    states.each do |state|
      if state.note[/#{Regexp.quote DEVADE_TEXT}\[(\d+)\]/].to_a[0]
        n = 5 - $1.to_i
        for item in armors.compact do n += item.eva end
        return n
      end
    end
  end  
  #--------------------------------------------------------------------------
  # * Determine if cri bonus is included
  #--------------------------------------------------------------------------
  def extra_cri?
    states.each do |state|
      return true if state.note.include?(CRI_TEXT)
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine if cri bonus is included
  #--------------------------------------------------------------------------
  def reduce_cri?
    states.each do |state|
      return true if state.note.include?(DECRI_TEXT)
    end
    return false
  end  
  #--------------------------------------------------------------------------
  # * Get Cri Rate
  #--------------------------------------------------------------------------
  alias puppet_extra_cri cri
  def cri
    if extra_cri?
      cri_bonus
    elsif reduce_cri?
      lower_cri
    else
      return puppet_extra_cri
    end
  end  
  #--------------------------------------------------------------------------
  # * Give Cri Bonus
  #--------------------------------------------------------------------------
  def cri_bonus
    states.each do |state|
      if state.note[/#{Regexp.quote CRI_TEXT}\[(\d+)\]/].to_a[0]
        n = 4
        n += $1.to_i
        n += 4 if actor.critical_bonus
        for weapon in weapons.compact
          n += 4 if weapon.critical_bonus
        end
        return n
      end
    end      
  end  
  #--------------------------------------------------------------------------
  # * Reduce cri rate
  #--------------------------------------------------------------------------
  def lower_cri
    states.each do |state|
      if state.note[/#{Regexp.quote DECRI_TEXT}\[(\d+)\]/].to_a[0]
    n = 4
    n += 4 if actor.critical_bonus
    for weapon in weapons.compact
      n += 4 if weapon.critical_bonus
    end
    n -= $1.to_i
    return n
      end
    end
  end      
end
#==============================================================================
# ** End of EVA/HIT/CRI States : Script
#==============================================================================



How To Use

Refer to screenshot in the spoiler :

[Show/Hide] How to set +/- rate

This is for note field in STATES TAB


The list for -/+ rate :
QUOTE
EVA+[#] = The state that contains this note will increase evasion by #% when inflicted
EVA-[#] = The state that contains this note will decrease evasion by #% when inflicted
HIT+[#] = The state that contains this note will increase hit rate by #% when inflicted
HIT-[#] = The state that contains this note will decrease hit rate by #% when inflicted
CRI+[#] = The state that contains this note will increase critical by #% when inflicted
CRI-[#] = The state that contains this note will decrease critical by #% when inflicted



Compatibility

Compatible with every script out there(hopefully) since I create new methods for this script and aliased 3 method that rarely used.


Screenshot


None smile.gif


DEMO



Click on the image above to download the demo. I only created this for the sake of proving that this script works smile.gif

Installation

Copy and paste in a new script page below material section but above main.


FAQ


Terms and Conditions

Credit & use.

Special Thanks

Craze for requesting this script.

Aindra for decreasing evasion feature

cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
Aindra
post Jun 26 2008, 12:38 PM
Post #2


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed




Thank you for this script.

I was wondering how do I change the evasion in the state. A question: Can you lower the evasion, instead of increasing it?

This post has been edited by Aindra: Jun 26 2008, 12:39 PM
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 27 2008, 03:35 AM
Post #3


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




That will need some edit in this script. I'll add that in the next version of this script. Great suggestion btw smile.gif

cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 27 2008, 09:34 AM
Post #4


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Updated to version 1.5


- Added feature to decrease evasion. Thanks to Aindra for the suggestion.

cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
Mr_E_Man
post Jun 27 2008, 05:14 PM
Post #5


Level 8
Group Icon

Group: Revolutionary
Posts: 124
Type: Event Designer
RM Skill: Skilled




This is a feature that was in RMXP and was sadly missing in VX. Good job.


__________________________
We exist within all things and all things exist within us... it's very crowded.
Go to the top of the page
 
+Quote Post
   
BizarreMonkey
post Jul 23 2008, 05:22 AM
Post #6


Gone and never coming back.
Group Icon

Group: Revolutionary
Posts: 112
Type: Developer
RM Skill: Undisclosed




This is a great Script, especially for some moves like...

Reflex

Fly

Web

Those are FF style Abilities

I might just have to use this, I'll credit you and Aindra of course yes.gif

Thanks Puppeto

This post has been edited by BizarreMonkey: Jul 23 2008, 05:26 AM


__________________________

Go to the top of the page
 
+Quote Post
   
Warder
post Jul 23 2008, 06:43 AM
Post #7


Level 31
Group Icon

Group: Revolutionary
Posts: 750
Type: None
RM Skill: Undisclosed




This is a pretty cool idea. I can definitely use this. Thanks for making it. smile.gif
Go to the top of the page
 
+Quote Post
   
RuGeaR1277
post Jul 26 2008, 06:29 AM
Post #8


Level 12
Group Icon

Group: Revolutionary
Posts: 213
Type: None
RM Skill: Beginner




how about accuracy and critical? can u make something similar to this? thanks!


__________________________
(ALL TEMPORARY PAUSED)

Current Project


Last Updated on 27th Oct


Click to check it out! ^_^

Go to the top of the page
 
+Quote Post
   
Tewi Inaba
post Jul 27 2008, 03:01 PM
Post #9


Level 2
Group Icon

Group: Member
Posts: 27
Type: Developer
RM Skill: Beginner




A critical hit booster would be awesome~

This script has a lot of use to me aleady, evasion skills are fun.


__________________________
Go to the top of the page
 
+Quote Post
   
YanXie
post Jul 27 2008, 07:29 PM
Post #10


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




that wouldn't be hard at all since I've got the base from this script. But don't expect anything yet since I will only get 2 weeks off starting 7 august sad.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
RuGeaR1277
post Jul 27 2008, 09:02 PM
Post #11


Level 12
Group Icon

Group: Revolutionary
Posts: 213
Type: None
RM Skill: Beginner




owh... okies... i think i'll just wait for it... happy.gif hope it wont take long...


__________________________
(ALL TEMPORARY PAUSED)

Current Project


Last Updated on 27th Oct


Click to check it out! ^_^

Go to the top of the page
 
+Quote Post
   
YanXie
post Aug 18 2008, 02:27 PM
Post #12


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Updated to version 2.0


New feature : Added states that can alter hit rate/critcal rate when inflicted

Sorry for the delay, to busy with my assignment smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
Mr. Bubble
post Aug 18 2008, 02:47 PM
Post #13


If I see one more Face Maker avatar...
Group Icon

Group: Revolutionary
Posts: 599
Type: Developer
RM Skill: Intermediate




QUOTE (YanXie @ Aug 18 2008, 02:49 PM) *
New feature : Added states that can alter hit rate/critcal rate when inflicted

Sorry for the delay, to busy with my assignment smile.gif


Woohoo! \o/

Good luck with your studies. smile.gif
Go to the top of the page
 
+Quote Post
   
Rukaroa
post Aug 19 2008, 08:07 PM
Post #14


Level 4
Group Icon

Group: Member
Posts: 52
Type: Event Designer
RM Skill: Beginner




Awesome~

Just to be clear, does the script add values as integers or as percentages?


__________________________
Go to the top of the page
 
+Quote Post
   
YanXie
post Aug 20 2008, 03:01 AM
Post #15


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




From what I experienced while testing the script... it works more as interger than percentages..

See... when I make default value of evasion is above 90... then increase it by 100, it takes 2 time evasion reduce(by 100) to make the actor really vulnurable to attack smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
RuGeaR1277
post Aug 20 2008, 08:58 PM
Post #16


Level 12
Group Icon

Group: Revolutionary
Posts: 213
Type: None
RM Skill: Beginner




yay! finally! =)
great job, YanXie!
oh, and good luck your studies!


__________________________
(ALL TEMPORARY PAUSED)

Current Project


Last Updated on 27th Oct


Click to check it out! ^_^

Go to the top of the page
 
+Quote Post
   
Rukaroa
post Aug 21 2008, 01:32 PM
Post #17


Level 4
Group Icon

Group: Member
Posts: 52
Type: Event Designer
RM Skill: Beginner




QUOTE (YanXie @ Aug 20 2008, 05:23 AM) *
From what I experienced while testing the script... it works more as interger than percentages..

See... when I make default value of evasion is above 90... then increase it by 100, it takes 2 time evasion reduce(by 100) to make the actor really vulnurable to attack smile.gif


Gotcha, thanks =3


__________________________
Go to the top of the page
 
+Quote Post
   
Rukaroa
post Sep 27 2008, 11:36 AM
Post #18


Level 4
Group Icon

Group: Member
Posts: 52
Type: Event Designer
RM Skill: Beginner




Sorry for double posting and I know it's been a while, but the script seems to have conflicts with KGC's Passive Skills. If put above Passive Skills, stats (ATK, DEF, etc) added by passive skills are not added to the base values. If put under Passive Skills, it works, but then the Eva+ script doesn't seem to function.


__________________________
Go to the top of the page
 
+Quote Post
   
Craze
post Sep 27 2008, 08:15 PM
Post #19


Level 8
Group Icon

Group: Revolutionary
Posts: 119
Type: Developer
RM Skill: Advanced




This script should perform if put underneath the passive skills script... that's how I have it set up (EDIT: I have it under KGC_PassiveSkill), and the aliases should make it all work properly. I don't believe I've edited KGC_PassiveSkill or this script and everything seems to flow, so....

I'll do a debugging tomorrow morning and edit this post with the results to see if the scripts really do play together properly.

EDIT:
Okay, so I had the game print out a character's CRI whenever they attacked. One actor had 20 CRI (increased with a passive skill), then I had them use a CRI+ skill, and they had 39 CRI from there on out. It seems that my HIT/EVA/CRI+ script is above KGC_PassiveSkill. The only issue is that the state was supposed to increase CRI by 25, not 19. =D

It works... just not really.

This post has been edited by Craze: Sep 28 2008, 04:41 AM


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 12:59 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker