#============================================================================== # # ▼ Yanfly Engine Ace - JP Manager v1.00 # -- Last Updated: 2012.01.07 # -- Level: Normal, Hard # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-JPManager"] = true #============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.01.07 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script provides a base for JP implementation. JP is a currency similar # to EXP that's gained through performing actions and leveling up in addition # to killing enemies. This script provides modifiers that adjust the gains for # JP through rates, individual gains per skill or item, and per enemy. Though # this script provides no usage of JP by itself, future Yanfly Engine Ace # scripts may make use of it. # #============================================================================== # ▼ 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. # # ----------------------------------------------------------------------------- # Actor Notetags - These notetags go in the actors notebox in the database. # ----------------------------------------------------------------------------- # # Changes the JP earned rate to x%. This affects JP earned and not JP directly # gained. If this notetag isn't used, the object will default to 100%. # # ----------------------------------------------------------------------------- # Class Notetags - These notetags go in the class notebox in the database. # ----------------------------------------------------------------------------- # # Changes the JP earned rate to x%. This affects JP earned and not JP directly # gained. If this notetag isn't used, the object will default to 100%. # # ----------------------------------------------------------------------------- # Skill Notetags - These notetags go in the skills notebox in the database. # ----------------------------------------------------------------------------- # # When the actor successfully hits an target with this action, the actor will # earn x JP. If this notetag isn't used, the amount of JP earned will equal to # the ACTION_JP constant in the module. # # ----------------------------------------------------------------------------- # Item Notetags - These notetags go in the items notebox in the database. # ----------------------------------------------------------------------------- # # When the actor successfully hits an target with this action, the actor will # earn x JP. If this notetag isn't used, the amount of JP earned will equal to # the ACTION_JP constant in the module. # # ----------------------------------------------------------------------------- # Weapon Notetags - These notetags go in the weapon notebox in the database. # ----------------------------------------------------------------------------- # # Changes the JP earned rate to x%. This affects JP earned and not JP directly # gained. If this notetag isn't used, the object will default to 100%. # # ----------------------------------------------------------------------------- # Armour Notetags - These notetags go in the armour notebox in the database. # ----------------------------------------------------------------------------- # # Changes the JP earned rate to x%. This affects JP earned and not JP directly # gained. If this notetag isn't used, the object will default to 100%. # # ----------------------------------------------------------------------------- # Enemy Notetags - These notetags go in the enemy notebox in the database. # ----------------------------------------------------------------------------- # # Changes the amount of JP gained for killing the enemy to x. If this notetag # isn't used, then the default JP gain will be equal to the amount set in the # module through the constant ENEMY_KILL. # # ----------------------------------------------------------------------------- # State Notetags - These notetags go in the states notebox in the database. # ----------------------------------------------------------------------------- # # Changes the JP earned rate to x%. This affects JP earned and not JP directly # gained. If this notetag isn't used, the object will default to 100%. # # ----------------------------------------------------------------------------- # Script Calls - These commands are used with script calls. # ----------------------------------------------------------------------------- # $game_actors[x].earn_jp(y) # $game_actors[x].earn_jp(y, z) # This will cause actor x to earn y amount of JP. JP earned will be modified by # any JP Rate traits provided through notetags. If z is used, z will be the # class the JP is earned for. # # $game_actors[x].gain_jp(y) # $game_actors[x].gain_jp(y, z) # This will cause actor x to gain y amount of JP. JP gained this way will not # be modified by any JP Rate traits provided through notetags. If z is used, # z will be the class the JP is gained for. # # $game_actors[x].lose_jp(y) # $game_actors[x].lose_jp(y, z) # This will cause actor x to lose y amount of JP. JP lost this way will not be # modified by any JP Rate traits provided through notetags. If z is used, z # will be the class the JP is lost from. # #============================================================================== # ▼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # # This script is compatible with Yanfly Engine Ace - Victory Aftermath v1.03+. # If you wish to have Victory Aftermath display JP gains, make sure the version # is 1.03+. Script placement of these two scripts don't matter. # #============================================================================== module YEA module JP #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - General JP Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This adjusts the way JP appears visually in your game. Change the icon # used and the vocabulary used here. Furthermore, adjust the maximum amount # of JP that an actor can have at a time. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ICON = 0 # Icon index used to represent JP. VOCAB = "JP" # What JP will be called in your game. MAX_JP = 99999999 # Maximum JP an actor can have. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Default JP Gain Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # The following constants adjust how much JP is earned by default through # enemy kills, leveling up, and performing actions. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ENEMY_KILL = 20 # JP earned for the whole party. LEVEL_UP = 100 # JP earned when leveling up! ACTION_JP = 5 # JP earned per successful hit. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Victory Message - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This adjusts the victory message shown for the default battle system and # the Yanfly Engine Ace - Victory Aftermath script (if used together). #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- VICTORY_MESSAGE = "%s has earned %s %s!" VICTORY_AFTERMATH = "+%s%s" end # JP end # YEA #============================================================================== # ▼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== module YEA module REGEXP module BASEITEM JP_RATE = /<(?:JP_RATE|jp rate):[ ](\d+)([%%])>/i end # BASEITEM module USABLEITEM JP_GAIN = /<(?:JP_GAIN|jp gain):[ ](\d+)>/i end # USABLEITEM module ENEMY JP_GAIN = /<(?:JP_GAIN|jp gain):[ ](\d+)>/i end # ENEMY end # REGEXP end # YEA #============================================================================== # ■ Vocab #============================================================================== module Vocab #-------------------------------------------------------------------------- # new method: self.jp #-------------------------------------------------------------------------- def self.jp return YEA::JP::VOCAB end end # Vocab #============================================================================== # ■ Icon #============================================================================== module Icon #-------------------------------------------------------------------------- # self.jp #-------------------------------------------------------------------------- def self.jp; return YEA::JP::ICON; end end # Icon #============================================================================== # ■ Numeric #============================================================================== class Numeric #-------------------------------------------------------------------------- # new method: group_digits #-------------------------------------------------------------------------- unless $imported["YEA-CoreEngine"] def group; return self.to_s; end end # $imported["YEA-CoreEngine"] end # Numeric #============================================================================== # ■ DataManager #============================================================================== module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class < 0 dw -= 24 if Icon.jp > 0 change_color(system_color) draw_text(dx, dy, dw, line_height, Vocab::jp, 2) dw -= text_size(Vocab::jp).width change_color(normal_color) draw_text(dx, dy, dw, line_height, actor.jp.group, 2) end #-------------------------------------------------------------------------- # new method: draw_actor_jp_class #-------------------------------------------------------------------------- def draw_actor_jp_class(actor, class_id, dx, dy, dw = 112) draw_icon(Icon.jp, dx + dw - 24, dy) if Icon.jp > 0 dw -= 24 if Icon.jp > 0 change_color(system_color) draw_text(dx, dy, dw, line_height, Vocab::jp, 2) dw -= text_size(Vocab::jp).width change_color(normal_color) draw_text(dx, dy, dw, line_height, actor.jp(class_id).group, 2) end end # Window_Base #============================================================================== # # ▼ End of File # #==============================================================================