Kitsune's Extra Statistics
#1
Kitsune's Extra Statistics
Version 2.2



Introduction
This script is a model to allow a game designer quickly add leveling actor and non-leveling enemy statistics such as Strength, Dexterity and the like. These stats must apply to both player and enemy as they are a part of the battler class.




Script
Code:
#==============================================================================
# ** Kitsune's Extra Statistics
#------------------------------------------------------------------------------
#    by DerVVulfman
#    version 2.2
#    07-20-2020 (MM/DD/YYYY)
#    RGSS / RPGMaker XP
#==============================================================================
#
#  INTRODUCTION:
#
#  This script is a model to allow  a game designer quickly add leveling actor
#  and non-leveling enemy statistics such as Strength, Desterity and the like.
#  These stats  must apply to both player  and enemy as they are a part of the
#  battler class.
#
#  This model is configured to display two basic statistics of CHAR and CONST,
#  or  Charisma and Constitution.   These stats  acting  like most others that
#  go from 0 - 999 in your game.  And it is also set up  to include  an action
#  based statistic of FTG or Fatigue.  This stat, like HP and SP,  is one that
#  may increase and decrease often during combat,  affected by most conditions
#  other than the gear worn by the player.
#
#  This is a mere model,  and is meant to show how you can add these two types
#  of statistics into your game.  However,  it does NOT show you  how to apply
#  these new statistics into the combat engine or other systems as these stats
#  are yours to use to customize your game.
#
#  This script is a model.  It is up to you to apply it as you see fit.
#
#------------------------------------------------------------------------------
#
#  REGARDING STATISTICS AND THEIR FUNCTIONS IN-GAME
#
#  This system  does not apply any statistic  towards any function or activity
#  within the game.  Though the script itself has  (as an example)  a Charisma
#  statistic, it does not affect a player's ability to charm NPCs ro get lower
#  prices within a shop.  This is something that is the sole responcibility of
#  the end user.   All this system does is creates the values that you can use
#  towards that end.
#
#  Ex:
#    # If C button was pressed
#    if Input.trigger?(Input::C)
#      # Get item
#      @item = @buy_window.item
#      # Obtain a new price based on the party leader's charisma
#      new_price = @item.price - (15-$game_party.actors[0].char).abs
#      # If item is invalid, or NEW price is higher than money possessed
#      if @item == nil or new_price > $game_party.gold
#      --- and etcetera ---
#
#------------------------------------------------------------------------------
#
#  NOTED AREAS TO CHANGE IN-SCRIPT
#
#  Within Game_Battler...
#
#  You would change the initialize method  to create value/variables  for your
#  new game statistics.  In this version, there are @char_plus and @const_plus
#  values for use with the new Charisma and Constitution statistics the script
#  is creating.  It also includes @fatigue, @fatigue_plus and @maxfatigue_plus
#  for the action stat known as Fatigue.
#
#  As stated, there are two types of statistics:  basic and action.
#
#  Each basic statistics have two methods within Game_Battler, one that allows
#  you to retrieve stat data,  and one that allows the stat to change.  Within
#  this demo, you will find four such methods;  the char and char= methods for
#  the charisma stat, and the const and const= methods for Constitution.
#
#  However, the action statistic has three different methods for each statis-
#  tic.  And within this demo,  the methods are maxfatigue, maxfatigue=,  and
#  fatigue=, these to work with and create the Fatigue statistic.
#
#  Of these methods,  they are set to read from the XTRA_STATS_RATE constant,
#  and apply extra points to each stat.  You have   XTRA_STATS_RATE[i][0] and
#  XTRA_STATS_RATE[i][1] for the charisma  and constitution values. And there
#  is the XTRA_STATS_RATE[i][2] array meant for the Fatigue value.  Also note
#  that each reads their own plus values that are defined within the initiali-
#  zation method.
#
#  It should be noted that each action statistic also has a defined instance
#  value set for reading purposes within  Game_Battler  as noted beneath the
#  Public Instance Variables comment.
#
#
#                              - - - - - - - - -
#
#  Within Game_Actor...
#  You will need to change  the setup method  to include  a set  of statements
#  that adds your new statistics  to each actor in your database.   Almost the
#  same, each creates an array for their respective statistic,  calls upon the
#  XTRA_STATS_ACTOR constant(reading the proper data from it for its stat) and
#  then generates data for their array & sets their plus data to 0 by default.
#
#  However,  the action statistic,  this being the Fatigue statiistic,  has an
#  additional value being set to its maximum value at the actor's start.
#
#  Each basic statitstic  has a single method,  one that retrieves the actor's
#  current stat value at the actor's current level. In this instance, they are
#  the base_char and base_const values.
#
#  Meanwhile, each action statistic has three methods each, two to handle the
#  maximum value  for the action stat (with and without status effects),  and
#  one to retrieve the actor's current statistics after being affected by the
#  loss of points.
#
#
#                              - - - - - - - - -
#
#  Within Game_Enemy...
#
#  All you DO is add new methods,  one for each statistic  and given  the same
#  names as those 'base_' methods in Game_Actor.   They follow the same basic
#  setup and returns data garnered from the XTRA_STATS_ENEMY constant if any.
#
#                              - - - - - - - - -
#
#  Within the WINDOWS...
#  
#  Within the Window_Base class in this script,  I made my own version of the
#  draw_actor_parameter method,  though I could have just as easily rewritten
#  the original.  This method draws the name of the statistics, garnering the
#  data from the XTRA_STATS_WORDS constant,  and then obtaining data from the
#  actor.char or like commands. I also added a new draw_actor_fatigue method,
#  it bringing up both current and max values for the fatigue statistic.
#
#  Within the Window_EquipLeft command,  I changed the refresh method  so it
#  drew from my newly created draw_actor_parameter_2 method so it display the
#  name and data from my two respective statistics. Even after that, it would
#  test the new value of the data  and draw one of those '=>' arrows  if there
#  was any change to the statistics. And the set_new_parameters found within
#  Window_EquipLeft was changed to accomodate the system having two different
#  statistics to read and test.
#
#  A revised Window_Status was altered solely to show off the Fatigue stat.
#
#  Lastly, the Scene_Equip needed its refresh method changed so it can change
#  and set the actor's new statistics.  
#
#
#==============================================================================
#
#  CREDITS AND THANKS
#
#  Thanks to LilyKnight who initially requested this script a while ago, and
#  to Chaucer who noticed that one couldn't alter the new stats in-game like
#  one could the default. Also, thanks to Bennerdeben who prompted me to re-
#  examine this old script.
#
#==============================================================================
#
#  TERMS OF USE:
#
#  If you don't know the drill after reading all my other scripts, here goes.
#  Free to use, even in commercial projects.  Bowever, due credit to myself
#  and those whom I've given credit is required.
#  
#
#==============================================================================



  # Statistic names
  # =============================================================
  # This holds the abbreviated names of your new statistics.
  #
    XTRA_STATS_WORDS = ["CHAR", "CONST" , "FTG"]
    
    
  # Actor States
  # =============================================================
  # This adds the new statistics to each of your actors.
  # By default, the actor's new statistics are set to 1 so any
  # actor not covered in this array will have 1 for that stat.
  #
  # FORMULA:  actor_id => [ stat_array_1, stat_array_2, ... ]
  #           where stat arrays are [start, increment]
  #
  # Described below.  Actor #1's char stat starts at 10, a const at 12,and
  #                   a Fatigue score at 695.
  #                   Actor #2's char stat starts at 20 a const at 24, and
  #                   a Fatigue score at 496.
  #                   Both have a 2pt grade for char and a 3pt grade for const
  #                   But Actor 1's fatigue gains at 35 while actor 2's at 45.
  #
  #
    XTRA_STATS_ACTOR = {1 => [[10, 2], [12, 3], [695,35]  ],
                        2 => [[20, 2], [24, 3], [486,45] ] }  
    

  # Enemy States
  # =============================================================
  # This adds the new statistics to each of your enemies.
  # By default, the enemy's new statistics are set to 1 so any
  # enemy not covered in this array will have 1 for that stat.
  #
  # Described below.  Enemy #1's char is at 15, const at 21, and fatigue at 99
  #                   Enemy #2's char is at 22, const at 44, and fatigue at 999
  #                   Enemies have no grade as they don't level
  #
    XTRA_STATS_ENEMY = {1 => [15, 21, 99],
                        2 => [22, 44, 999] }  
  
                        
  # Weapon State Bonuses
  # =============================================================
  # This adds the new stat bonuses to each of your weapons.
  # By default, the weapon's new bonus stats are set to 0 so any
  # weapon not covered in this array will have 0 for that stat.
  #
  # The FATIGUE score does not gain bonuses in this way given how
  # it is coded. If it did, there would be a 3rd param to each array
  #
  # If a fourth stat was created, a placeholder value for Fatigue
  # would be required within each array.
  #
  # Described below.  Weapon #1 gives a +1 bonus to char and +2 to const scores
  #                   Weapon #2 gives a +2 bonus to char and +4 to const scores
  #
    XTRA_STATS_WEAPS = {1 => [1,2],
                        2 => [2,4] }  

                        
  # Armor State Bonuses
  # =============================================================
  # This adds the new stat bonuses to each of your armor pieces.
  # By default, the armor's new bonus stats are set to 0 so any
  # armor not covered in this array will have 0 for that stat.
  #
  # The FATIGUE score does not gain bonuses in this way given how
  # it is coded. If it did, there would be a 3rd param to each array
  #
  # If a fourth stat was created, a placeholder value for Fatigue
  # would be required within each array.
  #
  # Described below.  Armor #1 gives a +1 bonus to char and +2 to const scores
  #                   Armor #2 gives a +2 bonus to char and +4 to const scores
  #
    XTRA_STATS_ARMOR = {1 => [1,2],
                        2 => [2,4] }  
                        
  
  # State Effect Statistic Adjustment
  # =============================================================
  # This adds the new stat bonuses to each of your state effects.
  # By default, the state effect's new stats are set to 0 so any
  # state not covered in this array will have '0' for that stat.
  # However, you will want a base 100 stat for each attribute.
  #
  # Described below:  Each of the 16 basic status effects in the default system
  #                   with normal 100% ratings for each of the two new stats.
  #                   The exceptions are that status 2 (Stun) is set to 75% for
  #                   the charisma stat and a 60% rate for the 3rd stat (Venom)
  #
    XTRA_STATS_RATE  = {1   => [100,100,100],
                        2   => [ 75,100,100],
                        3   => [100, 60,100],
                        4   => [100,100,100],
                        5   => [100,100,100],
                        6   => [100,100,100],
                        7   => [100,100,100],
                        8   => [100,100,100],
                        9   => [100,100,100],
                        10  => [100,100,100],
                        11  => [100,100,100],
                        12  => [100,100,100],
                        13  => [100,100,100],
                        14  => [100,100,100],
                        15  => [100,100,100],
                        16  => [100,100,100] }  
                        
                        
                        
  
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :fatigue                  # Fatigue
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias stats_init initialize
  def initialize
    stats_init
    @char_plus        = 0
    @const_plus       = 0
    @fatigue          = 0
    @fatigue_plus     = 0
    @maxfatigue_plus  = 0
  end  
  #--------------------------------------------------------------------------
  # * Get Charisma (char)
  #--------------------------------------------------------------------------
  def char
    n = [[base_char + @char_plus, 1].max, 999].min
    for i in @states
      n *= XTRA_STATS_RATE[i][0] / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end  
  #--------------------------------------------------------------------------
  # * Get Constitution (const)
  #--------------------------------------------------------------------------
  def const
    n = [[base_const + @const_plus, 1].max, 999].min
    for i in @states
      n *= XTRA_STATS_RATE[i][1] / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Maximum Fatigue (FTG)
  #--------------------------------------------------------------------------
  def maxfatigue
    n = [[base_fatigue + @maxfatigue_plus, 1].max, 999999].min
    for i in @states
      n *= XTRA_STATS_RATE[i][2] / 100.0
    end
    n = [[Integer(n), 1].max, 999999].min
    return n
  end  
  #--------------------------------------------------------------------------
  # * Set Charisma (CHAR)
  #     char : new Charisma (CHAR)
  #--------------------------------------------------------------------------
  def char=(char)
    @char_plus += char - self.char
    @char_plus = [[@char_plus, -999].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Set Constitution (CON)
  #     const : new Constitution (CON)
  #--------------------------------------------------------------------------
  def const=(const)
    @const_plus += const - self.const
    @const_plus = [[@const_plus, -999].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Set Maximum Fatigue (FTG)
  #     maxfatigue : new maximum FTG
  #--------------------------------------------------------------------------
  def maxfatigue=(maxfatigue)
    @maxfatigue_plus += maxfatigue - self.maxfatigue
    @maxfatigue_plus = [[@maxfatigue_plus, -9999].max, 9999].min
    @fatigue = [@fatigue, self.maxfatigue].min
  end  
  #--------------------------------------------------------------------------
  # * Change Fatigue
  #     fatigue : new Fatigue
  #--------------------------------------------------------------------------
  def fatigue=(fatigue)
    @fatigue = [[fatigue, maxfatigue].min, 0].max
  end
  #--------------------------------------------------------------------------
  # * Calculate Stat Gain Per Level (NOT A CURVE!)
  #     array : array
  #--------------------------------------------------------------------------
  def make_stat_rank_list(array)
    stat_rank_list  = Array.new(101)
    stat_rank_list[1] = array[0].to_i
    for i in 2..100
      stat_rank_list[i] = stat_rank_list[i-1] + array[1].to_i
    end
    return stat_rank_list
  end  
end



#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  alias stat_setup setup
  def setup(actor_id)
    # The original call
    stat_setup(actor_id)
    # Create the charisma stat
      @char_array = []
      array = [0,0]
      array = XTRA_STATS_ACTOR[actor_id][0] if XTRA_STATS_ACTOR[actor_id] != nil
      @char_array = make_stat_rank_list(array)
      @char_plus  = 0
    # Create the constitution stat
      @const_array = []
      array = [0,0]
      array = XTRA_STATS_ACTOR[actor_id][1] if XTRA_STATS_ACTOR[actor_id] != nil
      @const_array = make_stat_rank_list(array)
      @const_plus  = 0
    # Create the fatigue stat
      @fatigue_array = []
      array = [0,0]
      array = XTRA_STATS_ACTOR[actor_id][2] if XTRA_STATS_ACTOR[actor_id] != nil
      @fatigue_array = make_stat_rank_list(array)
      @maxfatigue_plus = 0
    # Set up fatigue
      @fatigue = maxfatigue
  end
  #--------------------------------------------------------------------------
  # * Get Basic Charisma
  #--------------------------------------------------------------------------
  def base_char
    return 0 if @char_array == nil
    n = @char_array[@level+1]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? base_acquire_stat(XTRA_STATS_WEAPS, @weapon_id, 0) : 0
    n += armor1 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor1_id, 0) : 0
    n += armor2 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor2_id, 0) : 0
    n += armor3 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor3_id, 0) : 0
    n += armor4 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor4_id, 0) : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Constitution
  #--------------------------------------------------------------------------
  def base_const
    return 0 if @const_array == nil
    n = @const_array[@level+1]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? base_acquire_stat(XTRA_STATS_WEAPS, @weapon_id, 1) : 0
    n += armor1 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor1_id, 1) : 0
    n += armor2 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor2_id, 1) : 0
    n += armor3 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor3_id, 1) : 0
    n += armor4 != nil ? base_acquire_stat(XTRA_STATS_ARMOR, @armor4_id, 1) : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Maximum Fatigue (Ftg)
  #--------------------------------------------------------------------------
  def maxfatigue
    n = [[base_maxfatigue + @maxfatigue_plus, 1].max, 9999].min
    for i in @states
      n *= XTRA_STATS_RATE[i][2] / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum Fatigue
  #--------------------------------------------------------------------------
  def base_maxfatigue
    return 0 if @fatigue_array == nil
    n = @fatigue_array[@level+1]
    return [[n, 1].max, 9999].min
  end  
  #--------------------------------------------------------------------------
  # * Get Basic Fatigue
  #--------------------------------------------------------------------------
  def base_fatigue
    return 0 if @const_array == nil
    n = @const_array[@level+1]
    return [[n, 1].max, 9999].min
  end  
  #--------------------------------------------------------------------------
  # * Get Stat
  #   Constant Value : Value passed
  #   equip_ID : ID of the equipment
  #   type : what new stat is being accessed
  #--------------------------------------------------------------------------  
  def base_acquire_stat(constant_value, equip_id, type)
    temp = 0
    temp = constant_value[equip_id][type] if constant_value[equip_id] != nil
    return temp    
  end
end



#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#  This class handles enemies. It's used within the Game_Troop class
#  ($game_troop).
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Basic Charisma
  #--------------------------------------------------------------------------
  def base_char
    n = 0
    n = XTRA_STATS_ENEMY[@enemy_id][0] if XTRA_STATS_ENEMY[@enemy_id] != nil
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Constitution
  #--------------------------------------------------------------------------
  def base_const
    n = 0
    n = XTRA_STATS_ENEMY[@enemy_id][1] if XTRA_STATS_ENEMY[@enemy_id] != nil
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Fatigue
  #--------------------------------------------------------------------------
  def base_fatigue
    n = 0
    n = XTRA_STATS_ENEMY[@enemy_id][2] if XTRA_STATS_ENEMY[@enemy_id] != nil
    return [[n, 1].max, 99999].min
  end  
end


#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Parameter #2
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #--------------------------------------------------------------------------
  def draw_actor_parameter_2(actor, x, y, type)
    parameter_name = ""
    parameter_name = XTRA_STATS_WORDS[type] if XTRA_STATS_WORDS[type] != nil
    parameter_value = 0
    case type
    when 0 ; parameter_value = actor.char
    when 1 ; parameter_value = actor.const
    when 2 ; parameter_value = actor.fatigue
    end
    parameter_value = 0 if parameter_value == nil
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw FTG
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_ftg(actor, x, y, width = 144)
    # Draw "SP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32,  XTRA_STATS_WORDS[2])
    # Calculate if there is draw space for MaxHP
    if width - 32 >= 108
      ftg_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      ftg_x = x + width - 48
      flag = false
    end
    # Draw SP
    self.contents.font.color = actor.fatigue == 0 ? knockout_color :
      actor.fatigue <= actor.maxfatigue / 4 ? crisis_color : normal_color
    self.contents.draw_text(ftg_x, y, 48, 32, actor.fatigue.to_s, 2)
    # Draw MaxSP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(ftg_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(ftg_x + 60, y, 48, 32, actor.maxfatigue.to_s)
    end
  end  
end


#==============================================================================
# ** Window_EquipLeft
#------------------------------------------------------------------------------
#  This window displays actor parameter changes on the equipment screen.
#==============================================================================

class Window_EquipLeft < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 32)
    
    # PLEASE NOTE:  This changes the attributes, but not the 'would-be'
    # attributes.  I did not continue further on this.  There are no
    # values of @new_char or @new_const to fiddle with
    
    # My change ----------------------------
    draw_actor_parameter_2(@actor, 4,  64, 0)
    draw_actor_parameter_2(@actor, 4,  96, 1)
    # END change ----------------------------
    
    draw_actor_parameter(@actor, 4, 128, 2)
    
    # My change ----------------------------
    if @new_char != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 64, 40, 32, "->", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 64, 36, 32, @new_char.to_s, 2)
    end
    if @new_const != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 96, 40, 32, "->", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 96, 36, 32, @new_const.to_s, 2)
    end
    
    # END change ----------------------------
    
    if @new_mdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 128, 40, 32, "->", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
    end
    
  end
  #--------------------------------------------------------------------------
  # * Set parameters after changing equipment
  #     new_atk  : attack power after changing equipment
  #     new_pdef : physical defense after changing equipment
  #     new_mdef : magic defense after changing equipment
  #--------------------------------------------------------------------------
  def set_new_parameters(new_char, new_const, new_mdef)
    if @new_char != new_char or @new_const != new_const or @new_mdef != new_mdef
      @new_char = new_char
      @new_const = new_const
      @new_mdef = new_mdef
      refresh
    end
  end
end



#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
#  This window displays full status specs on the status screen.
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    
    draw_actor_hp(@actor, 96, 108, 172)
    draw_actor_sp(@actor, 96, 132, 172)
    draw_actor_ftg(@actor, 96, 156, 172)
    #draw_actor_sp(@actor, 96, 144, 172)
    
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 48, 80, 32, "EXP")
    self.contents.draw_text(320, 80, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "equipment")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  end
end



#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Set item window to visible
    @item_window1.visible = (@right_window.index == 0)
    @item_window2.visible = (@right_window.index == 1)
    @item_window3.visible = (@right_window.index == 2)
    @item_window4.visible = (@right_window.index == 3)
    @item_window5.visible = (@right_window.index == 4)
    # Get currently equipped item
    item1 = @right_window.item
    # Set current item window to @item_window
    case @right_window.index
    when 0
      @item_window = @item_window1
    when 1
      @item_window = @item_window2
    when 2
      @item_window = @item_window3
    when 3
      @item_window = @item_window4
    when 4
      @item_window = @item_window5
    end
    # If right window is active
    if @right_window.active
      # Erase parameters for after equipment change
      @left_window.set_new_parameters(nil, nil, nil)
    end
    # If item window is active
    if @item_window.active
      # Get currently selected item
      item2 = @item_window.item
      # Change equipment
      last_hp = @actor.hp
      last_sp = @actor.sp
      @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
      
      # My change ----------------------------
      # Get parameters for after equipment change
      new_char = @actor.char
      new_const = @actor.const
      new_ftg = @actor.fatigue
      # END change ----------------------------
    
      # Return equipment
      @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
      @actor.hp = last_hp
      @actor.sp = last_sp
      
      # My change ----------------------------
      # Draw in left window
      @left_window.set_new_parameters(new_char, new_const, new_ftg)
      # END change ----------------------------
      
    end
  end
end



Instructions
Plenty. But it's all in the script, and there are areas you should pay careful attention to.



Credits and Thanks
Though not in the script uploaded right now, thanks to LilyKnight who initially requested this script a while ago, and to Chaucer who noticed that one couldn't alter the new stats in-game like one could the default. Also, thanks to Bennerdeben who prompted me to re-examine this old script.



Terms of Use
Due credit to both LilyKnight who initially requested the script from me, chaucer for feature testing. To Bennerdeben who rekindled my interest in the script... oh, and for myself of course.



Compatibility and Installation
Designed solely for RPGMaker XP
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#2
Oh man, this script looks super useful, even a knucklehead like me could utilize this ;D

In theory, you might be able to make some constants as shortcuts that will allow the developer to easily add the stats to the windows via specified coordinates. I digress, any scripter worth their salt is going to have to put in some elbow grease and manually apply it to whatever they deem necessary.

If I can get myself back into code-geek mode, I already have something in mind that should be using this, thanks mate!
[Image: Button-BOTB.png]
[Image: Save-Point.gif][Image: Button-You-Tube2.png][Image: Button-Sound-Cloud2.png][Image: Button-Audio-Mack2.png]
[Image: LS-Banner.gif]
NEW ALBUM OUT NOW!

Reply }
#3
Its a great script. Hope it helps a lot of people see to finished games.
Reply }
#4
can you maybe help me out with my job stat modifier and this script ?
http://save-point.org/Thread-xp-script-j...fier--4148
it would be very nice if they can work togehther ^^
Reply }
#5
Kitsune isn't very plug-and-play. Whoever uses it plans to create a whole new parameter that RMXP doesn't have in any part of the default scripts. For current scripts, it's not something that can be 'patched'.

However (and as an example), let's assume you have a constitution parameter (or Const), and you wish to add it along with Jobs. You have this in your JobStatModCFG module:

Code:
p_max = p_maxsp = p_str = p_dex = p_agi = p_int =
.... .... = 1.0
case id
add p_const and m_const values to this code

And then, with case blocks like this...
Code:
when 1 # ClassID[1] - Warrior
p_maxhp = 0
p_maxsp = 0
...... and etc[/code] It is here you would also add
Code:
m_int = 0.7
  p_const = 0
m_const = 1.2
... adding your static and dynamic multipliers.

Then, you add your
Code:
JobStatModCFG.job_stat_mod(@class...
in with the code you'd make for the Constitution parameters.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#6
thx again, VVulfamn very kindly !
i go try it.

EDIT: it works fine but with a lil bug,
class 1 have all stats at 1.0, class 2 have all stats at 2.0 (for testing purpose...)
the extra stats start at 12 and if i switch to class 2 they are 22, if i switch back to class 1 they are 11...
so they got a -1 somehow, strange thing !
i upload a demo this evening so maybe you can take a look at it...
thx alot
Reply }
#7
I have two common event that identifies various states ("naked" and "dressed", "barefoot" - "with shoes"). Whenever an armor or such is weared by a character, the state "dressed" appears, and "cures" the naked state. This worked very well with the other events and scripts, but with this script I receive an error every time that the new parameters are suposedly shown. ¿Any ideas?

(06-25-2012, 09:11 PM)Erechel Wrote: I have two common event that identifies various states ("naked" and "dressed", "barefoot" - "with shoes"). Whenever an armor or such is weared by a character, the state "dressed" appears, and "cures" the naked state. This worked very well with the other events and scripts, but with this script I receive an error every time that the new parameters are suposedly shown. ¿Any ideas?

Solved, it was the XTRA_STATS_RATE. The Default 0 doesn't work so good, so everytime that a non enlisted state was active, the Xtra Stats can't recognize it, and crash. Maybe another has the same problem,so I keeped posted
Reply }
#8
(05-16-2012, 06:49 AM)DerVVulfman Wrote: Kitsune isn't very plug-and-play. Whoever uses it plans to create a whole new parameter that RMXP doesn't have in any part of the default scripts. For current scripts, it's not something that can be 'patched'.

However (and as an example), let's assume you have a constitution parameter (or Const), and you wish to add it along with Jobs. You have this in your JobStatModCFG module:

Code:
p_max = p_maxsp = p_str = p_dex = p_agi = p_int =
.... .... = 1.0
case id
add p_const and m_const values to this code

And then, with case blocks like this...
Code:
when 1 # ClassID[1] - Warrior
p_maxhp = 0
p_maxsp = 0
...... and etc[/code] It is here you would also add
Code:
m_int = 0.7
  p_const = 0
m_const = 1.2
... adding your static and dynamic multipliers.

Then, you add your
Code:
JobStatModCFG.job_stat_mod(@class...
in with the code you'd make for the Constitution parameters.
Very cheery Now that i've solved the compatibility problems, how can I use it? Charisma could be very useful if i couldmanage to link it to a variable, but it isn't obvious or explained a way to do it. Same problem with the STAT_DISTRIBUTION_SYSTEM: I don't know how to assign the points to the new parameters. I know now how to display it in my game, because i can manage nicely the windows_ base, but not how to do something more or less useful without extensive script abilities.
Reply }
#9
That's the thing. This isn't plug n play, and is more useful to people crafting scripts. Charisma could be useful if you wanted to charm NPCs or get better deals from Shops. But that's up to a scripter to decide. For all intent and purposes, you could have 12 stats rather than 4. Tongue sticking out
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#10
Two years in coming... time for a
BUMP
to version 2.1
While the addition to the code is not extensive, it covers a feature for parameter stats that was accidentally overlooked. This feature is one that allows the game developer to add or subtract from a player's parameters. As such, you could add to a strength score with...
$game_party.actors[0].str += 3
... you couldn't previously do the same with the newer parameters until THIS change.

Let's give thanks to Chaucer for discovering this flaw and immediately PMing me about the issue.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Extra Gold XP & ACE kyonides 0 2,159 09-09-2021, 08:32 PM
Last Post: kyonides
   Extra ITEM for MOG Scene Item Laura DerVVulfman 0 5,206 06-29-2017, 03:44 AM
Last Post: DerVVulfman
   Extra Terrain Tags DerVVulfman 2 6,921 12-21-2014, 04:25 AM
Last Post: DerVVulfman
   Extra Autotiles DerVVulfman 0 4,679 04-13-2014, 04:07 AM
Last Post: DerVVulfman
   Yin's Extra Troops DerVVulfman 4 8,586 12-22-2011, 05:45 AM
Last Post: Yin



Users browsing this thread: 1 Guest(s)