The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: cozziekuns on May 31, 2010, 12:10:14 AM

Title: Critical Bonus States
Post by: cozziekuns on May 31, 2010, 12:10:14 AM
Critical Bonus States
Version: 1.0
Author: cozziekuns
Date: May 30, 2010

Version History



Planned Future Versions


Description


Gives states the ability to imbue critical bonuses on the one inflicted with the status effect. Somewhat like Sharp Eyes in Maplestory, except critical damage isn't altered (Twas was not meant to be anyways).
 
Features


Instructions

See header.

Script


Code: [Select]
#===============================================================================

# Cozziekuns Critical Bonus State (Hawkeye)
# Last Date Updated: 5/30/2010
#
# Gives states the ability to imbue critical bonuses on the one inflicted with
# the status effect. Somewhat like Sharp Eyes in Maplestory, except critical
# damage isn't altered (Sadly).
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 05/30/10 - Created Script.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o Nothing! Suggest something.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# To give a state the added effect of Critical Bonus, simply write in the note:
#
# \hawkeye[What percent you want to be added to the regular critical]
#
# For example, if I wanted an actor's critical to be boosted by 50%, I would
# put:
#
# \hawkeye[50]
#===============================================================================

$imported = {} if $imported == nil
$imported["CozCritBonusStates"] = true

#==============================================================================
# ** RPG::State
#------------------------------------------------------------------------------
#  This is a superclass of all states in the game.
#==============================================================================

class RPG::State
  #--------------------------------------------------------------------------
  # * Hawkeye chance
  #--------------------------------------------------------------------------
  def hawkeye
    @hawkeye = 0
    if self.note[/\\hawkeye\[(\d+)]/i] != nil
      @hawkeye = $1.to_i
    end
    return @hawkeye
  end
end

#==============================================================================
# ** 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
  #--------------------------------------------------------------------------
  # * Get Critical Ratio
  #--------------------------------------------------------------------------
  alias coz_cbs_codeh_cri cri
  def cri
    n = coz_cbs_codeh_cri
    for state in states
      n += state.hawkeye
    end
    return n
  end
end

Credit



Thanks


Support


Just post below.

Known Compatibility Issues

None so far.

Demo


See attached.

Author's Notes


I'm running out of ideas (everything has already been scripted...)

Restrictions

:ccby:
Title: Re: Critical Bonus States
Post by: Cascading Dragon on May 31, 2010, 01:34:09 PM
Well if it wasn't for the fact that I use Melody, and therefore already have this ability, I would use this script. Its nice
Title: Re: Critical Bonus States
Post by: modern algebra on May 31, 2010, 03:10:21 PM
It is a nice idea. Good work cozziekuns!