查看: 1523|回复: 2

[已经过期] 来帮看看这脚本怎么用,按照说明的不成

[复制链接]
梦石
0
星屑
48
在线时间
2459 小时
注册时间
2011-12-18
回帖
1419
发表于 2012-4-14 08:40:33 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
  1. #==============================================================================
  2. # 仩 憰旛棑奼挘乮for VX乯
  3. #------------------------------------------------------------------------------
  4. # Version : 2_20120407
  5. # by 僒儕僒丒僞僀僋乕儞
  6. # http://www.tycoon812.com/rgss/
  7. #==============================================================================

  8. #==============================================================================
  9. # 仩 慺嵽僗僀僢僠
  10. #==============================================================================
  11. $rgsslab = {} if $rgsslab == nil
  12. $rgsslab["憰旛棑奼挘"] = true

  13. if $rgsslab["憰旛棑奼挘"]

  14. #==============================================================================
  15. # 仩 僇僗僞儅僀僘億僀儞僩
  16. #==============================================================================
  17. module RGSSLAB end
  18. module RGSSLAB::Equipment_Slots_Extension
  19.   #--------------------------------------------------------------------------
  20.   # 仜 怴偟偔捛壛偡傞憰旛晹埵柤
  21.   #    怴偟偄晹埵偺愝掕傪峴偄傑偡丅
  22.   #
  23.   #    0斣栚偐傜弴偵丄5丄6丄7乧偲娭楢晅偗傜傟傑偡丅
  24.   #
  25.   #    枖丄憰旛夋柺偵偍偄偰丄晹埵柤徧傕
  26.   #    偙偙偱婰弎偟偨暥帤楍偑巊傢傟傑偡丅
  27.   #--------------------------------------------------------------------------
  28.   APPEND_ARMOR_PART = [
  29.    "腰带", # 晹埵斣崋5 : 帹
  30.    "手套", # 晹埵斣崋6 : 懌
  31.    "鞋子", # 晹埵斣崋7 : 榬
  32.    "戒指", # 晹埵斣崋8 : 榬
  33.    "项链", # 晹埵斣崋9 : 榬
  34.    "星尘", # 晹埵斣崋10 : 榬
  35.   ]
  36.   #--------------------------------------------------------------------------
  37.   # 仜 憰旛晹埵偺暥帤楍愝掕
  38.   #    杊嬶偺儊儌棑偵偍偄偰丄婰弎偡傞暥帤楍傪巜掕偟傑偡丅
  39.   #
  40.   #    儊儌棑偵丄[ + ARMOR_PART_NOTE偺抣 + 晹埵斣崋 +] 偲婰弎偟偰
  41.   #    憰旛晹埵傪曄峏偟傑偡丅
  42.   #    乮晹埵埲奜偺愝掕偼丄偦偺傑傑堷偒宲偑傟傑偡乯
  43.   #
  44.   #    椺丗
  45.   #    ARMOR_PART_NOTE偺抣偑"晹埵斣崋丗"偱丄晹埵斣崋偑5偺応崌
  46.   #    [晹埵斣崋丗5] 偲婰弎偟傑偡丅
  47.   #--------------------------------------------------------------------------
  48.   ARMOR_PART_NOTE = "晹埵斣崋丗"
  49.   #--------------------------------------------------------------------------
  50.   # 仜 憰旛棑偺攝楍愝掕
  51.   #    傾僋僞乕枅偵憰旛晹埵傪巜掕偟傑偡丅
  52.   #
  53.   #    丒婰弎曽朄
  54.   #     傾僋僞乕ID => [俀斣栚偺晹埵, 乧],
  55.   #    乮嵟屻偺愝掕偺傒丄屻傠偺僇儞儅傪徣棯偡傞帠偑偱偒傑偡乯
  56.   #
  57.   #    丒晹埵斣崋偵偮偄偰
  58.   #    1     : 弬
  59.   #    2     : 摢
  60.   #    3     : 恎懱
  61.   #    4     : 憰忺昳
  62.   #    5埲崀 : 偙偺慺嵽偱掕媊偟偨晹埵斣崋偵懳墳
  63.   #--------------------------------------------------------------------------
  64.   EQUIP_SLOTS_ARRAY = {
  65.    1 => [1, 2, 3, 5, 6, 7, 8,9,10],
  66.   }
  67.   #--------------------------------------------------------------------------
  68.   # 仜 擇搧棳帪偺憰旛柍岠壔愝掕
  69.   #    擇搧棳偺傾僋僞乕偺傒塭嬁傪庴偗傞愝掕偱偡丅
  70.   #
  71.   #    丒婰弎曽朄
  72.   #     傾僋僞乕ID => 柍岠偵偟偨偄EQUIP_SLOTS_ARRAY偺揧帤斣崋,
  73.   #    乮嵟屻偺愝掕偺傒丄屻傠偺僇儞儅傪徣棯偡傞帠偑偱偒傑偡乯
  74.   #
  75.   #    忋婰偵彂偐傟偰偄側偄傾僋僞乕偼丄忢偵0斣栚偲偟偰愝掕偝傟傑偡丅
  76.   #--------------------------------------------------------------------------
  77.   TWO_SWORD_STYLE_SETTING = {
  78.    1 => 0,
  79.   }
  80.   #--------------------------------------------------------------------------
  81.   # 仜 媡庤敾掕
  82.   #    媡庤乮庡偵椉庤帩偪堘斀偺嵺偵敾掕偝傟傞帪偵巊梡乯偺愝掕傪峴偄傑偡丅
  83.   #
  84.   #    丒婰弎曽朄
  85.   #     傾僋僞乕ID => 媡庤偲偟偰敾掕偝偣偨偄EQUIP_SLOTS_ARRAY偺揧帤斣崋,
  86.   #    乮嵟屻偺愝掕偺傒丄屻傠偺僇儞儅傪徣棯偡傞帠偑偱偒傑偡乯
  87.   #
  88.   #    忋婰偵彂偐傟偰偄側偄傾僋僞乕偼丄忢偵1斣栚偲偟偰愝掕偝傟傑偡丅
  89.   #--------------------------------------------------------------------------
  90.   TWO_HANDS_LEGAL = {
  91.    1 => 1,
  92.   }
  93.   #--------------------------------------------------------------------------
  94.   # 仜 弶婜憰旛偺愝掕
  95.   #    EQUIP_SLOTS_ARRAY偺娭學忋丄僨乕僞儀乕僗偱偺愝掕偱偼
  96.   #    崌抳偟側偄応崌傕偁傞忋偵丄捛壛偟偨晹埵傑偱斀塮偝傟傑偣傫丅
  97.   #
  98.   #    偦偙偱丄偙偺慺嵽偵傛傞愝掕偱弶婜憰旛傪峴偄偨偄傾僋僞乕偺傒
  99.   #    INITIALIZE_EQUIP偵愝掕偡傞帠偱丄夝寛偝偣傑偡丅
  100.   #   乮婰弎偝傟偰偄側偄傾僋僞乕偼丄僨乕僞儀乕僗偺弶婜憰旛偑峴傢傟傑偡乯
  101.   #
  102.   #    丒婰弎曽朄
  103.   #    傾僋僞乕ID => [晹埵撪梕],
  104.   #    乮嵟屻偺愝掕偺傒丄屻傠偺僇儞儅傪徣棯偡傞帠偑偱偒傑偡乯
  105.   #
  106.   #    晹埵撪梕偵偮偄偰偼
  107.   #    晲婍亄擇搧棳偺傾僋僞乕帪偺晲婍亄EQUIP_SLOTS_ARRAY偺攝楍偲偟偰
  108.   #    愝掕偡傞昁梫偑偁傝傑偡丅
  109.   #    乮擇搧棳傾僋僞乕偱側偄応崌偼丄擇搧棳偺傾僋僞乕帪偺晲婍偼徣偒傑偡乯
  110.   #--------------------------------------------------------------------------
  111.   INITIALIZE_EQUIP = {

  112.   }
  113. end

  114. # 僇僗僞儅僀僘億僀儞僩偼丄偙偙傑偱

  115. #==============================================================================
  116. # 仩 RGSSLAB::Equipment_Slots_Extension [module]
  117. #==============================================================================
  118. module RGSSLAB::Equipment_Slots_Extension
  119.   #--------------------------------------------------------------------------
  120.   # 仜 慺嵽愝掕梡偺掕悢掕媊
  121.   #--------------------------------------------------------------------------
  122.   MATERIAL_NAME = "憰旛棑奼挘"
  123.   VERSION       = 2
  124.   RELEASE       = 20120407
  125. end

  126. #==============================================================================
  127. # 仭 Game_Actor [class]
  128. #==============================================================================
  129. class Game_Actor < Game_Battler
  130.   #--------------------------------------------------------------------------
  131.   # 仜 儌僕儏乕儖偺愝掕
  132.   #--------------------------------------------------------------------------
  133.   RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  134.   #--------------------------------------------------------------------------
  135.   # 仠 岞奐僀儞僗僞儞僗曄悢
  136.   #--------------------------------------------------------------------------
  137.   attr_accessor :equip_array
  138.   attr_reader   :equip_slots
  139.   #--------------------------------------------------------------------------
  140.   # 仠 僙僢僩傾僢僾 [僄僀儕傾僗]
  141.   #--------------------------------------------------------------------------
  142.   alias equipment_slots_extension_setup setup
  143.   def setup(actor_id)
  144.     equipment_slots_extension_setup(actor_id)
  145.     setup_equipment_slots_extension
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # 仜 憰旛棑奼挘偺僙僢僩傾僢僾 [僾儔僀儀乕僩]
  149.   #--------------------------------------------------------------------------
  150.   def setup_equipment_slots_extension
  151.     setup_equip_slots
  152.     setup_equip_array
  153.     cancellation_equipment
  154.     setup_update_auto_state_process if $rgsslab["僆乕僩僗僥乕僩幚憰"]
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # 仜 憰旛偺柍岠壔 [僾儔僀儀乕僩]
  158.   #--------------------------------------------------------------------------
  159.   def cancellation_equipment
  160.     @weapon_id = 0
  161.     @armor1_id = 0
  162.     @armor2_id = 0
  163.     @armor3_id = 0
  164.     @armor4_id = 0
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # 仜 憰旛棑偺攝楍偺僙僢僩傾僢僾 [僾儔僀儀乕僩]
  168.   #--------------------------------------------------------------------------
  169.   def setup_equip_slots
  170.     if RGSSLAB_039::EQUIP_SLOTS_ARRAY[@actor_id]
  171.       @equip_slots = [0]
  172.       RGSSLAB_039::EQUIP_SLOTS_ARRAY[@actor_id].each {|i|
  173.         @equip_slots.push(i) if slots_check(i)
  174.       }
  175.     else
  176.       @equip_slots = [0, 1, 2, 3, 4]
  177.     end
  178.     if self.two_swords_style
  179.       @equip_slots.delete_at(RGSSLAB_039::TWO_SWORD_STYLE_SETTING[@actor_id] + 1) if RGSSLAB_039::TWO_SWORD_STYLE_SETTING[@actor_id]
  180.       @equip_slots.insert(1, 0)
  181.     end
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # 仜 憰旛晹埵偺僠僃僢僋 [僾儔僀儀乕僩]
  185.   #     slot_id : 晹埵斣崋
  186.   #--------------------------------------------------------------------------
  187.   def slots_check(slot_id)
  188.     return true if slot_id <= 4 && slot_id > 0
  189.     return true if RGSSLAB_039::APPEND_ARMOR_PART[slot_id - 5]
  190.     return false
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # 仜 憰旛攝楍偺僙僢僩傾僢僾 [僾儔僀儀乕僩]
  194.   #--------------------------------------------------------------------------
  195.   def setup_equip_array
  196.     @equip_array = []
  197.     if RGSSLAB_039::INITIALIZE_EQUIP[@actor_id]
  198.       @equip_slots.each_index {|i|
  199.         @equip_array.push(RGSSLAB_039::INITIALIZE_EQUIP[@actor_id][i])
  200.       }
  201.     else
  202.       @equip_slots.each {|i|
  203.         case i
  204.         when 0 ; @equip_array.push(@weapon_id)
  205.         when 1 ; @equip_array.push(@armor1_id)
  206.         when 2 ; @equip_array.push(@armor2_id)
  207.         when 3 ; @equip_array.push(@armor3_id)
  208.         when 4 ; @equip_array.push(@armor4_id)
  209.         else   ; @equip_array.push(0)
  210.         end
  211.       }
  212.     end
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # 仜 傾僋僙僗惂尷偺愝掕
  216.   #--------------------------------------------------------------------------
  217.   private :setup_equipment_slots_extension
  218.   private :cancellation_equipment
  219.   private :setup_equip_slots
  220.   private :slots_check
  221.   private :setup_equip_array
  222.   #--------------------------------------------------------------------------
  223.   # 仠 晲婍僆僽僕僃僋僩偺攝楍庢摼 [嵞峔抸]
  224.   #--------------------------------------------------------------------------
  225.   def weapons
  226.     result = []
  227.     return result if @equip_array == nil
  228.     unless two_swords_style
  229.       result.push($data_weapons[@equip_array[0]])
  230.     else
  231.       @equip_slots.each_with_index {|i, s|
  232.         result.push($data_weapons[@equip_array[s]]) if i == 0
  233.       }
  234.     end
  235.     return result
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # 仠 杊嬶僆僽僕僃僋僩偺攝楍庢摼 [嵞峔抸]
  239.   #--------------------------------------------------------------------------
  240.   def armors
  241.     result = []
  242.     return result if @equip_array == nil
  243.     @equip_slots.each_with_index {|i, s|
  244.       result.push($data_armors[@equip_array[s]]) unless i == 0
  245.     }
  246.     return result
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # 仠 憰旛僆僽僕僃僋僩偺攝楍庢摼 [嵞峔抸]
  250.   #--------------------------------------------------------------------------
  251.   def equips
  252.     result = []
  253.     @equip_slots.each_with_index {|i, s|
  254.       if i == 0
  255.         result.push($data_weapons[@equip_array[s]])
  256.       else
  257.         result.push($data_armors[@equip_array[s]])
  258.       end
  259.     }
  260.     return result
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # 仠 憰旛偺曄峏丗僆僽僕僃僋僩偱巜掕 [嵞峔抸]
  264.   #     equip_type : 棑偺埵抲
  265.   #     item       : 晲婍乛杊嬶 (nil 側傜憰旛夝彍)
  266.   #     test       : 僥僗僩僼儔僌 (愴摤僥僗僩丄傑偨偼憰旛夋柺偱偺堦帪憰旛)
  267.   #--------------------------------------------------------------------------
  268.   def change_equip(equip_type, item, test = false)
  269.     last_item = equips[equip_type]
  270.     unless test
  271.       return if $game_party.item_number(item) == 0 if item != nil
  272.       $game_party.gain_item(last_item, 1)
  273.       $game_party.lose_item(item, 1)
  274.     end
  275.     item_id = item == nil ? 0 : item.id
  276.     @equip_array[equip_type] = item_id
  277.     case equip_type
  278.     when 0                     ; change_equip(two_hands_index_check, nil, test) unless two_hands_legal?
  279.     when two_hands_index_check ; change_equip(0, nil, test)                     unless two_hands_legal?
  280.     end
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # 仜 媡庤敾掕
  284.   #--------------------------------------------------------------------------
  285.   def two_hands_index_check
  286.     if RGSSLAB_039::TWO_HANDS_LEGAL[@actor_id]
  287.       return RGSSLAB_039::TWO_HANDS_LEGAL[@actor_id]
  288.     else
  289.       return 1
  290.     end
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # 仠 憰旛偺攋婞 [嵞峔抸]
  294.   #     item : 攋婞偡傞晲婍乛杊嬶
  295.   #--------------------------------------------------------------------------
  296.   def discard_equip(item)
  297.     @equip_array.each_index do |index|
  298.       @equip_array[index] = 0 if index == item.id
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # 仠 椉庤憰旛崌朄敾掕 [嵞峔抸]
  303.   #--------------------------------------------------------------------------
  304.   def two_hands_legal?
  305.     if weapons[0] != nil and weapons[0].two_handed
  306.       return false if @equip_array[two_hands_index_check] != 0
  307.     end
  308.     if weapons[1] != nil and weapons[1].two_handed
  309.       return false if @equip_array[0] != 0
  310.     end
  311.     return true
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # 仠 怑嬈 ID 偺曄峏 [嵞峔抸]
  315.   #     class_id : 怴偟偄怑嬈 ID
  316.   #--------------------------------------------------------------------------
  317.   def class_id=(class_id)
  318.     @class_id = class_id
  319.     @equip_array.each_index do |index|
  320.       change_equip(index, nil) unless equippable?(equips[index])
  321.     end
  322.   end
  323. end

  324. #==============================================================================
  325. # 仭 Window_Equip [class]
  326. #==============================================================================
  327. class Window_Equip < Window_Selectable
  328.   #--------------------------------------------------------------------------
  329.   # 仜 儌僕儏乕儖偺愝掕
  330.   #--------------------------------------------------------------------------
  331.   RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  332.   #--------------------------------------------------------------------------
  333.   # 仠 僆僽僕僃僋僩弶婜壔 [嵞峔抸]
  334.   #     x     : 僂傿儞僪僂偺 X 嵗昗
  335.   #     y     : 僂傿儞僪僂偺 Y 嵗昗
  336.   #     actor : 傾僋僞乕
  337.   #--------------------------------------------------------------------------
  338.   def initialize(x, y, actor)
  339.     super(x, y, 336, WLH * 5 + 32)
  340.     self.contents.dispose
  341.     self.contents = Bitmap.new(width - 32, (actor.equip_slots.size * WLH))
  342.     @actor = actor
  343.     refresh
  344.     self.index = 0
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # 仠 儕僼儗僢僔儏 [嵞峔抸]
  348.   #--------------------------------------------------------------------------
  349.   def refresh
  350.     self.contents.clear
  351.     @data = []
  352.     for item in @actor.equips do @data.push(item) end
  353.     @item_max = @data.size
  354.     @data.each_index do |index|
  355.       self.contents.font.color = system_color
  356.       self.contents.draw_text(4, WLH * index, 92, WLH, slot_name(@actor.equip_slots[index]))
  357.       draw_item_name(@data[index], 92, WLH * index)
  358.     end
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # 仜 憰旛僗儘僢僩偺柤慜傪庢摼
  362.   #     index : 晹埵斣崋
  363.   #--------------------------------------------------------------------------
  364.   def slot_name(index)
  365.     a = $data_system.terms
  366.     array = [a.weapon, a.armor1, a.armor2, a.armor3, a.armor4]
  367.     for i in 0...RGSSLAB_039::APPEND_ARMOR_PART.size do array.push(RGSSLAB_039::APPEND_ARMOR_PART[i]) end
  368.     array[1] = a.weapon if @actor.two_swords_style
  369.     return @actor ? array[index] : ""
  370.   end
  371. end

  372. #==============================================================================
  373. # 仭 Scene_Equip [class]
  374. #==============================================================================
  375. class Scene_Equip < Scene_Base
  376.   #--------------------------------------------------------------------------
  377.   # 仜 儌僕儏乕儖偺愝掕
  378.   #--------------------------------------------------------------------------
  379.   RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  380.   #--------------------------------------------------------------------------
  381.   # 仠 傾僀僥儉僂傿儞僪僂偺嶌惉 [嵞掕媊]
  382.   #--------------------------------------------------------------------------
  383.   def create_item_windows
  384.     equip_size = EQUIP_TYPE_MAX
  385.     ax         = 0
  386.     ay         = 0
  387.     if $rgsslab["憰旛棑奼挘"]
  388.       equip_size = @actor.equip_slots.size
  389.     end
  390.     if $rgsslab["XP夋柺僒僀僘"]
  391.       ax         = 48
  392.       ay         = 32
  393.     end
  394.     @item_windows = []
  395.     for i in 0...equip_size
  396.       if $rgsslab["憰旛棑奼挘"]
  397.         @item_windows[i]           = Window_EquipItem.new(0 + ax, 208 + ay, 544, 208, @actor, @actor.equip_slots[i])
  398.       else
  399.         @item_windows[i]           = Window_EquipItem.new(0 + ax, 208 + ay, 544, 208, i)
  400.       end
  401.       @item_windows[i].help_window = @help_window
  402.       @item_windows[i].visible     = (@equip_index == i)
  403.       @item_windows[i].y           = 208 + ay
  404.       @item_windows[i].height      = 208
  405.       @item_windows[i].active      = false
  406.       @item_windows[i].index       = -1
  407.     end
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # 仠 傾僀僥儉僂傿儞僪僂偺峏怴 [嵞峔抸]
  411.   #--------------------------------------------------------------------------
  412.   def update_item_windows
  413.     for i in 0...@actor.equip_slots.size
  414.       @item_windows[i].visible = (@equip_window.index == i)
  415.       @item_windows[i].update
  416.     end
  417.     @item_window = @item_windows[@equip_window.index]
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # 仠 僗僥乕僞僗僂傿儞僪僂偺峏怴 [嵞峔抸]
  421.   #--------------------------------------------------------------------------
  422.   def update_status_window
  423.     if @equip_window.active
  424.       @status_window.set_new_parameters(nil, nil, nil, nil)
  425.     elsif @item_window.active
  426.       temp_actor = @actor.dup
  427.       temp_array = @actor.equip_array.dup
  428.       temp_actor.change_equip(@actor.equip_slots[@equip_window.index], @item_window.item, true)
  429.       @actor.equip_array = temp_array
  430.       new_atk = temp_actor.atk
  431.       new_def = temp_actor.def
  432.       new_spi = temp_actor.spi
  433.       new_agi = temp_actor.agi
  434.       @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
  435.     end
  436.     @status_window.update
  437.   end
  438. end

  439. #==============================================================================
  440. # 仭 Scene_Title [class]
  441. #==============================================================================
  442. class Scene_Title
  443.   #--------------------------------------------------------------------------
  444.   # 仜 儌僕儏乕儖偺愝掕
  445.   #--------------------------------------------------------------------------
  446.   RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  447.   #--------------------------------------------------------------------------
  448.   # 仠 奐巒張棟 [僄僀儕傾僗]
  449.   #--------------------------------------------------------------------------
  450.   alias equips_extension_start start
  451.   def start
  452.     equips_extension_start
  453.     setting
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # 仠 愴摤僥僗僩 [嵞掕媊]
  457.   #--------------------------------------------------------------------------
  458.   def battle_test
  459.     load_bt_database
  460.     create_game_objects
  461.     setting
  462.     Graphics.frame_count = 0
  463.     $game_party.setup_battle_test_members
  464.     if $rgsslab["愴摤僥僗僩奼挘"] && $BTEST
  465.       $scene = Scene_BattleTest_Setting.new
  466.     else
  467.       $scene = Scene_Battle.new
  468.     end
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # 仜 憰旛晹埵偺曄峏
  472.   #--------------------------------------------------------------------------
  473.   def setting
  474.     for i in 1...$data_armors.size
  475.       if $data_armors[i].note[/\[#{RGSSLAB_039::ARMOR_PART_NOTE}(\d+)\]/]
  476.         $data_armors[i].kind = $data_armors[i].note[/\[#{RGSSLAB_039::ARMOR_PART_NOTE}(\d+)\]/].scan(/(\d+)/)[0][0].to_i - 1
  477.       end
  478.     end
  479.   end
  480. end

  481. end
复制代码
唔  装备扩展的
这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
梦石
0
星屑
60
在线时间
156 小时
注册时间
2011-12-13
回帖
127
发表于 2012-4-14 19:24:36 | 显示全部楼层
本帖最后由 dant 于 2012-4-14 19:28 编辑

围观一堆乱码
[pre lang="ruby" line="1"]#==============================================================================
# □ 装備欄拡張(for VX)
#------------------------------------------------------------------------------
# Version : 2_20120407
# by サリサ・タイクーン
# http://www.tycoon812.com/rgss/
#==============================================================================

#==============================================================================
# □ 素材スイッチ
#==============================================================================
$rgsslab = {} if $rgsslab == nil
$rgsslab["装備欄拡張"] = true

if $rgsslab["装備欄拡張"]

#==============================================================================
# □ カスタマイズポイント
#==============================================================================
module RGSSLAB end
module RGSSLAB::Equipment_Slots_Extension
  #--------------------------------------------------------------------------
  # ○ 新しく追加する装備部位名
  #    新しい部位の設定を行います。
  #
  #    0番目から順に、5、6、7…と関連付けられます。
  #
  #    又、装備画面において、部位名称も
  #    ここで記述した文字列が使われます。
  #--------------------------------------------------------------------------
  APPEND_ARMOR_PART = [
   "腰带", # 部位番号5 : 耳
   "手套", # 部位番号6 : 足
   "鞋子", # 部位番号7 : 腕
   "戒指", # 部位番号8 : 腕
   "项链", # 部位番号9 : 腕
   "星尘", # 部位番号10 : 腕
  ]
  #--------------------------------------------------------------------------
  # ○ 装備部位の文字列設定
  #    防具のメモ欄において、記述する文字列を指定します。
  #
  #    メモ欄に、[ + ARMOR_PART_NOTEの値 + 部位番号 +] と記述して
  #    装備部位を変更します。
  #    (部位以外の設定は、そのまま引き継がれます)
  #
  #    例:
  #    ARMOR_PART_NOTEの値が"部位番号:"で、部位番号が5の場合
  #    [部位番号:5] と記述します。
  #--------------------------------------------------------------------------
  ARMOR_PART_NOTE = "部位番号:"
  #--------------------------------------------------------------------------
  # ○ 装備欄の配列設定
  #    アクター毎に装備部位を指定します。
  #
  #    ・記述方法
  #     アクターID => [2番目の部位, …],
  #    (最後の設定のみ、後ろのカンマを省略する事ができます)
  #
  #    ・部位番号について
  #    1     : 盾
  #    2     : 頭
  #    3     : 身体
  #    4     : 装飾品
  #    5以降 : この素材で定義した部位番号に対応
  #--------------------------------------------------------------------------
  EQUIP_SLOTS_ARRAY = {
   1 => [1, 2, 3, 5, 6, 7, 8,9,10],
  }
  #--------------------------------------------------------------------------
  # ○ 二刀流時の装備無効化設定
  #    二刀流のアクターのみ影響を受ける設定です。
  #
  #    ・記述方法
  #     アクターID => 無効にしたいEQUIP_SLOTS_ARRAYの添字番号,
  #    (最後の設定のみ、後ろのカンマを省略する事ができます)
  #
  #    上記に書かれていないアクターは、常に0番目として設定されます。
  #--------------------------------------------------------------------------
  TWO_SWORD_STYLE_SETTING = {
   1 => 0,
  }
  #--------------------------------------------------------------------------
  # ○ 逆手判定
  #    逆手(主に両手持ち違反の際に判定される時に使用)の設定を行います。
  #
  #    ・記述方法
  #     アクターID => 逆手として判定させたいEQUIP_SLOTS_ARRAYの添字番号,
  #    (最後の設定のみ、後ろのカンマを省略する事ができます)
  #
  #    上記に書かれていないアクターは、常に1番目として設定されます。
  #--------------------------------------------------------------------------
  TWO_HANDS_LEGAL = {
   1 => 1,
  }
  #--------------------------------------------------------------------------
  # ○ 初期装備の設定
  #    EQUIP_SLOTS_ARRAYの関係上、データベースでの設定では
  #    合致しない場合もある上に、追加した部位まで反映されません。
  #
  #    そこで、この素材による設定で初期装備を行いたいアクターのみ
  #    INITIALIZE_EQUIPに設定する事で、解決させます。
  #   (記述されていないアクターは、データベースの初期装備が行われます)
  #
  #    ・記述方法
  #    アクターID => [部位内容],
  #    (最後の設定のみ、後ろのカンマを省略する事ができます)
  #
  #    部位内容については
  #    武器+二刀流のアクター時の武器+EQUIP_SLOTS_ARRAYの配列として
  #    設定する必要があります。
  #    (二刀流アクターでない場合は、二刀流のアクター時の武器は省きます)
  #--------------------------------------------------------------------------
  INITIALIZE_EQUIP = {

  }
end

# カスタマイズポイントは、ここまで

#==============================================================================
# □ RGSSLAB::Equipment_Slots_Extension [module]
#==============================================================================
module RGSSLAB::Equipment_Slots_Extension
  #--------------------------------------------------------------------------
  # ○ 素材設定用の定数定義
  #--------------------------------------------------------------------------
  MATERIAL_NAME = "装備欄拡張"
  VERSION       = 2
  RELEASE       = 20120407
end

#==============================================================================
# ■ Game_Actor [class]
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :equip_array
  attr_reader   :equip_slots
  #--------------------------------------------------------------------------
  # ● セットアップ [エイリアス]
  #--------------------------------------------------------------------------
  alias equipment_slots_extension_setup setup
  def setup(actor_id)
    equipment_slots_extension_setup(actor_id)
    setup_equipment_slots_extension
  end
  #--------------------------------------------------------------------------
  # ○ 装備欄拡張のセットアップ [プライベート]
  #--------------------------------------------------------------------------
  def setup_equipment_slots_extension
    setup_equip_slots
    setup_equip_array
    cancellation_equipment
    setup_update_auto_state_process if $rgsslab["オートステート実装"]
  end
  #--------------------------------------------------------------------------
  # ○ 装備の無効化 [プライベート]
  #--------------------------------------------------------------------------
  def cancellation_equipment
    @weapon_id = 0
    @armor1_id = 0
    @armor2_id = 0
    @armor3_id = 0
    @armor4_id = 0
  end
  #--------------------------------------------------------------------------
  # ○ 装備欄の配列のセットアップ [プライベート]
  #--------------------------------------------------------------------------
  def setup_equip_slots
    if RGSSLAB_039::EQUIP_SLOTS_ARRAY[@actor_id]
      @equip_slots = [0]
      RGSSLAB_039::EQUIP_SLOTS_ARRAY[@actor_id].each {|i|
        @equip_slots.push(i) if slots_check(i)
      }
    else
      @equip_slots = [0, 1, 2, 3, 4]
    end
    if self.two_swords_style
      @equip_slots.delete_at(RGSSLAB_039::TWO_SWORD_STYLE_SETTING[@actor_id] + 1) if RGSSLAB_039::TWO_SWORD_STYLE_SETTING[@actor_id]
      @equip_slots.insert(1, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 装備部位のチェック [プライベート]
  #     slot_id : 部位番号
  #--------------------------------------------------------------------------
  def slots_check(slot_id)
    return true if slot_id <= 4 && slot_id > 0
    return true if RGSSLAB_039::APPEND_ARMOR_PART[slot_id - 5]
    return false
  end
  #--------------------------------------------------------------------------
  # ○ 装備配列のセットアップ [プライベート]
  #--------------------------------------------------------------------------
  def setup_equip_array
    @equip_array = []
    if RGSSLAB_039::INITIALIZE_EQUIP[@actor_id]
      @equip_slots.each_index {|i|
        @equip_array.push(RGSSLAB_039::INITIALIZE_EQUIP[@actor_id])
      }
    else
      @equip_slots.each {|i|
        case i
        when 0 ; @equip_array.push(@weapon_id)
        when 1 ; @equip_array.push(@armor1_id)
        when 2 ; @equip_array.push(@armor2_id)
        when 3 ; @equip_array.push(@armor3_id)
        when 4 ; @equip_array.push(@armor4_id)
        else   ; @equip_array.push(0)
        end
      }
    end
  end
  #--------------------------------------------------------------------------
  # ○ アクセス制限の設定
  #--------------------------------------------------------------------------
  private :setup_equipment_slots_extension
  private :cancellation_equipment
  private :setup_equip_slots
  private :slots_check
  private :setup_equip_array
  #--------------------------------------------------------------------------
  # ● 武器オブジェクトの配列取得 [再構築]
  #--------------------------------------------------------------------------
  def weapons
    result = []
    return result if @equip_array == nil
    unless two_swords_style
      result.push($data_weapons[@equip_array[0]])
    else
      @equip_slots.each_with_index {|i, s|
        result.push($data_weapons[@equip_array]) if i == 0
      }
    end
    return result
  end
  #--------------------------------------------------------------------------
  # ● 防具オブジェクトの配列取得 [再構築]
  #--------------------------------------------------------------------------
  def armors
    result = []
    return result if @equip_array == nil
    @equip_slots.each_with_index {|i, s|
      result.push($data_armors[@equip_array]) unless i == 0
    }
    return result
  end
  #--------------------------------------------------------------------------
  # ● 装備オブジェクトの配列取得 [再構築]
  #--------------------------------------------------------------------------
  def equips
    result = []
    @equip_slots.each_with_index {|i, s|
      if i == 0
        result.push($data_weapons[@equip_array])
      else
        result.push($data_armors[@equip_array])
      end
    }
    return result
  end
  #--------------------------------------------------------------------------
  # ● 装備の変更:オブジェクトで指定 [再構築]
  #     equip_type : 欄の位置
  #     item       : 武器/防具 (nil なら装備解除)
  #     test       : テストフラグ (戦闘テスト、または装備画面での一時装備)
  #--------------------------------------------------------------------------
  def change_equip(equip_type, item, test = false)
    last_item = equips[equip_type]
    unless test
      return if $game_party.item_number(item) == 0 if item != nil
      $game_party.gain_item(last_item, 1)
      $game_party.lose_item(item, 1)
    end
    item_id = item == nil ? 0 : item.id
    @equip_array[equip_type] = item_id
    case equip_type
    when 0                     ; change_equip(two_hands_index_check, nil, test) unless two_hands_legal?
    when two_hands_index_check ; change_equip(0, nil, test)                     unless two_hands_legal?
    end
  end
  #--------------------------------------------------------------------------
  # ○ 逆手判定
  #--------------------------------------------------------------------------
  def two_hands_index_check
    if RGSSLAB_039::TWO_HANDS_LEGAL[@actor_id]
      return RGSSLAB_039::TWO_HANDS_LEGAL[@actor_id]
    else
      return 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 装備の破棄 [再構築]
  #     item : 破棄する武器/防具
  #--------------------------------------------------------------------------
  def discard_equip(item)
    @equip_array.each_index do |index|
      @equip_array[index] = 0 if index == item.id
    end
  end
  #--------------------------------------------------------------------------
  # ● 両手装備合法判定 [再構築]
  #--------------------------------------------------------------------------
  def two_hands_legal?
    if weapons[0] != nil and weapons[0].two_handed
      return false if @equip_array[two_hands_index_check] != 0
    end
    if weapons[1] != nil and weapons[1].two_handed
      return false if @equip_array[0] != 0
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● 職業 ID の変更 [再構築]
  #     class_id : 新しい職業 ID
  #--------------------------------------------------------------------------
  def class_id=(class_id)
    @class_id = class_id
    @equip_array.each_index do |index|
      change_equip(index, nil) unless equippable?(equips[index])
    end
  end
end

#==============================================================================
# ■ Window_Equip [class]
#==============================================================================
class Window_Equip < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化 [再構築]
  #     x     : ウィンドウの X 座標
  #     y     : ウィンドウの Y 座標
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(x, y, actor)
    super(x, y, 336, WLH * 5 + 32)
    self.contents.dispose
    self.contents = Bitmap.new(width - 32, (actor.equip_slots.size * WLH))
    @actor = actor
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ [再構築]
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @data = []
    for item in @actor.equips do @data.push(item) end
    @item_max = @data.size
    @data.each_index do |index|
      self.contents.font.color = system_color
      self.contents.draw_text(4, WLH * index, 92, WLH, slot_name(@actor.equip_slots[index]))
      draw_item_name(@data[index], 92, WLH * index)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 装備スロットの名前を取得
  #     index : 部位番号
  #--------------------------------------------------------------------------
  def slot_name(index)
    a = $data_system.terms
    array = [a.weapon, a.armor1, a.armor2, a.armor3, a.armor4]
    for i in 0...RGSSLAB_039::APPEND_ARMOR_PART.size do array.push(RGSSLAB_039::APPEND_ARMOR_PART) end
    array[1] = a.weapon if @actor.two_swords_style
    return @actor ? array[index] : ""
  end
end

#==============================================================================
# ■ Scene_Equip [class]
#==============================================================================
class Scene_Equip < Scene_Base
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  #--------------------------------------------------------------------------
  # ● アイテムウィンドウの作成 [再定義]
  #--------------------------------------------------------------------------
  def create_item_windows
    equip_size = EQUIP_TYPE_MAX
    ax         = 0
    ay         = 0
    if $rgsslab["装備欄拡張"]
      equip_size = @actor.equip_slots.size
    end
    if $rgsslab["XP画面サイズ"]
      ax         = 48
      ay         = 32
    end
    @item_windows = []
    for i in 0...equip_size
      if $rgsslab["装備欄拡張"]
        @item_windows           = Window_EquipItem.new(0 + ax, 208 + ay, 544, 208, @actor, @actor.equip_slots)
      else
        @item_windows           = Window_EquipItem.new(0 + ax, 208 + ay, 544, 208, i)
      end
      @item_windows.help_window = @help_window
      @item_windows.visible     = (@equip_index == i)
      @item_windows.y           = 208 + ay
      @item_windows.height      = 208
      @item_windows.active      = false
      @item_windows.index       = -1
    end
  end
  #--------------------------------------------------------------------------
  # ● アイテムウィンドウの更新 [再構築]
  #--------------------------------------------------------------------------
  def update_item_windows
    for i in 0...@actor.equip_slots.size
      @item_windows.visible = (@equip_window.index == i)
      @item_windows.update
    end
    @item_window = @item_windows[@equip_window.index]
  end
  #--------------------------------------------------------------------------
  # ● ステータスウィンドウの更新 [再構築]
  #--------------------------------------------------------------------------
  def update_status_window
    if @equip_window.active
      @status_window.set_new_parameters(nil, nil, nil, nil)
    elsif @item_window.active
      temp_actor = @actor.dup
      temp_array = @actor.equip_array.dup
      temp_actor.change_equip(@actor.equip_slots[@equip_window.index], @item_window.item, true)
      @actor.equip_array = temp_array
      new_atk = temp_actor.atk
      new_def = temp_actor.def
      new_spi = temp_actor.spi
      new_agi = temp_actor.agi
      @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
    end
    @status_window.update
  end
end

#==============================================================================
# ■ Scene_Title [class]
#==============================================================================
class Scene_Title
  #--------------------------------------------------------------------------
  # ○ モジュールの設定
  #--------------------------------------------------------------------------
  RGSSLAB_039 = RGSSLAB::Equipment_Slots_Extension
  #--------------------------------------------------------------------------
  # ● 開始処理 [エイリアス]
  #--------------------------------------------------------------------------
  alias equips_extension_start start
  def start
    equips_extension_start
    setting
  end
  #--------------------------------------------------------------------------
  # ● 戦闘テスト [再定義]
  #--------------------------------------------------------------------------
  def battle_test
    load_bt_database
    create_game_objects
    setting
    Graphics.frame_count = 0
    $game_party.setup_battle_test_members
    if $rgsslab["戦闘テスト拡張"] && $BTEST
      $scene = Scene_BattleTest_Setting.new
    else
      $scene = Scene_Battle.new
    end
  end
  #--------------------------------------------------------------------------
  # ○ 装備部位の変更
  #--------------------------------------------------------------------------
  def setting
    for i in 1...$data_armors.size
      if $data_armors.note[/\[#{RGSSLAB_039::ARMOR_PART_NOTE}(\d+)\]/]
        $data_armors.kind = $data_armors.note[/\[#{RGSSLAB_039::ARMOR_PART_NOTE}(\d+)\]/].scan(/(\d+)/)[0][0].to_i - 1
      end
    end
  end
end

end
[/pre]
回复

使用道具 举报

Fuzzy Ginkgo

梦石
0
星屑
61105
在线时间
1933 小时
注册时间
2010-6-26
回帖
1535

烫烫烫开拓者

发表于 2012-4-14 20:00:15 来自手机 | 显示全部楼层
shift jis.....
僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕僕

其实都是gb2312里的单人旁汉字不是很有趣么。
我的言论只代表我个人的观点,不代表雇主及/或任何第三方的立场。
Opinions expressed are solely my own and do not express the views or opinions of my employer and/or any third parties.
捐赠 | GitHub
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部