设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1308|回复: 7
打印 上一主题 下一主题

这个脚本的完整版本在哪里?

 关闭 [复制链接]

Lv3.寻梦者

贝鲁耶的依叶森林
持镰的苍色水野

梦石
4
星屑
894
在线时间
565 小时
注册时间
2007-4-8
帖子
1304

RM创作大赛01组委会第4届短篇游戏比赛季军短篇八RM组亚军

跳转到指定楼层
1
发表于 2008-5-16 05:20:03 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
MS是装备窗口的优化……
本来有个自动装备的……当初给删除了……
现在想再要回来……找不到当初的脚本了………………
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 拡張装備画面 - KGC_ExtendedEquipScene ◆ VX ◆
  3. #_/    ◇ Last update : 2008/02/10 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  機能を強化した装備画面を作成します。
  6. #_/============================================================================
  7. #_/ 【基本機能】≪ヘルプウィンドウ機能拡張≫ より下に導入してください。
  8. #_/ 【装備】≪装備拡張≫ より上に導入してください。
  9. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  10. #==============================================================================
  11. # ★ カスタマイズ項目 - Customize ★
  12. # ★        自定义项目部分        ★
  13. #==============================================================================

  14. module KGC
  15. module ExtendedEquipScene
  16.   # ◆ パラメータ名
  17.   # ◆ 能力值名称
  18.   VOCAB_PARAM = {
  19.     :hit => "命中率",        # 命中率
  20.     :eva => "回避率",        # 回避率
  21.     :cri => "会心一击",    # 会心一击率
  22.   }  # ← 这个不可删除!

  23.   # ◆ 装備変更時に表示するパラメータ
  24.   #  表示したい順に , で区切って記入。
  25.   # ◆ 更换装备时显示的能力值
  26.   #  依照我们所想要显示的顺序
  27.   #  :maxhp .. 最大 HP
  28.   #  :maxmp .. 最大 MP
  29.   #  :atk   .. 攻撃力
  30.   #  :def   .. 防御力
  31.   #  :spi   .. 精神力
  32.   #  :agi   .. 敏捷性
  33.   #  :hit   .. 命中率
  34.   #  :eva   .. 回避率
  35.   #  :cri   .. 会心一击率
  36.   EQUIP_PARAMS = [ :atk, :def, :spi, :agi, :hit, :eva, :cri ]
  37.   
  38.     # ◆ 装備画面のコマンド名
  39.   # ◆ 装備场景的命令名称
  40.   COMMANDS = [
  41.     "更换装备",    # 更换装備
  42.     "卸下装备",# 卸下所有装备
  43.   ]  # ← 这个不可删除!
  44.   
  45.   # ◆ 装備画面コマンドのヘルプ
  46.   # ◆ 装備场景命令说明
  47.   COMMAND_HELP = [
  48.     "更换角色身上的装备。",            # 更换装備
  49.     "卸下所有的装备",                  # 卸下所有装备
  50.   ]  # ← 这个不可删除!

  51.   # ◆ 最強装備を行わない装備種別
  52.   #  最強装備から除外する装備種別を記述。
  53.   #  -1..武器  0..盾  1..頭  2..身体  3..装飾品  4~..≪装備拡張≫ で定義
  54.   # ◆ 忽视最强装备的装备种类
  55.   #  设置没有最强装备的装备种类,以下面的数字分类
  56.   #  -1..武器  0..盾类防具  1..頭部防具  2..身体防具  3..装飾品  4~..装备扩充的定义

  57.   IGNORE_STRONGEST_KIND = [3, 4]
  58. end
  59. end

  60. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  61. $imported = {} if $imported == nil
  62. $imported["ExtendedEquipScene"] = true

  63. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  64. #==============================================================================
  65. # ■ Vocab
  66. #==============================================================================

  67. module Vocab
  68.   # 命中率
  69.   def self.hit
  70.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:hit]
  71.   end

  72.   # 回避率
  73.   def self.eva
  74.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:eva]
  75.   end

  76.   # クリティカル率
  77.   def self.cri
  78.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:cri]
  79.   end
  80. end

  81. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  82. #==============================================================================
  83. # □ Window_ExtendedEquipCommand
  84. #------------------------------------------------------------------------------
  85. #   拡張装備画面で、実行する操作を選択するウィンドウです。
  86. #==============================================================================

  87. class Window_ExtendedEquipCommand < Window_Command
  88.   #--------------------------------------------------------------------------
  89.   # ● オブジェクト初期化
  90.   #--------------------------------------------------------------------------
  91.   def initialize
  92.     super(160, KGC::ExtendedEquipScene::COMMANDS)
  93.     self.active = false
  94.     self.z = 1000
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● ヘルプウィンドウの更新
  98.   #--------------------------------------------------------------------------
  99.   def update_help
  100.     @help_window.set_text(KGC::ExtendedEquipScene::COMMAND_HELP[self.index])
  101.   end
  102. end

  103. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  104. #==============================================================================
  105. # □ Window_EquipBaseInfo
  106. #------------------------------------------------------------------------------
  107. #   装備画面で、アクターの基本情報を表示するウィンドウです。
  108. #==============================================================================

  109. class Window_EquipBaseInfo < Window_Base
  110.   #--------------------------------------------------------------------------
  111.   # ● オブジェクト初期化
  112.   #     x     : ウィンドウの X 座標
  113.   #     y     : ウィンドウの Y 座標
  114.   #     actor : アクター
  115.   #--------------------------------------------------------------------------
  116.   def initialize(x, y, actor)
  117.     super(x, y, Graphics.width / 2, WLH + 32)
  118.     @actor = actor
  119.     refresh
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ● リフレッシュ
  123.   #--------------------------------------------------------------------------
  124.   def refresh
  125.     self.contents.clear
  126.     draw_actor_name(@actor, 0, 0)
  127.     # EP 制を使用する場合は EP を描画
  128.     if $imported["EquipExtension"] && KGC::EquipExtension::USE_EP_SYSTEM
  129.       draw_actor_ep(@actor, 116, 0, Graphics.width / 2 - 148)
  130.     end
  131.   end
  132. end

  133. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  134. #==============================================================================
  135. # ■ Window_EquipItem
  136. #==============================================================================

  137. class Window_EquipItem < Window_Item
  138.   #--------------------------------------------------------------------------
  139.   # ● オブジェクト初期化
  140.   #     x          : ウィンドウの X 座標
  141.   #     y          : ウィンドウの Y 座標
  142.   #     width      : ウィンドウの幅
  143.   #     height     : ウィンドウの高さ
  144.   #     actor      : アクター
  145.   #     equip_type : 装備部位
  146.   #--------------------------------------------------------------------------
  147.   alias initialize_KGC_ExtendedEquipScene initialize
  148.   def initialize(x, y, width, height, actor, equip_type)
  149.     width = Graphics.width / 2

  150.     initialize_KGC_ExtendedEquipScene(x, y, width, height, actor, equip_type)

  151.     @column_max = 1
  152.     refresh
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● リフレッシュ
  156.   #--------------------------------------------------------------------------
  157.   alias refresh_KGC_ExtendedEquipScene refresh
  158.   def refresh
  159.     return if @column_max == 2  # 無駄な描画は行わない

  160.     refresh_KGC_ExtendedEquipScene
  161.   end
  162. end

  163. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  164. #==============================================================================
  165. # □ Window_ExtendedEquipStatus
  166. #------------------------------------------------------------------------------
  167. #   拡張装備画面で、アクターの能力値変化を表示するウィンドウです。
  168. #==============================================================================

  169. class Window_ExtendedEquipStatus < Window_EquipStatus
  170.   #--------------------------------------------------------------------------
  171.   # ○ 公開インスタンス変数
  172.   #--------------------------------------------------------------------------
  173.   attr_writer   :equip_type               # 装備タイプ
  174.   #--------------------------------------------------------------------------
  175.   # ● オブジェクト初期化
  176.   #     x     : ウィンドウの X 座標
  177.   #     y     : ウィンドウの Y 座標
  178.   #     actor : アクター
  179.   #--------------------------------------------------------------------------
  180.   def initialize(x, y, actor)
  181.     @equip_type = -1
  182.     @caption_cache = nil
  183.     super(x, y, actor)
  184.     @new_item = nil
  185.     @new_param = {}
  186.     refresh
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 解放
  190.   #--------------------------------------------------------------------------
  191.   def dispose
  192.     super
  193.     @caption_cache.dispose if @caption_cache != nil
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● ウィンドウ内容の作成
  197.   #--------------------------------------------------------------------------
  198.   def create_contents
  199.     self.contents.dispose
  200.     self.contents = Bitmap.new(Graphics.width / 2 - 32, height - 32)
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● リフレッシュ
  204.   #--------------------------------------------------------------------------
  205.   def refresh
  206.     return if @equip_type < 0

  207.     if @caption_cache == nil
  208.       create_cache
  209.     else
  210.       self.contents.clear
  211.       self.contents.blt(0, 0, @caption_cache, @caption_cache.rect)
  212.     end
  213.     draw_item_name(@actor.equips[@equip_type], 0, 0)
  214.     draw_item_name(@new_item, 24, WLH)
  215.     KGC::ExtendedEquipScene::EQUIP_PARAMS.each_with_index { |param, i|
  216.       draw_parameter(0, WLH * (i + 2), param)
  217.     }
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ○ キャッシュ生成
  221.   #--------------------------------------------------------------------------
  222.   def create_cache
  223.     create_contents

  224.     self.contents.font.color = system_color
  225.     self.contents.draw_text(0, WLH, 20, WLH, "→")
  226.     # パラメータ描画
  227.     KGC::ExtendedEquipScene::EQUIP_PARAMS.each_with_index { |param, i|
  228.       draw_parameter_name(0, WLH * (i + 2), param)
  229.     }

  230.     @caption_cache = Bitmap.new(self.contents.width, self.contents.height)
  231.     @caption_cache.blt(0, 0, self.contents, self.contents.rect)
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ○ 能力値名の描画
  235.   #     x    : 描画先 X 座標
  236.   #     y    : 描画先 Y 座標
  237.   #     type : 能力値の種類
  238.   #--------------------------------------------------------------------------
  239.   def draw_parameter_name(x, y, type)
  240.     case type
  241.     when :maxhp
  242.       name = Vocab.hp
  243.     when :maxmp
  244.       name = Vocab.mp
  245.     when :atk
  246.       name = Vocab.atk
  247.     when :def
  248.       name = Vocab.def
  249.     when :spi
  250.       name = Vocab.spi
  251.     when :agi
  252.       name = Vocab.agi
  253.     when :hit
  254.       name = Vocab.hit
  255.     when :eva
  256.       name = Vocab.eva
  257.     when :cri
  258.       name = Vocab.cri
  259.     end
  260.     self.contents.font.color = system_color
  261.     self.contents.draw_text(x + 4, y, 96, WLH, name)
  262.     self.contents.font.color = system_color
  263.     self.contents.draw_text(x + 156, y, 20, WLH, "→", 1)
  264.   end
  265.   #--------------------------------------------------------------------------
  266.   # ● 装備変更後の能力値設定
  267.   #     new_param : 装備変更後のパラメータの配列
  268.   #     new_item  : 変更後の装備
  269.   #--------------------------------------------------------------------------
  270.   def set_new_parameters(new_param, new_item)
  271.     changed = false
  272.     # パラメータ変化判定
  273.     KGC::ExtendedEquipScene::EQUIP_PARAMS.each { |k|
  274.       if @new_param[k] != new_param[k]
  275.         changed = true
  276.         break
  277.       end
  278.     }
  279.     changed |= (@new_item != new_item)

  280.     if changed
  281.       @new_item = new_item
  282.       @new_param = new_param
  283.       refresh
  284.     end
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● 能力値の描画
  288.   #     x    : 描画先 X 座標
  289.   #     y    : 描画先 Y 座標
  290.   #     type : 能力値の種類
  291.   #--------------------------------------------------------------------------
  292.   def draw_parameter(x, y, type)
  293.     case type
  294.     when :maxhp
  295.       value = @actor.maxhp
  296.     when :maxmp
  297.       value = @actor.maxmp
  298.     when :atk
  299.       value = @actor.atk
  300.     when :def
  301.       value = @actor.def
  302.     when :spi
  303.       value = @actor.spi
  304.     when :agi
  305.       value = @actor.agi
  306.     when :hit
  307.       value = @actor.hit
  308.     when :eva
  309.       value = @actor.eva
  310.     when :cri
  311.       value = @actor.cri
  312.     end
  313.     new_value = @new_param[type]
  314.     self.contents.font.color = normal_color
  315.     self.contents.draw_text(x + 106, y, 48, WLH, value, 2)
  316.     if new_value != nil
  317.       self.contents.font.color = new_parameter_color(value, new_value)
  318.       self.contents.draw_text(x + 176, y, 48, WLH, new_value, 2)
  319.     end
  320.   end
  321. end

  322. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  323. #==============================================================================
  324. # ■ Scene_Equip
  325. #==============================================================================

  326. class Scene_Equip < Scene_Base
  327.   #--------------------------------------------------------------------------
  328.   # ○ 定数
  329.   #--------------------------------------------------------------------------
  330.   STANDARD_WIDTH  = Graphics.width / 2
  331.   ANIMATION_SPPED = 8
  332.   #--------------------------------------------------------------------------
  333.   # ● 開始処理
  334.   #--------------------------------------------------------------------------
  335.   alias start_KGC_ExtendedEquipScene start
  336.   def start
  337.     start_KGC_ExtendedEquipScene

  338.     # ステータスウィンドウを作り直す
  339.     @status_window.dispose
  340.     @status_window = Window_ExtendedEquipStatus.new(0, 0, @actor)

  341.     create_command_window

  342.     @last_item = RPG::Weapon.new
  343.     @base_info_window = Window_EquipBaseInfo.new(
  344.       0, @help_window.height, @actor)

  345.     adjust_window_for_extended_equiop_scene
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ○ ウィンドウの座標・サイズを拡張装備画面向けに調整
  349.   #--------------------------------------------------------------------------
  350.   def adjust_window_for_extended_equiop_scene
  351.     @base_info_window.width = @equip_window.width

  352.     @equip_window.x = 0
  353.     @equip_window.y = @base_info_window.y + @base_info_window.height
  354.     @equip_window.height = Graphics.height - @equip_window.y
  355.     @equip_window.active = false
  356.     @equip_window.z = 100

  357.     @status_window.x = 0
  358.     @status_window.y = @equip_window.y
  359.     @status_window.width = STANDARD_WIDTH
  360.     @status_window.height = @equip_window.height
  361.     @status_window.visible = false
  362.     @status_window.z = 100

  363.     @item_windows.each { |window|
  364.       window.x = @equip_window.width
  365.       window.y = @help_window.height
  366.       window.z = 50
  367.       window.height = Graphics.height - @help_window.height
  368.     }
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # ○ コマンドウィンドウの作成
  372.   #--------------------------------------------------------------------------
  373.   def create_command_window
  374.     @command_window = Window_ExtendedEquipCommand.new
  375.     @command_window.help_window = @help_window
  376.     @command_window.active = true
  377.     @command_window.x = (Graphics.width - @command_window.width) / 2
  378.     @command_window.y = (Graphics.height - @command_window.height) / 2
  379.     @command_window.update_help

  380.     # 装備固定なら「最強装備」「すべて外す」を無効化
  381.     if @actor.fix_equipment
  382.       @command_window.draw_item(1, false)
  383.       @command_window.draw_item(2, false)
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● 終了処理
  388.   #--------------------------------------------------------------------------
  389.   alias terminate_KGC_ExtendedEquipScene terminate
  390.   def terminate
  391.     terminate_KGC_ExtendedEquipScene

  392.     @command_window.dispose
  393.     @base_info_window.dispose
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ○ ウィンドウをリフレッシュ
  397.   #--------------------------------------------------------------------------
  398.   def refresh_window
  399.     @base_info_window.refresh
  400.     @equip_window.refresh
  401.     @status_window.refresh
  402.     @item_windows.each { |window| window.refresh }
  403.     Graphics.frame_reset
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● フレーム更新
  407.   #--------------------------------------------------------------------------
  408.   alias update_KGC_ExtendedEquipScene update
  409.   def update
  410.     update_command_window
  411.     if @command_window.active
  412.       update_KGC_ExtendedEquipScene
  413.       update_command_selection
  414.     else
  415.       update_KGC_ExtendedEquipScene
  416.     end
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ○ コマンドウィンドウの更新
  420.   #--------------------------------------------------------------------------
  421.   def update_command_window
  422.     @command_window.update
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● ステータスウィンドウの更新
  426.   #--------------------------------------------------------------------------
  427.   def update_status_window
  428.     @base_info_window.update
  429.     @status_window.update

  430.     if @command_window.active || @equip_window.active
  431.       @status_window.set_new_parameters({}, nil)
  432.     elsif @item_window.active
  433.       return if @last_item == @item_window.item

  434.       @last_item = @item_window.item
  435.       temp_actor = Marshal.load(Marshal.dump(@actor))
  436.       temp_actor.change_equip(@equip_window.index, @item_window.item, true)
  437.       param = {
  438.         :maxhp => temp_actor.maxhp,
  439.         :maxmp => temp_actor.maxmp,
  440.         :atk   => temp_actor.atk,
  441.         :def   => temp_actor.def,
  442.         :spi   => temp_actor.spi,
  443.         :agi   => temp_actor.agi,
  444.         :hit   => temp_actor.hit,
  445.         :eva   => temp_actor.eva,
  446.         :cri   => temp_actor.cri,
  447.       }
  448.       @status_window.equip_type = @equip_window.index
  449.       @status_window.set_new_parameters(param, @last_item)
  450.       Graphics.frame_reset
  451.     end
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ○ コマンド選択の更新
  455.   #--------------------------------------------------------------------------
  456.   def update_command_selection
  457.     update_window_position_for_equip_selection
  458.     if Input.trigger?(Input::B)
  459.       Sound.play_cancel
  460.       return_scene
  461.     elsif Input.trigger?(Input::R)
  462.       Sound.play_cursor
  463.       next_actor
  464.     elsif Input.trigger?(Input::L)
  465.       Sound.play_cursor
  466.       prev_actor
  467.     elsif Input.trigger?(Input::C)
  468.       case @command_window.index
  469.       when 0  # 装備変更
  470.         Sound.play_decision
  471.         # 装備部位ウィンドウに切り替え
  472.         @equip_window.active = true
  473.         @command_window.active = false
  474.         @command_window.close
  475.       when 2  # 最強装備
  476.         if @actor.fix_equipment
  477.           Sound.play_buzzer
  478.           return
  479.         end
  480.         Sound.play_equip
  481.         process_equip_strongest
  482.       when 1  # すべて外す
  483.         if @actor.fix_equipment
  484.           Sound.play_buzzer
  485.           return
  486.         end
  487.         Sound.play_equip
  488.         process_remove_all
  489.       end
  490.     end
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● 装備部位選択の更新
  494.   #--------------------------------------------------------------------------
  495.   alias update_equip_selection_KGC_ExtendedEquipScene update_equip_selection
  496.   def update_equip_selection
  497.     update_window_position_for_equip_selection
  498.     if Input.trigger?(Input::A)
  499.       if @actor.fix_equipment
  500.         Sound.play_buzzer
  501.         return
  502.       end
  503.       # 選択している装備品を外す
  504.       Sound.play_equip
  505.       @actor.change_equip(@equip_window.index, nil)
  506.       @base_info_window.refresh
  507.       @equip_window.refresh
  508.       @item_window.refresh
  509.     elsif Input.trigger?(Input::B)
  510.       Sound.play_cancel
  511.       # コマンドウィンドウに切り替え
  512.       @equip_window.active = false
  513.       @command_window.active = true
  514.       @command_window.open
  515.       return
  516.     elsif Input.trigger?(Input::R) || Input.trigger?(Input::L)
  517.       # アクター切り替えを無効化
  518.       return
  519.     elsif Input.trigger?(Input::C)
  520.       # 前回のアイテムをダミーにする
  521.       @last_item = RPG::Weapon.new
  522.     end

  523.     update_equip_selection_KGC_ExtendedEquipScene
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● アイテム選択の更新
  527.   #--------------------------------------------------------------------------
  528.   alias update_item_selection_KGC_ExtendedEquipScene update_item_selection
  529.   def update_item_selection
  530.     update_window_position_for_item_selection

  531.     update_item_selection_KGC_ExtendedEquipScene

  532.     if Input.trigger?(Input::C)
  533.       @base_info_window.refresh
  534.     end
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # ○ ウィンドウ位置の更新 (装備部位選択)
  538.   #--------------------------------------------------------------------------
  539.   def update_window_position_for_equip_selection
  540.     return if @item_window.x == @equip_window.width

  541.     @base_info_window.width = @equip_window.width
  542.     @item_window.x = [@item_window.x + ANIMATION_SPPED, @equip_window.width].min
  543.     @equip_window.visible = true
  544.     @status_window.visible = false
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ○ ウィンドウ位置の更新 (アイテム選択)
  548.   #--------------------------------------------------------------------------
  549.   def update_window_position_for_item_selection
  550.     return if @item_window.x == STANDARD_WIDTH

  551.     @base_info_window.width = STANDARD_WIDTH
  552.     @item_window.x = [@item_window.x - ANIMATION_SPPED, STANDARD_WIDTH].max
  553.     @equip_window.visible = false
  554.     @status_window.visible = true
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # ○ 最強装備の処理
  558.   #--------------------------------------------------------------------------
  559.   def process_equip_strongest
  560.     # 最強装備対象の種別を取得
  561.     type = [-1]
  562.     type += ($imported["EquipExtension"] ? @actor.equip_type : [0, 1, 2, 3])
  563.     type -= KGC::ExtendedEquipScene::IGNORE_STRONGEST_KIND
  564.     weapon_range = (@actor.two_swords_style ? 0..1 : 0)

  565.     # 最強装備
  566.     type.each_index { |i|
  567.       case i
  568.       when weapon_range  # 武器
  569.         weapon = strongest_item(i, -1)
  570.         next if weapon == nil
  571.         @actor.change_equip(i, weapon)
  572.       else               # 防具
  573.         armor = strongest_item(i, type[i])
  574.         next if armor == nil
  575.         @actor.change_equip(i, armor)
  576.       end
  577.     }

  578.     refresh_window
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ○ 最も強力なアイテムを取得
  582.   #     equip_type : 装備部位
  583.   #     kind       : 種別 (-1..武器  0~..防具)
  584.   #    該当するアイテムがなければ nil を返す。
  585.   #--------------------------------------------------------------------------
  586.   def strongest_item(equip_type, kind)
  587.     result = nil
  588.     case kind
  589.     when -1  # 武器
  590.       # 装備可能な武器を取得
  591.       weapons = $game_party.items.find_all { |item|
  592.         valid = item.is_a?(RPG::Weapon) && @actor.equippable?(item)
  593.         if valid && $imported["EquipExtension"]
  594.           valid = @actor.ep_condition_clear?(equip_type, item)
  595.         end
  596.         valid
  597.       }
  598.       # 最も atk が高い武器を取得
  599.       weapons.each { |item|
  600.         if result == nil || result.atk <= item.atk
  601.           result = item
  602.         end
  603.       }
  604.     else     # 防具
  605.       # 装備可能な防具を取得
  606.       armors = $game_party.items.find_all { |item|
  607.         valid = item.is_a?(RPG::Armor) && item.kind == kind &&
  608.           @actor.equippable?(item)
  609.         if valid && $imported["EquipExtension"]
  610.           valid = @actor.ep_condition_clear?(equip_type, item)
  611.         end
  612.         valid
  613.       }
  614.       # 最も def が高い防具を取得
  615.       armors.each { |item|
  616.         if result == nil || result.def <= item.def
  617.           result = item
  618.         end
  619.       }
  620.     end

  621.     return result
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ○ すべて外す処理
  625.   #--------------------------------------------------------------------------
  626.   def process_remove_all
  627.     type_max = ($imported["EquipExtension"] ? @actor.equip_type.size : 3) + 1
  628.     type_max.times { |i| @actor.change_equip(i, nil) }
  629.     refresh_window
  630.   end
  631. end
复制代码

版务信息:本贴由楼主自主结贴~
水野的主页><
头像来自于游戏《龙背上的骑兵3》主角——Zero
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-6
帖子
44
8
发表于 2008-5-17 06:12:28 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者

贝鲁耶的依叶森林
持镰的苍色水野

梦石
4
星屑
894
在线时间
565 小时
注册时间
2007-4-8
帖子
1304

RM创作大赛01组委会第4届短篇游戏比赛季军短篇八RM组亚军

7
 楼主| 发表于 2008-5-17 06:03:17 | 只看该作者
那啥……大家误解我的意思了……{/gg}

我是说在这行里
  COMMANDS = [
    "更换装备",    # 更换装備
    "卸下装备",# 卸下所有装备
  ]  # ← 这个不可删除!

本来有个“自动装备”的……
我把它和关于自动装备的那几段给删除了……

现在想找到原来的脚本……


就是和增加装备种类的脚本一起连用的那个
水野的主页><
头像来自于游戏《龙背上的骑兵3》主角——Zero
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
30 小时
注册时间
2008-1-18
帖子
22
6
发表于 2008-5-17 02:20:29 | 只看该作者
以下引用水野·迪尔于2008-5-16 12:57:19的发言:

不是那个……


那就不知道了,反正我这两个脚本是連在一起用的,分别是1和2
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

喵,小柯的宠物

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-4-6
帖子
1277
5
发表于 2008-5-16 22:20:07 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者

贝鲁耶的依叶森林
持镰的苍色水野

梦石
4
星屑
894
在线时间
565 小时
注册时间
2007-4-8
帖子
1304

RM创作大赛01组委会第4届短篇游戏比赛季军短篇八RM组亚军

4
 楼主| 发表于 2008-5-16 20:57:19 | 只看该作者
不是那个……
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
645
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

3
发表于 2008-5-16 06:20:03 | 只看该作者
脚本太长太占篇幅

请用[code]框住
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
30 小时
注册时间
2008-1-18
帖子
22
2
发表于 2008-5-16 06:11:31 | 只看该作者

  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 装備拡張 - KGC_EquipExtension ◆ VX ◆
  3. #_/    ◇ Last update : 2008/02/10 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  装備関連の機能を拡張します。
  6. #_/============================================================================
  7. #_/ 【メニュー】≪拡張装備画面≫ より下に導入してください。
  8. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  9. #==============================================================================
  10. # ★ カスタマイズ項目 - Customize ★
  11. #==============================================================================

  12. module KGC
  13. module EquipExtension
  14.   # ◆ 扩张的装备种类名称
  15.   #  从前面的皆下去4, 5, 6, ...
  16.   EXTRA_EQUIP_KIND = ["足", "技能書"]

  17.   # ◆ 装备的顺序
  18.   #  以这里设置的顺序接续在武器的下面
  19.   #  ※ 装备个数最低为1,否则二刀流会出错
  20.   #   ** 装备种类一览 **
  21.   #  0..盾  1..頭部  2..身体  3..装飾品  4~..↑所定義的种类
  22.   EQUIP_TYPE = [0, 1, 2, 4, 3, 3, 5]

  23.   # ◆ EP (装备点数) 制是否要使用
  24.   USE_EP_SYSTEM = true
  25.   # ◆ EP 的名称
  26.   VOCAB_EP   = "EP"
  27.   # ◆ EP 的名称 (略)
  28.   VOCAB_EP_A = "E"
  29.   # ◆ 是否在状态介面显示EP值
  30.   SHOW_STATUS_EP = true

  31.   # ◆ 装备预设 EP 消耗点数
  32.   #  没有设定EP消耗点数的装备自动加上的点数
  33.   DEFAULT_EP_COST   = 1
  34.   # ◆ 当消耗 EP 值为 0 时隐藏
  35.   HIDE_ZERO_EP_COST = true

  36.   # ◆ EP 上限
  37.   EP_MAX = 20
  38.   # ◆ EP 下限
  39.   EP_MIN = 5
  40.   # ◆ 最大 EP 公式
  41.   #   level..角色等级
  42.   #  计算後小数自动取整
  43.   EP_CALC_EXP = "level * 0.3 + 4"

  44.   # ◆ 消耗 EP 値的文字颜色 (接续在装备名称後面的文字)
  45.   #  数字  : 与 \C[n] 同样的颜色 (也就是在窗口外观设置的颜色色号)
  46.   #  Color : 指定颜色。 ( Color.new(128, 255, 255))
  47.   EP_COST_COLOR        = 23
  48.   # ◆ EP 槽開始色
  49.   EP_GAUGE_START_COLOR = 28
  50.   # ◆ EP 槽结束色
  51.   EP_GAUGE_END_COLOR   = 29
  52. end
  53. end

  54. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  55. $imported = {} if $imported == nil
  56. $imported["EquipExtension"] = true

  57. module KGC::EquipExtension
  58.   # EP 制を使用しない場合の設定
  59.   unless USE_EP_SYSTEM
  60.     SHOW_STATUS_EP = false
  61.     HIDE_ZERO_EP_COST = true
  62.   end

  63.   # 正規表現
  64.   module Regexp
  65.     # ベースアイテム
  66.     module BaseItem
  67.       # 消費 EP
  68.       EP_COST = /<EP\s*(\d+)>/i
  69.       # 装備タイプ
  70.       EQUIP_TYPE = /<(?:EQUIP_TYPE|装備タイプ)\s*(\d+(?:\s*,\s*\d+)*)>/
  71.     end

  72.     # 防具
  73.     module Armor
  74.       # 装備種別
  75.       EQUIP_KIND = /<(?:EQUIP_KIND|装備種別)\s*(.+)>/i
  76.     end
  77.   end
  78. end

  79. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  80. #==============================================================================
  81. # □ KGC::Commands
  82. #==============================================================================

  83. module KGC::Commands
  84.   module_function
  85.   #--------------------------------------------------------------------------
  86.   # ○ アクターの装備を修復
  87.   #--------------------------------------------------------------------------
  88.   def restore_equip
  89.     (1...$data_actors.size).each { |i|
  90.       actor = $game_actors[i]
  91.       actor.restore_equip
  92.     }
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ○ アクターの装備タイプを設定
  96.   #     actor_id   : アクター ID
  97.   #     equip_type : 装備タイプ
  98.   #--------------------------------------------------------------------------
  99.   def set_actor_equip_type(actor_id, equip_type = nil)
  100.     actor = $game_actors[actor_id]
  101.     return if actor == nil
  102.     actor.equip_type = equip_type
  103.   end
  104. end

  105. class Game_Interpreter
  106.   include KGC::Commands
  107. end

  108. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  109. #==============================================================================
  110. # ■ Vocab
  111. #==============================================================================

  112. module Vocab
  113.   # EP
  114.   def self.ep
  115.     return KGC::EquipExtension::VOCAB_EP
  116.   end

  117.   # EP (略)
  118.   def self.ep_a
  119.     return KGC::EquipExtension::VOCAB_EP_A
  120.   end

  121.   # 拡張防具欄
  122.   def self.extra_armor(index)
  123.     return KGC::EquipExtension::EXTRA_EQUIP_KIND[index]
  124.   end
  125. end

  126. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  127. #==============================================================================
  128. # ■ RPG::BaseItem
  129. #==============================================================================

  130. class RPG::BaseItem
  131.   #--------------------------------------------------------------------------
  132.   # ○ 装備拡張のキャッシュを作成
  133.   #--------------------------------------------------------------------------
  134.   def create_equip_extension_cache
  135.     @__ep_cost = KGC::EquipExtension::DEFAULT_EP_COST
  136.     @__equip_type = []

  137.     self.note.split(/[\r\n]+/).each { |line|
  138.       case line
  139.       when KGC::EquipExtension::Regexp::BaseItem::EP_COST
  140.         # 消費 EP
  141.         @__ep_cost = $1.to_i
  142.       when KGC::EquipExtension::Regexp::BaseItem::EQUIP_TYPE
  143.         # 装備タイプ
  144.         @__equip_type = []
  145.         $1.scan(/\d+/) { |num|
  146.           @__equip_type << num.to_i
  147.         }
  148.       end
  149.     }

  150.     # EP 制を使用しない場合は消費 EP = 0
  151.     @__ep_cost = 0 unless KGC::EquipExtension::USE_EP_SYSTEM
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ○ 消費 EP
  155.   #--------------------------------------------------------------------------
  156.   def ep_cost
  157.     create_equip_extension_cache if @__ep_cost == nil
  158.     return @__ep_cost
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ○ 装備タイプ
  162.   #--------------------------------------------------------------------------
  163.   def equip_type
  164.     create_equip_extension_cache if @__equip_type == nil
  165.     return @__equip_type
  166.   end
  167. end

  168. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  169. #==============================================================================
  170. # ■ RPG::Armor
  171. #==============================================================================

  172. class RPG::Armor < RPG::BaseItem
  173.   #--------------------------------------------------------------------------
  174.   # ○ 装備拡張のキャッシュを作成
  175.   #--------------------------------------------------------------------------
  176.   def create_equip_extension_cache
  177.     super
  178.     @__kind = -1

  179.     self.note.split(/[\r\n]+/).each { |line|
  180.       if line =~ KGC::EquipExtension::Regexp::Armor::EQUIP_KIND
  181.         # 装備タイプ
  182.         e_index = KGC::EquipExtension::EXTRA_EQUIP_KIND.index($1)
  183.         next if e_index == nil
  184.         @__kind = e_index + 4
  185.       end
  186.     }
  187.   end

  188. unless $@
  189.   #--------------------------------------------------------------------------
  190.   # ○ 種別
  191.   #--------------------------------------------------------------------------
  192.   alias kind_KGC_EquipExtension kind
  193.   def kind
  194.     create_equip_extension_cache if @__kind == nil
  195.     return (@__kind == -1 ? kind_KGC_EquipExtension : @__kind)
  196.   end
  197. end

  198. end

  199. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  200. #==============================================================================
  201. # ■ Game_Actor
  202. #==============================================================================

  203. class Game_Actor < Game_Battler
  204.   #--------------------------------------------------------------------------
  205.   # ● 公開インスタンス変数
  206.   #--------------------------------------------------------------------------
  207.   attr_writer   :equip_type               # 装備タイプ
  208.   #--------------------------------------------------------------------------
  209.   # ● セットアップ
  210.   #     actor_id : アクター ID
  211.   #--------------------------------------------------------------------------
  212.   alias setup_KGC_EquipExtension setup
  213.   def setup(actor_id)
  214.     actor = $data_actors[actor_id]
  215.     @extra_armor_id = []

  216.     setup_KGC_EquipExtension(actor_id)

  217.     restore_equip
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ○ MaxEP 取得
  221.   #--------------------------------------------------------------------------
  222.   def maxep
  223.     n = Integer(eval(KGC::EquipExtension::EP_CALC_EXP))
  224.     return [[n, ep_limit].min, KGC::EquipExtension::EP_MIN].max
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ○ EP 取得
  228.   #--------------------------------------------------------------------------
  229.   def ep
  230.     n = 0
  231.     equips.compact.each { |item| n += item.ep_cost }
  232.     return [maxep - n, 0].max
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ○ EP 上限取得
  236.   #--------------------------------------------------------------------------
  237.   def ep_limit
  238.     return KGC::EquipExtension::EP_MAX
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ○ 防具欄の取得
  242.   #--------------------------------------------------------------------------
  243.   def equip_type
  244.     if @equip_type.is_a?(Array)
  245.       return @equip_type
  246.     else
  247.       return KGC::EquipExtension::EQUIP_TYPE
  248.     end
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ○ 防具欄の数
  252.   #--------------------------------------------------------------------------
  253.   def armor_number
  254.     return equip_type.size
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ○ 拡張防具欄の数
  258.   #--------------------------------------------------------------------------
  259.   def extra_armor_number
  260.     return [armor_number - 4, 0].max
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ○ 防具 ID リストの取得
  264.   #--------------------------------------------------------------------------
  265.   def extra_armor_id
  266.     @extra_armor_id = [] if @extra_armor_id == nil
  267.     return @extra_armor_id
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 防具オブジェクトの配列取得
  271.   #--------------------------------------------------------------------------
  272.   alias armors_KGC_EquipExtension armors
  273.   def armors
  274.     result = armors_KGC_EquipExtension

  275.     # 5番目以降の防具を追加
  276.     extra_armor_number.times { |i|
  277.       armor_id = extra_armor_id[i]
  278.       result << (armor_id == nil ? nil : $data_armors[armor_id])
  279.     }
  280.     return result
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 装備の変更 (オブジェクトで指定)
  284.   #     equip_type : 装備部位
  285.   #     item       : 武器 or 防具 (nil なら装備解除)
  286.   #     test       : テストフラグ (戦闘テスト、または装備画面での一時装備)
  287.   #--------------------------------------------------------------------------
  288.   alias change_equip_KGC_EquipExtension change_equip
  289.   def change_equip(equip_type, item, test = false)
  290.     change_equip_KGC_EquipExtension(equip_type, item, test)

  291.     # 拡張防具欄がある場合のみ
  292.     if extra_armor_number > 0
  293.       item_id = item == nil ? 0 : item.id
  294.       case equip_type
  295.       when 5..armor_number  # 拡張防具欄
  296.         @extra_armor_id = [] if @extra_armor_id == nil
  297.         @extra_armor_id[equip_type - 5] = item_id
  298.       end
  299.     end

  300.     restore_battle_skill if $imported["SkillCPSystem"]
  301.     restore_passive_rev  if $imported["PassiveSkill"]
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 装備の破棄
  305.   #     item : 破棄する武器 or 防具
  306.   #    武器/防具の増減で「装備品も含める」のとき使用する。
  307.   #--------------------------------------------------------------------------
  308.   alias discard_equip_KGC_EquipExtension discard_equip
  309.   def discard_equip(item)
  310.     last_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]

  311.     discard_equip_KGC_EquipExtension(item)

  312.     curr_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
  313.     return unless item.is_a?(RPG::Armor)  # 防具でない
  314.     return if last_armors != curr_armors  # 既に破棄された

  315.     # 拡張防具欄を検索
  316.     extra_armor_number.times { |i|
  317.       if extra_armor_id[i] == item.id
  318.         @extra_armor_id[i] = 0
  319.         break
  320.       end
  321.     }

  322.     restore_battle_skill if $imported["SkillCPSystem"]
  323.     restore_passive_rev  if $imported["PassiveSkill"]
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 職業 ID の変更
  327.   #     class_id : 新しい職業 ID
  328.   #--------------------------------------------------------------------------
  329.   alias class_id_equal_KGC_EquipExtension class_id=
  330.   def class_id=(class_id)
  331.     class_id_equal_KGC_EquipExtension(class_id)

  332.     return if extra_armor_number == 0  # 拡張防具欄がない

  333.     # 装備できない拡張防具を外す
  334.     for i in 5..armor_number
  335.       change_equip(i, nil) unless equippable?(equips[i])
  336.     end
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ○ EP 条件クリア判定
  340.   #     equip_type : 装備部位
  341.   #     item       : 武器 or 防具
  342.   #--------------------------------------------------------------------------
  343.   def ep_condition_clear?(equip_type, item)
  344.     return true if item == nil  # nil は解除なので OK

  345.     curr_item = equips[equip_type]
  346.     offset = (curr_item != nil ? curr_item.ep_cost : 0)
  347.     return false if self.ep < (item.ep_cost - offset)   # EP 不足

  348.     return true
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ○ 装備を修復
  352.   #--------------------------------------------------------------------------
  353.   def restore_equip
  354.     # 以前の装備品・パラメータを退避
  355.     last_equips = equips
  356.     last_hp = self.hp
  357.     last_mp = self.mp
  358.     if $imported["SkillCPSystem"]
  359.       last_battle_skill_ids = battle_skill_ids.clone
  360.     end

  361.     # 全装備解除
  362.     last_equips.each_index { |i| change_equip(i, nil) }

  363.     # 装備品・パラメータを復元
  364.     last_equips.compact.each { |item| equip_legal_slot(item) }
  365.     self.hp = last_hp
  366.     self.mp = last_mp
  367.     if $imported["SkillCPSystem"]
  368.       last_battle_skill_ids.each_with_index { |s, i| set_battle_skill(i, s) }
  369.     end
  370.     Graphics.frame_reset
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ○ 装備品を正しい箇所にセット
  374.   #     item : 武器 or 防具
  375.   #--------------------------------------------------------------------------
  376.   def equip_legal_slot(item)
  377.     if item.is_a?(RPG::Weapon)
  378.       if @weapon_id == 0
  379.         # 武器 1
  380.         change_equip(0, item)
  381.       elsif two_swords_style && @armor1_id == 0
  382.         # 武器 2 (二刀流の場合)
  383.         change_equip(1, item)
  384.       end
  385.     elsif item.is_a?(RPG::Armor)
  386.       if !two_swords_style && item.kind == equip_type[0] && @armor1_id == 0
  387.         # 先頭の防具 (二刀流でない場合)
  388.         change_equip(1, item)
  389.       else
  390.         # 装備箇所リストを作成
  391.         list = [-1, @armor2_id, @armor3_id, @armor4_id]
  392.         list += extra_armor_id
  393.         # 正しい、かつ空いている箇所にセット
  394.         equip_type.each_with_index { |kind, i|
  395.           if kind == item.kind && list[i] == 0
  396.             change_equip(i + 1, item)
  397.             break
  398.           end
  399.         }
  400.       end
  401.     end
  402.   end
  403. end

  404. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  405. #==============================================================================
  406. # ■ Window_Base
  407. #==============================================================================

  408. class Window_Base < Window
  409.   #--------------------------------------------------------------------------
  410.   # ○ EP の文字色を取得
  411.   #     actor : アクター
  412.   #--------------------------------------------------------------------------
  413.   def ep_color(actor)
  414.     return knockout_color if actor.maxep > 0 && actor.ep == 0
  415.     return normal_color
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ○ EP ゲージの色 1 の取得
  419.   #--------------------------------------------------------------------------
  420.   def ep_gauge_color1
  421.     color = KGC::EquipExtension::EP_GAUGE_START_COLOR
  422.     return (color.is_a?(Integer) ? text_color(color) : color)
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ○ EP ゲージの色 2 の取得
  426.   #--------------------------------------------------------------------------
  427.   def ep_gauge_color2
  428.     color = KGC::EquipExtension::EP_GAUGE_END_COLOR
  429.     return (color.is_a?(Integer) ? text_color(color) : color)
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ○ EP の描画
  433.   #     actor : アクター
  434.   #     x     : 描画先 X 座標
  435.   #     y     : 描画先 Y 座標
  436.   #     width : 幅
  437.   #--------------------------------------------------------------------------
  438.   def draw_actor_ep(actor, x, y, width = 120)
  439.     draw_actor_ep_gauge(actor, x, y, width)
  440.     self.contents.font.color = system_color
  441.     self.contents.draw_text(x, y, 30, WLH, Vocab::ep_a)
  442.     self.contents.font.color = ep_color(actor)
  443.     xr = x + width
  444.     if width < 120
  445.       self.contents.draw_text(xr - 40, y, 40, WLH, actor.ep, 2)
  446.     else
  447.       self.contents.draw_text(xr - 90, y, 40, WLH, actor.ep, 2)
  448.       self.contents.font.color = normal_color
  449.       self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
  450.       self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxep, 2)
  451.     end
  452.     self.contents.font.color = normal_color
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ○ EP ゲージの描画
  456.   #     actor : アクター
  457.   #     x     : 描画先 X 座標
  458.   #     y     : 描画先 Y 座標
  459.   #     width : 幅
  460.   #--------------------------------------------------------------------------
  461.   def draw_actor_ep_gauge(actor, x, y, width = 120)
  462.     gw = width * actor.ep / [actor.maxep, 1].max
  463.     gc1 = ep_gauge_color1
  464.     gc2 = ep_gauge_color2
  465.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  466.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ○ 消費 EP の描画
  470.   #     item    : 武器 or 防具
  471.   #     rect    : 描画する領域
  472.   #     enabled : 許可状態
  473.   #--------------------------------------------------------------------------
  474.   def draw_equipment_ep_cost(item, rect, enabled = true)
  475.     return if item == nil
  476.     # 消費 EP 0 を表示しない場合
  477.     return if KGC::EquipExtension::HIDE_ZERO_EP_COST && item.ep_cost == 0

  478.     color = KGC::EquipExtension::EP_COST_COLOR
  479.     self.contents.font.color = (color.is_a?(Integer) ?
  480.       text_color(color) : color)
  481.     self.contents.font.color.alpha = enabled ? 255 : 128
  482.     self.contents.draw_text(rect, item.ep_cost, 2)
  483.   end
  484. end

  485. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  486. #==============================================================================
  487. # ■ Window_Equip
  488. #==============================================================================

  489. class Window_Equip < Window_Selectable
  490.   #--------------------------------------------------------------------------
  491.   # ● リフレッシュ
  492.   #--------------------------------------------------------------------------
  493.   def refresh
  494.     self.contents.clear
  495.     @data = @actor.equips.clone
  496.     @item_max = [@data.size, @actor.armor_number + 1].min
  497.     create_contents

  498.     # 装備箇所を描画
  499.     self.contents.font.color = system_color
  500.     if @actor.two_swords_style
  501.       self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1)
  502.       self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
  503.     else
  504.       self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon)
  505.       name = armor_slot_name(@actor.equip_type[0])
  506.       self.contents.draw_text(4, WLH * 1, 92, WLH, name)
  507.     end
  508.     for i in [email protected]_number
  509.       name = armor_slot_name(@actor.equip_type[i])
  510.       self.contents.draw_text(4, WLH * (i + 1), 92, WLH, name)
  511.     end

  512.     # 装備品を描画
  513.     rect = Rect.new(92, 0, self.width - 128, WLH)
  514.     @item_max.times { |i|
  515.       rect.y = WLH * i
  516.       draw_item_name(@data[i], rect.x, rect.y)
  517.       draw_equipment_ep_cost(@data[i], rect)
  518.     }
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ○ 防具欄の名称を取得
  522.   #     kind : 種別
  523.   #--------------------------------------------------------------------------
  524.   def armor_slot_name(kind)
  525.     case kind
  526.     when 0..3
  527.       return eval("Vocab.armor#{kind + 1}")
  528.     else
  529.       return Vocab.extra_armor(kind - 4)
  530.     end
  531.   end

  532. unless $imported["ExtendedEquipScene"]
  533.   #--------------------------------------------------------------------------
  534.   # ● カーソルを 1 ページ後ろに移動
  535.   #--------------------------------------------------------------------------
  536.   def cursor_pagedown
  537.     return if Input.repeat?(Input::R)
  538.     super
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # ● カーソルを 1 ページ前に移動
  542.   #--------------------------------------------------------------------------
  543.   def cursor_pageup
  544.     return if Input.repeat?(Input::L)
  545.     super
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ● フレーム更新
  549.   #--------------------------------------------------------------------------
  550.   def update
  551.     super
  552.     return unless self.active

  553.     if Input.repeat?(Input::RIGHT)
  554.       cursor_pagedown
  555.     elsif Input.repeat?(Input::LEFT)
  556.       cursor_pageup
  557.     end
  558.   end
  559. end

  560. end

  561. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  562. #==============================================================================
  563. # ■ Window_EquipItem
  564. #==============================================================================

  565. class Window_EquipItem < Window_Item
  566.   #--------------------------------------------------------------------------
  567.   # ● リフレッシュ
  568.   #--------------------------------------------------------------------------
  569.   def refresh
  570.     @item_enabled = []
  571.     super
  572.     @data.each { |item| @item_enabled << enable?(item) }
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # ● アイテムをリストに含めるかどうか
  576.   #     item : アイテム
  577.   #--------------------------------------------------------------------------
  578.   def include?(item)
  579.     return true if item == nil
  580.     if @equip_type == 0
  581.       return false unless item.is_a?(RPG::Weapon)
  582.     else
  583.       return false unless item.is_a?(RPG::Armor)
  584.       return false unless item.kind == @equip_type - 1
  585.     end
  586.     return @actor.equippable?(item)
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● アイテムを許可状態で表示するかどうか
  590.   #     item : アイテム
  591.   #--------------------------------------------------------------------------
  592.   def enable?(item)
  593.     return false unless @actor.equippable?(item)                      # 装備不可
  594.     return false unless @actor.ep_condition_clear?(@equip_type, item)  # EP 不足

  595.     return true
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # ● 項目の描画
  599.   #     index : 項目番号
  600.   #--------------------------------------------------------------------------
  601.   def draw_item(index)
  602.     super(index)   
  603.     rect = item_rect(index)
  604.     item = @data[index]

  605.     # 個数表示分の幅を削る
  606.     cw = self.contents.text_size(sprintf(":%2d", 0)).width
  607.     rect.width -= cw + 4
  608.     draw_equipment_ep_cost(item, rect, enable?(item))
  609.   end
  610.   #--------------------------------------------------------------------------
  611.   # ○ 簡易リフレッシュ
  612.   #     equip_type : 装備部位
  613.   #--------------------------------------------------------------------------
  614.   def simple_refresh(equip_type)
  615.     # 一時的に装備部位を変更
  616.     last_equip_type = @equip_type
  617.     @equip_type = equip_type

  618.     @data.each_with_index { |item, i|
  619.       # 許可状態が変化した項目のみ再描画
  620.       if enable?(item) != @item_enabled[i]
  621.         draw_item(i)
  622.         @item_enabled[i] = enable?(item)
  623.       end
  624.     }
  625.     # 装備部位を戻す
  626.     @equip_type = last_equip_type
  627.   end
  628. end

  629. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  630. #==============================================================================
  631. # ■ Window_EquipStatus
  632. #==============================================================================

  633. class Window_EquipStatus < Window_Base
  634.   #--------------------------------------------------------------------------
  635.   # ● リフレッシュ
  636.   #--------------------------------------------------------------------------
  637.   alias refresh_KGC_EquipExtension refresh
  638.   def refresh
  639.     refresh_KGC_EquipExtension

  640.     draw_actor_ep(@actor, 120, 0, 56) if KGC::EquipExtension::USE_EP_SYSTEM
  641.   end
  642. end

  643. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  644. #==============================================================================
  645. # ■ Window_Status
  646. #==============================================================================

  647. class Window_Status < Window_Base

  648. if KGC::EquipExtension::SHOW_STATUS_EP
  649.   #--------------------------------------------------------------------------
  650.   # ● 基本情報の描画
  651.   #     x : 描画先 X 座標
  652.   #     y : 描画先 Y 座標
  653.   #--------------------------------------------------------------------------
  654.   alias draw_basic_info_KGC_EquipExtension draw_basic_info
  655.   def draw_basic_info(x, y)
  656.     draw_basic_info_KGC_EquipExtension(x, y)

  657.     draw_actor_ep(@actor, x + 160, y + WLH * 4)
  658.   end
  659. end

  660.   #--------------------------------------------------------------------------
  661.   # ● 装備品の描画
  662.   #     x : 描画先 X 座標
  663.   #     y : 描画先 Y 座標
  664.   #--------------------------------------------------------------------------
  665.   def draw_equipments(x, y)
  666.     self.contents.font.color = system_color
  667.     self.contents.draw_text(x, y, 120, WLH, Vocab::equip)

  668.     item_number = [@actor.equips.size, @actor.armor_number + 1].min
  669.     item_number.times { |i|
  670.       draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
  671.     }
  672.   end
  673. end

  674. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  675. #==============================================================================
  676. # ■ Scene_Equip
  677. #==============================================================================

  678. class Scene_Equip < Scene_Base
  679.   #--------------------------------------------------------------------------
  680.   # ● 定数
  681.   #--------------------------------------------------------------------------
  682.   EQUIP_TYPE_MAX = KGC::EquipExtension::EXTRA_EQUIP_KIND.size + 5
  683.   #--------------------------------------------------------------------------
  684.   # ● オブジェクト初期化
  685.   #     actor_index : アクターインデックス
  686.   #     equip_index : 装備インデックス
  687.   #--------------------------------------------------------------------------
  688.   alias initialize_KGC_EquipExtension initialize
  689.   def initialize(actor_index = 0, equip_index = 0)
  690.     initialize_KGC_EquipExtension(actor_index, equip_index)

  691.     unit = ($imported["LargeParty"] ?
  692.       $game_party.all_members : $game_party.members)
  693.     actor = unit[actor_index]
  694.     @equip_index = [@equip_index, actor.armor_number].min
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ● アイテムウィンドウの作成
  698.   #--------------------------------------------------------------------------
  699.   alias create_item_windows_KGC_EquipExtension create_item_windows
  700.   def create_item_windows
  701.     create_item_windows_KGC_EquipExtension

  702.     kind = equip_kind(@equip_index)
  703.     EQUIP_TYPE_MAX.times { |i|
  704.       @item_windows[i].visible = (kind == i)
  705.     }
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # ● アイテムウィンドウの更新
  709.   #--------------------------------------------------------------------------
  710.   def update_item_windows
  711.     kind = equip_kind(@equip_window.index)
  712.     for i in 0...EQUIP_TYPE_MAX
  713.       @item_windows[i].visible = (kind == i)
  714.       @item_windows[i].update
  715.     end
  716.     @item_window = @item_windows[kind]
  717.     @item_window.simple_refresh(@equip_window.index)
  718.   end
  719.   #--------------------------------------------------------------------------
  720.   # ○ 装備欄の種別を取得
  721.   #     index : 装備欄インデックス
  722.   #--------------------------------------------------------------------------
  723.   def equip_kind(index)
  724.     if index == 0
  725.       return 0
  726.     else
  727.       return @actor.equip_type[index - 1] + 1
  728.     end
  729.   end

  730. unless $imported["ExtendedEquipScene"]
  731.   #--------------------------------------------------------------------------
  732.   # ● ステータスウィンドウの更新
  733.   #--------------------------------------------------------------------------
  734.   def update_status_window
  735.     if @equip_window.active
  736.       @status_window.set_new_parameters(nil, nil, nil, nil)
  737.     elsif @item_window.active
  738.       temp_actor = Marshal.load(Marshal.dump(@actor))
  739.       temp_actor.change_equip(@equip_window.index, @item_window.item, true)
  740.       new_atk = temp_actor.atk
  741.       new_def = temp_actor.def
  742.       new_spi = temp_actor.spi
  743.       new_agi = temp_actor.agi
  744.       @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
  745.     end
  746.     @status_window.update
  747.   end
  748. end

  749.   #--------------------------------------------------------------------------
  750.   # ● アイテム選択の更新
  751.   #--------------------------------------------------------------------------
  752.   alias update_item_selection_KGC_EquipExtension update_item_selection
  753.   def update_item_selection
  754.     if Input.trigger?(Input::C)
  755.       # 装備不可能な場合
  756.       index = @equip_window.index
  757.       item = @item_window.item
  758.       unless item == nil ||
  759.           (@actor.equippable?(item) && @actor.ep_condition_clear?(index, item))
  760.         Sound.play_buzzer
  761.         return
  762.       end
  763.     end

  764.     update_item_selection_KGC_EquipExtension
  765.   end
  766. end

  767. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  768. #==============================================================================
  769. # ■ Scene_File
  770. #==============================================================================

  771. class Scene_File < Scene_Base
  772.   #--------------------------------------------------------------------------
  773.   # ● セーブデータの読み込み
  774.   #     file : 読み込み用ファイルオブジェクト (オープン済み)
  775.   #--------------------------------------------------------------------------
  776.   alias read_save_data_KGC_EquipExtension read_save_data
  777.   def read_save_data(file)
  778.     read_save_data_KGC_EquipExtension(file)

  779.     KGC::Commands.restore_equip
  780.     Graphics.frame_reset
  781.   end
  782. end
复制代码


你是缺这部分吧?
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-27 13:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表