| 赞 | 1 |
| VIP | |
| 好人卡 | |
| 积分 | 0 |
| 经验 | |
| 最后登录 | 2016-1-9 |
| 在线时间 | 2459 小时 |
- 梦石
- 0
- 星屑
- 48
- 在线时间
- 2459 小时
- 注册时间
- 2011-12-18
- 回帖
- 1419
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
- #==============================================================================
- # 仩 憰旛棑奼挘乮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 => [俀斣栚偺晹埵, 乧],
- # 乮嵟屻偺愝掕偺傒丄屻傠偺僇儞儅傪徣棯偡傞帠偑偱偒傑偡乯
- #
- # 丒晹埵斣崋偵偮偄偰
- # 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][i])
- }
- 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[s]]) 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[s]]) 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[s]])
- else
- result.push($data_armors[@equip_array[s]])
- 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[i]) 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[i] = Window_EquipItem.new(0 + ax, 208 + ay, 544, 208, @actor, @actor.equip_slots[i])
- else
- @item_windows[i] = Window_EquipItem.new(0 + ax, 208 + ay, 544, 208, i)
- end
- @item_windows[i].help_window = @help_window
- @item_windows[i].visible = (@equip_index == i)
- @item_windows[i].y = 208 + ay
- @item_windows[i].height = 208
- @item_windows[i].active = false
- @item_windows[i].index = -1
- end
- end
- #--------------------------------------------------------------------------
- # 仠 傾僀僥儉僂傿儞僪僂偺峏怴 [嵞峔抸]
- #--------------------------------------------------------------------------
- def update_item_windows
- for i in 0...@actor.equip_slots.size
- @item_windows[i].visible = (@equip_window.index == i)
- @item_windows[i].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[i].note[/\[#{RGSSLAB_039::ARMOR_PART_NOTE}(\d+)\]/]
- $data_armors[i].kind = $data_armors[i].note[/\[#{RGSSLAB_039::ARMOR_PART_NOTE}(\d+)\]/].scan(/(\d+)/)[0][0].to_i - 1
- end
- end
- end
- end
- end
复制代码 唔 装备扩展的
|
|