#=============================================================================== # ** Parameters in Rank(grades) # # Author : Yeolde # # # ½ºÅÝÀÌ ·©Å©·Î Ç¥½ÃµË´Ï´Ù # Stats appear in grades. # Does not rewrite parameter system. # Compatible with Yanfly Status Menu (but probably not with equipment system) # # µ¤¾î ¾²´Â ¸Þ¼Òµå # Overwrites : # Window_EquipStatus draw_current_param # draw_new_param # Window_Base draw_actor_param # Window_StatusItem draw_actor_param # draw_general_parameters # #=============================================================================== module StatRank #=============================================================================== # Configuration #=============================================================================== # ÃÖ´ë ½ºÅÝ ¼öÄ¡(½Ã½ºÅÛ»ó/±âº»°ª:999) # ½ºÅ©¸³Æ®»ó ÃÖ´ë ½ºÅÝ ¼öÄ¡¿¡ º¯È­¸¦ ÁÖ¾ú´Ù¸é º¯°æÇÏ½Ã¸é µË´Ï´Ù. # StatMax = #number # Configure the max value of parameter. Default system has it limited on 999. # If you have made any changes to this through script, change this value. # Also, change this if you are planning to keep parameters in lower numbers. StatMax = 999 # ÀÚµ¿ÀûÀ¸·Î ·©Å©¸¦ °è»ê ÇÒÁö ¿©ºÎ(true/false). # ¼öµ¿À¸·Î ÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù. # DivideEql = true or false # Decide whether you want ranks to be calculated evenly. # If set true, param ranks are given by dividing StatMax by number of ranks. # If set false, you should configure RankValue. DivideEql = false # ¸Â´Â ·©Å©°¡ ¾øÀ» ½Ã Ç¥½Ã µÇ´Â ·©Å© (¹ö±× ´ëÃ¥). ½Å°æ¾²Áö ¾ÊÀ¸¼Åµµ ÁÁ½À´Ï´Ù. # If parameter is higher than StatMax, or go beyond the limit set in RankValue, # this kicks in to prevent nil error or infinite loop. NoMatch = "X" # Ç¥½Ã ÇÒ ·©Å© (³·Àº ¼ö ºÎÅÍ ³ôÀº ¼ö) # Ranks to display. Default is set to display D ~ SSS ranks. # You may put as many as you want. # Ranks are ordered in lower to higher value. RankArray = [ "D", # 1 "D+", # 2 "C", # 3 "C+", # 4 "B", # 5 "B+", # 6 "A", # 7 "A+", # 8 "S", # 9 "S+", # 10 "SS", # 11 "SS+", # 12 "SSS" # 13 ] # RankArray # ÀÚµ¿°è»êÀ» false·Î µÎ¾úÀ» ¶§ ¾Æ·¡ Ç׸ñÀ» ¼öÁ¤Çϼ¼¿ä. # ½ºÅÝÀÌ ¼³Á¤°ª°ú °°°Å³ª ³·À»½Ã RankArray¿¡ ÇØ´çÇÏ´Â ·©Å©°¡ Ç¥½Ã µË´Ï´Ù. # RankArray¿Í RankValueÀÇ ±æÀÌ´Â °°¾Æ¾ß ÇÕ´Ï´Ù. # # Change this if you do not wish to use automatic calculation. # Corresponding ranks in RankArray are displayed if parameter # is less than or equal to value in this array. # Number of item must match with RankArray. # Value must be ordered from lower to higher value. # # For example: # RankArray = ["D","C","B","A","S"] # RankValue = [ 1, 2, 3, 4, 5 ] # STR DEF MAT MDF # 3 2 1 5 # => B C D S # RankValue = [ 1, # 1 2, # 2 3, # 3 4, # 4 5, # 5 6, # 6 7, # 7 8, # 8 9, # 9 10, # 10 11, # 11 12, # 12 999 # 13 ] #RankValue #=============================================================================== # Script Body #=============================================================================== # Convert to rank def self.convertRank(stat_value) dividingNumber = StatMax / RankArray.length currentValue = 0 turnCount = 0 return NoMatch if stat_value > StatMax if DivideEql == true while currentValue <= StatMax do currentValue += dividingNumber return RankArray[turnCount] if stat_value <= currentValue turnCount += 1 end # while CV >= StatMax else # if DivideEql == false while currentValue <= StatMax do currentValue = RankValue[turnCount] return RankArray[turnCount] if stat_value <= currentValue turnCount += 1 return NoMatch if RankValue[turnCount].nil? end # while CV >= StatMax end # if DivideEql == true end # def convertRank end # module StatRank #=============================================================================== # Overwriting Scripts #=============================================================================== class Window_Base < Window def draw_actor_param(actor, x, y, param_id) change_color(system_color) draw_text(x, y, 120, line_height, Vocab::param(param_id)) change_color(normal_color) draw_text(x + 120, y, 36, line_height, StatRank::convertRank(actor.param(param_id))) end end # class Window_Base class Window_EquipStatus < Window_Base def draw_current_param(x, y, param_id) change_color(normal_color) draw_text(x, y, 48, line_height, StatRank::convertRank(@actor.param(param_id))) end def draw_new_param(x, y, param_id) new_value = @temp_actor.param(param_id) change_color(param_change_color(new_value - @actor.param(param_id))) draw_text(x, y, 48, line_height, StatRank::convertRank(new_value)) end end # class Window_EquiptStatus class Window_StatusItem < Window_Base def draw_actor_param(param_id, dx, dy, dw) colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(dx+1, dy+1, dw-2, line_height-2) contents.fill_rect(rect, colour) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id)) change_color(normal_color) draw_text(dx+4, dy, dw-8, line_height, StatRank::convertRank(@actor.param(param_id)), 2) end def draw_actor_param_HPMP(param_id, dx, dy, dw) colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(dx+1, dy+1, dw-2, line_height-2) contents.fill_rect(rect, colour) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id)) change_color(normal_color) draw_text(dx+4, dy, dw-8, line_height, @actor.param(param_id).group, 2) end def draw_general_parameters dx = 24 dy = line_height / 2 draw_actor_level(dx, line_height*1+dy, contents.width/2 - 24) draw_actor_param_HPMP(0, dx, line_height*2+dy, contents.width/2 - 24) draw_actor_param_HPMP(1, dx, line_height*3+dy, contents.width/2 - 24) draw_actor_param(2, dx, line_height*4+dy, contents.width/4 - 12) draw_actor_param(4, dx, line_height*5+dy, contents.width/4 - 12) draw_actor_param(6, dx, line_height*6+dy, contents.width/4 - 12) dx += contents.width/4 - 12 draw_actor_param(3, dx, line_height*4+dy, contents.width/4 - 12) draw_actor_param(5, dx, line_height*5+dy, contents.width/4 - 12) draw_actor_param(7, dx, line_height*6+dy, contents.width/4 - 12) end end # class Window_StatusItem