#=========================================================================== # * KS's Equipment Description Auto-Generator # 2015.12.14, pulled_straight_outta_the_game_version (v1.1) #--------------------------------------------------------------------------- # IMPORTANT: If you would want to use this script, I suggest you wait # for me to release a 'friendlier' version (soon-ish). Unless, # of course, if you know rgss3, then by all means, go ahead! # # Also, this script generates for EQUIPMENT alone. I do have # two more generators for Items and Skills, but they're a bit # too unstable to showcase as of this moment... #--------------------------------------------------------------------------- # Desc: This snippet auto-generates equipment description by # displaying the equipment's Parameter and Element Rate changes # in it's help text. Currently, that is all that it does. It # does not display other features like Attack Element, Attack State, # Skills Learned, and etc., though theoretically it shouldn't be # too difficult to add. # # Actually, know what? It'd be faster if you just go see it in action. #--------------------------------------------------------------------------- # Note: As the stuff take up quite some space, I've made it so that only # the first line of the equipments' description would be displayed. #--------------------------------------------------------------------------- # To Use: Plug and Play! It's *very* unlikely that any script clashes with # this. At the least, I can guarantee that it works fine with # Yanfly's Equip Engine. #=========================================================================== class Window_Help < Window_Base def initialize(line_number = 2, scene = nil) super(0, 0, Graphics.width, fitting_height(line_number)) @scene = scene end def set_item(item) if !item set_text("") #equipment description auto-generator start elsif @scene == :equip # Param Names to be used pram = ['MHP', 'MMP', 'ATK', 'DEF', 'MAT', 'MDF', 'AGI', 'LUK', 'HIT', 'EVA', 'CRI'] # Element Names to be used (order of which follows as set in 'Terms') erat = ['PHY', 'ABS', 'FIR', 'ICE', 'ELE', 'WTR', 'NAT', 'WND', 'HLY', 'DRK'] # You may also use icons for either instead, using \I[iconIndex] #--------------------------------------------------------------------- # It's best if you not edit anything past here #--------------------------------------------------------------------- # Extract first line of item description text = [item.description.split('/r\n/')[0], '\C[0]', '\C[0]'] # Retrieve item's params array lise = item.params # Retrieve x-params: Hit Rate, Evasion, and Critical Hit Rate temp = item.features.select {|ft| ft.code == 22 && (ft.data_id == 0 || ft.data_id == 1 || ft.data_id == 2) } temp.each {|prm| lise += [(prm.value*100).to_i]} # Create string containing item's param and x-param changes lise.each_with_index do |dis, i| next if dis == 0 text[1] += sprintf((dis>0 ? '\C[0]%s\C[24]+%d ' : '\C[0]%s\C[25]%d '), pram[i], dis) end # Retrieve item's element rates array lise = item.features.select {|ft| ft.code == 11 } # Create string containing item's element rates lise.each_with_index do |dis, i| text[2] += sprintf((dis.value>1 ? '\C[0]%s\C[25]' : dis.value<1 ? '\C[0]%s\C[24]' : '\C[0]%s\C[5]') + 'x%1.1f ', erat[i], dis.value) end # Concatenate all generated strings and display set_text(text[0] + "\n" + text[1] + "\n" + text[2]) #equipment description auto-generator end else set_text(item.description) end end end class Scene_Equip < Scene_MenuBase # OVERWRITE: Scene_Equip's create_help_window method def create_help_window @help_window = Window_Help.new(3, :equip) @help_window.viewport = @viewport end end