기타

회피,명중,크리 스테이트를 작성하는 스크립트

by 카르와푸딩의아틀리에 posted Jun 30, 2009
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

회피 명중 크리를  +  - 시키는 스테이트를 작성하는 스크립트 입니다.

사용법은  스테이트란의 메모장에

EVA+[#]

EVA-[#]

이런식으로 위에 [#] 이부분의 #에 숫자를 넣어주시면됩니다.

EVA+[10]이렇게 메모하면 회피가 10이 상승하는 스테이트를 작성할수 있습니다.

 

 

#==============================================================================
# ** 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
#==============================================================================