sballance吧 关注:15贴子:769
  • 2回复贴,共1

【脚本】RGSS3的无节操脚本讨论……

只看楼主收藏回复

关于rgss3的具体脚本嘛……


IP属地:浙江1楼2013-02-20 11:52回复
    #==============================================================================# ■ Window_VictorySpoils#==============================================================================
    class Window_VictorySpoils < Window_ItemList #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, fitting_height(1), Graphics.width, window_height) self.z = 200 hide end #-------------------------------------------------------------------------- # window_height #-------------------------------------------------------------------------- def window_height return Graphics.height - fitting_height(4) - fitting_height(1) end #-------------------------------------------------------------------------- # spacing #-------------------------------------------------------------------------- def spacing; return 32; end #-------------------------------------------------------------------------- # make #-------------------------------------------------------------------------- def make(gold, drops) @gold = gold @drops = drops refresh select(0) activate end #-------------------------------------------------------------------------- # make_item_list #-------------------------------------------------------------------------- def make_item_list @data = [nil] items = {} weapons = {} armours = {} @goods = {} for item in @drops case item when RPG::Item items[item] = 0 if items[item].nil? items[item] += 1 when RPG::Weapon weapons[item] = 0 if weapons[item].nil? weapons[item] += 1 when RPG::Armor armours[item] = 0 if armours[item].nil? armours[item] += 1 end end items = items.sort { |a,b| a[0].id <=> b[0].id } weapons = weapons.sort { |a,b| a[0].id <=> b[0].id } armours = armours.sort { |a,b| a[0].id <=> b[0].id } for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end end #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] rect = item_rect(index) reset_font_settings if item.nil? draw_gold(rect) return end rect.width -= 4 draw_item_name(item, rect.x, rect.y, true, rect.width - 24) draw_item_number(rect, item) end #-------------------------------------------------------------------------- # draw_gold #-------------------------------------------------------------------------- def draw_gold(rect) text = Vocab.currency_unit draw_currency_value(@gold, text, rect.x, rect.y, rect.width) end #-------------------------------------------------------------------------- # draw_item_number #-------------------------------------------------------------------------- def draw_item_number(rect, item) number = @goods[item].group if $imported["YEA-AdjustLimits"] contents.font.size = YEA::LIMIT::ITEM_FONT text = sprintf(YEA::LIMIT::ITEM_PREFIX, number) draw_text(rect, text, 2) else draw_text(rect, sprintf(":%s", number), 2) end end end # Window_VictorySpoils


    IP属地:浙江2楼2013-02-20 11:52
    回复
      来来来,谁分析一下……


      IP属地:浙江3楼2013-02-20 11:52
      回复