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

Project1

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

[已经过期] 扩张脚本的问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
336 小时
注册时间
2010-8-26
帖子
428
跳转到指定楼层
1
发表于 2011-6-7 21:15:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 拡張装備画面 - KGC_ExtendedEquipScene ◆ VX ◆
  3. #_/    ◇ Last update : 2009/02/15 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  機能を強化した装備画面を作成します。
  6. #_/============================================================================
  7. #_/ 【基本機能】≪ヘルプウィンドウ機能拡張≫ より下に導入してください。
  8. #_/ 【装備】≪スキル習得装備≫ より下に導入してください。
  9. #_/ 【装備】≪装備拡張≫ より上に導入してください。
  10. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  11. $data_system = load_data("Data/System.rvdata") if $data_system == nil

  12. #==============================================================================
  13. # ★ カスタマイズ項目 - Customize BEGIN ★
  14. #==============================================================================

  15. module KGC
  16. module ExtendedEquipScene
  17.   # ◆ パラメータ名
  18.   VOCAB_PARAM = {
  19.     :hit => "命中",        # 命中率
  20.     :eva => "回避",        # 回避率
  21.     :cri => "暴击",  # クリティカル率
  22.     :exp => "经验",  # クリティカル率
  23.     :equip_chance => "幸运",  # クリティカル率
  24.   }  # ← この } は消さないこと!

  25.   # ◆ 装備変更時に表示するパラメータ   EQUIP_PARAMS = [ :maxhp, :maxmp, :atk, :def, :spi, :agi, :hit, :eva, :cri, :exp, :equip_chance ]
  26.   #  表示したい順に , で区切って記入。
  27.   #  :maxhp .. 最大 HP
  28.   #  :maxmp .. 最大 MP
  29.   #  :atk   .. 攻撃力
  30.   #  :def   .. 防御力
  31.   #  :spi   .. 精神力
  32.   #  :agi   .. 敏捷性
  33.   #  :hit   .. 命中率
  34.   #  :eva   .. 回避率
  35.   #  :cri   .. クリティカル率
  36.   #  :exp   .. 幸运值
  37.   #  :equip_chance   .. ク高级掉宝率 equip_chance
  38.   EQUIP_PARAMS = [ :maxhp, :maxmp,:atk, :def, :spi, :agi, :hit, :eva, :cri,:equip_chance ]

  39.   # ◆ 拡張装備コマンドを使用する
  40.   #  true  : 「最強装備」「すべて外す」コマンドを使用可能
  41.   #  false : 装備変更のみ
  42.   USE_COMMAND_WINDOW = false
  43.   # ◆ 装備画面のコマンド名
  44.   COMMANDS = [
  45.     "装備変更",    # 装備変更
  46.     "最強装備",    # 最強装備
  47.     "すべて外す",  # すべて外す
  48.   ]  # ← この ] は消さないこと!
  49.   # ◆ 装備画面コマンドのヘルプ
  50.   COMMAND_HELP = [
  51.     "装備変更",            # 装備変更
  52.     "最も強力な武具を装備します。",  # 最強装備
  53.     "すべての武具を外します。",      # すべて外す
  54.   ]  # ← この ] は消さないこと!

  55.   # ◆ 最強装備を行わない装備種別
  56.   #  最強装備から除外する装備種別を記述。
  57.   #  -1..武器  0..盾  1..頭  2..身体  3..装飾品  4~..≪装備拡張≫ で定義
  58.   IGNORE_STRONGEST_KIND = [3, 5]

  59.   # ◆ 最強武器選択時のパラメータ優先順位
  60.   #  優先順位の高い順に , で区切って記入。
  61.   #  :atk .. 攻撃力
  62.   #  :def .. 防御力
  63.   #  :spi .. 精神力
  64.   #  :agi .. 敏捷性
  65.   STRONGEST_WEAPON_PARAM_ORDER = [ :atk, :spi, :agi, :def ]
  66.   # ◆ 最強防具選択時のパラメータ優先順位
  67.   #  指定方法は武器と同じ。
  68.   STRONGEST_ARMOR_PARAM_ORDER  = [ :def, :spi, :agi, :atk ]

  69.   # ◆ AP ウィンドウを使用する
  70.   #  true  : 使用する
  71.   #  false : 使用しない
  72.   #  ≪スキル習得装備≫ 併用時のみ有効。
  73.   SHOW_AP_WINDOW    = true
  74.   # ◆ AP ウィンドウに表示するスキル数
  75.   #  多くしすぎすると表示がバグります。
  76.   #  (4 以下を推奨)
  77.   AP_WINDOW_SKILLS  = 4
  78.   # ◆ AP ウィンドウの習得スキル名のキャプション
  79.   AP_WINDOW_CAPTION = "習得#{Vocab.skill}"
  80.   # ◆ AP ウィンドウの表示切り替えボタン
  81.   #  このボタンを押すと、AP ウィンドウの表示/非表示が切り替わる。
  82.   AP_WINDOW_BUTTON  = Input::X
  83. end
  84. end

  85. #==============================================================================
  86. # ☆ カスタマイズ項目 終了 - Customize END ☆
  87. #==============================================================================

  88. $imported = {} if $imported == nil
  89. $imported["ExtendedEquipScene"] = true

  90. module KGC::ExtendedEquipScene
  91.   # パラメータ取得用 Proc
  92.   GET_PARAM_PROC = {
  93.     :atk => Proc.new { |n| n.atk },
  94.     :def => Proc.new { |n| n.def },
  95.     :spi => Proc.new { |n| n.spi },
  96.     :agi => Proc.new { |n| n.agi },
  97.     :exp => Proc.new { |n| n.exp },
  98.     :equip_chance => Proc.new { |n| n.equip_chance },
  99.   }
  100.   # 最強アイテム用構造体
  101.   StrongestItem = Struct.new("StrongestItem", :index, :item)
  102. end

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

  104. #==============================================================================
  105. # ■ Vocab
  106. #==============================================================================

  107. module Vocab
  108.   # 命中率
  109.   def self.hit
  110.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:hit]
  111.   end

  112.   # 回避率
  113.   def self.eva
  114.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:eva]
  115.   end

  116.   # クリティカル率
  117.   def self.cri
  118.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:cri]
  119.   end
  120.     # 回避率
  121.   def self.exp
  122.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:exp]
  123.   end

  124.   # クリティカル率
  125.   def self.equip_chance
  126.     return KGC::ExtendedEquipScene::VOCAB_PARAM[:equip_chance]
  127.   end
  128. end

  129. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  130. #==============================================================================
  131. # □ Window_ExtendedEquipCommand
  132. #------------------------------------------------------------------------------
  133. #   拡張装備画面で、実行する操作を選択するウィンドウです。
  134. #==============================================================================

  135. class Window_ExtendedEquipCommand < Window_Command
  136.   #--------------------------------------------------------------------------
  137.   # ● オブジェクト初期化
  138.   #--------------------------------------------------------------------------
  139.   def initialize
  140.     super(160, KGC::ExtendedEquipScene::COMMANDS)
  141.     self.active = false
  142.     self.z = 1000
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● ヘルプウィンドウの更新
  146.   #--------------------------------------------------------------------------
  147.   def update_help
  148.     @help_window.set_text(KGC::ExtendedEquipScene::COMMAND_HELP[self.index])
  149.   end
  150. end

  151. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  152. #==============================================================================
  153. # □ Window_EquipBaseInfo
  154. #------------------------------------------------------------------------------
  155. #   装備画面で、アクターの基本情報を表示するウィンドウです。
  156. #==============================================================================

  157. class Window_EquipBaseInfo < Window_Base
  158.   #--------------------------------------------------------------------------
  159.   # ● オブジェクト初期化
  160.   #     x     : ウィンドウの X 座標
  161.   #     y     : ウィンドウの Y 座標
  162.   #     actor : アクター
  163.   #--------------------------------------------------------------------------
  164.   def initialize(x, y, actor)
  165.     super(x, y, Graphics.width / 2, WLH + 32)
  166.     @actor = actor
  167.     refresh
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● リフレッシュ
  171.   #--------------------------------------------------------------------------
  172.   def refresh
  173.     self.contents.clear
  174.     draw_actor_name(@actor, 0, 0)
  175. #把下面的东西放在Window_Status的21行下
  176. case @actor.id
  177. #可以利用这个来设定不同角色,对应的图片名称
  178.        when 1 #角色1
  179.      i = "状态界面-流"
  180.        when 2 #角色2 以when x 类推
  181.      i = "状态界面-蕾雅娜"
  182.        when 3 #角色1
  183.      i = "状态界面-依莉娜"
  184.        when 4 #角色2 以when x 类推
  185.      i = "EnemyGuideBack_100628887"
  186.      end
  187.       bitmap = Cache.picture(i)
  188.       rect = Rect.new(0,0,bitmap.width,bitmap.height)
  189.    self.contents.blt(x, y, bitmap, rect)#x y 这些可以来调位置
  190.     # EP 制を使用する場合は EP を描画
  191.     if $imported["EquipExtension"] && KGC::EquipExtension::USE_EP_SYSTEM
  192.       draw_actor_ep(@actor, 116, 0, Graphics.width / 2 - 148)
  193.     end
  194.   end
  195. end

  196. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  197. #==============================================================================
  198. # ■ Window_Equip
  199. #==============================================================================

  200. class Window_Equip < Window_Selectable

  201.   unless KGC::ExtendedEquipScene::USE_COMMAND_WINDOW

  202.   #--------------------------------------------------------------------------
  203.   # ● カーソルを 1 ページ後ろに移動
  204.   #--------------------------------------------------------------------------
  205.   def cursor_pagedown
  206.     return if Input.repeat?(Input::R)
  207.     super
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● カーソルを 1 ページ前に移動
  211.   #--------------------------------------------------------------------------
  212.   def cursor_pageup
  213.     return if Input.repeat?(Input::L)
  214.     super
  215.   end

  216.   end  # <-- unless KGC::ExtendedEquipScene::USE_COMMAND_WINDOW

  217.   #--------------------------------------------------------------------------
  218.   # ● フレーム更新
  219.   #--------------------------------------------------------------------------
  220.   def update
  221.     super
  222.     return unless self.active

  223.     if Input.repeat?(Input::RIGHT)
  224.       Sound.play_cursor
  225.       cursor_pagedown
  226.     elsif Input.repeat?(Input::LEFT)
  227.       Sound.play_cursor
  228.       cursor_pageup
  229.     end
  230.   end
  231. end

  232. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  233. #==============================================================================
  234. # ■ Window_EquipItem
  235. #==============================================================================

  236. class Window_EquipItem < Window_Item
  237.   #--------------------------------------------------------------------------
  238.   # ● オブジェクト初期化
  239.   #     x          : ウィンドウの X 座標
  240.   #     y          : ウィンドウの Y 座標
  241.   #     width      : ウィンドウの幅
  242.   #     height     : ウィンドウの高さ
  243.   #     actor      : アクター
  244.   #     equip_type : 装備部位
  245.   #--------------------------------------------------------------------------
  246.   alias initialize_KGC_ExtendedEquipScene initialize
  247.   def initialize(x, y, width, height, actor, equip_type)
  248.     width = Graphics.width / 2

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

  250.     @column_max = 1
  251.     refresh
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● リフレッシュ
  255.   #--------------------------------------------------------------------------
  256.   alias refresh_KGC_ExtendedEquipScene refresh  unless $@
  257.   def refresh
  258.     return if @column_max == 2  # 無駄な描画はしない

  259.     refresh_KGC_ExtendedEquipScene
  260.   end
  261. end

  262. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  263. #==============================================================================
  264. # □ Window_ExtendedEquipStatus
  265. #------------------------------------------------------------------------------
  266. #   拡張装備画面で、アクターの能力値変化を表示するウィンドウです。
  267. #==============================================================================

  268. class Window_ExtendedEquipStatus < Window_EquipStatus
  269.   #--------------------------------------------------------------------------
  270.   # ○ 公開インスタンス変数
  271.   #--------------------------------------------------------------------------
  272.   attr_writer   :equip_type               # 装備タイプ
  273.   #--------------------------------------------------------------------------
  274.   # ● オブジェクト初期化
  275.   #     x     : ウィンドウの X 座標
  276.   #     y     : ウィンドウの Y 座標
  277.   #     actor : アクター
  278.   #--------------------------------------------------------------------------
  279.   def initialize(x, y, actor)
  280.     @equip_type = -1
  281.     @caption_cache = nil
  282.     super(x, y, actor)
  283.     @new_item = nil
  284.     @new_param = {}
  285.     refresh
  286.   end
  287.   #--------------------------------------------------------------------------
  288.   # ● 解放
  289.   #--------------------------------------------------------------------------
  290.   def dispose
  291.     super
  292.     @caption_cache.dispose if @caption_cache != nil
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● ウィンドウ内容の作成
  296.   #--------------------------------------------------------------------------
  297.   def create_contents
  298.     self.contents.dispose
  299.     self.contents = Bitmap.new(Graphics.width / 2 - 32, height - 32)
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ● リフレッシュ
  303.   #--------------------------------------------------------------------------
  304.   def refresh
  305.     return if @equip_type < 0

  306.     if @caption_cache == nil
  307.       create_cache
  308.     else
  309.       self.contents.clear
  310.       self.contents.blt(0, 0, @caption_cache, @caption_cache.rect)
  311.     end
  312.     draw_item_name(@actor.equips[@equip_type], 0, 0)
  313.     draw_item_name(@new_item, 24, WLH)
  314.     KGC::ExtendedEquipScene::EQUIP_PARAMS.each_with_index { |param, i|
  315.       draw_parameter(0, WLH * (i + 2), param)
  316.     }
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ○ キャッシュ生成
  320.   #--------------------------------------------------------------------------
  321.   def create_cache
  322.     create_contents

  323.     self.contents.font.color = system_color
  324.     self.contents.draw_text(0, WLH, 20, WLH, "→")
  325.     # パラメータ描画
  326.     KGC::ExtendedEquipScene::EQUIP_PARAMS.each_with_index { |param, i|
  327.       draw_parameter_name(0, WLH * (i + 2), param)
  328.     }

  329.     @caption_cache = Bitmap.new(self.contents.width, self.contents.height)
  330.     @caption_cache.blt(0, 0, self.contents, self.contents.rect)
  331.   end
  332.   #--------------------------------------------------------------------------
  333.   # ○ 能力値名の描画
  334.   #     x    : 描画先 X 座標
  335.   #     y    : 描画先 Y 座標
  336.   #     type : 能力値の種類
  337.   #--------------------------------------------------------------------------
  338.   def draw_parameter_name(x, y, type)
  339.     case type
  340.     when :maxhp
  341.       name = Vocab.hp
  342.     when :maxmp
  343.       name = Vocab.mp
  344.     when :atk
  345.       name = Vocab.atk
  346.     when :def
  347.       name = Vocab.def
  348.     when :spi
  349.       name = Vocab.spi
  350.     when :agi
  351.       name = Vocab.agi
  352.     when :hit
  353.       name = Vocab.hit
  354.     when :eva
  355.       name = Vocab.eva
  356.     when :cri
  357.       name = Vocab.cri
  358.     when :exp
  359.       name = Vocab.exp
  360.     when :equip_chance
  361.       name = Vocab.equip_chance
  362.     end
  363.     self.contents.font.color = system_color
  364.         self.contents.font.size = 20
  365.     self.contents.draw_text(x + 4, y, 96, WLH, name)
  366.     self.contents.font.color = system_color
  367.     self.contents.draw_text(x + 156, y, 20, WLH, "→", 1)
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # ● 装備変更後の能力値設定equip_chance
  371.   #     new_param : 装備変更後のパラメータの配列
  372.   #     new_item  : 変更後の装備
  373.   #--------------------------------------------------------------------------
  374.   def set_new_parameters(new_param, new_item)
  375.     changed = false
  376.     # パラメータ変化判定
  377.     KGC::ExtendedEquipScene::EQUIP_PARAMS.each { |k|
  378.       if @new_param[k] != new_param[k]
  379.         changed = true
  380.         break
  381.       end
  382.     }
  383.     changed |= (@new_item != new_item)

  384.     if changed
  385.       @new_item = new_item
  386.       @new_param = new_param
  387.       refresh
  388.     end
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● 能力値の描画
  392.   #     x    : 描画先 X 座標
  393.   #     y    : 描画先 Y 座標
  394.   #     type : 能力値の種類
  395.   #--------------------------------------------------------------------------
  396.   def draw_parameter(x, y, type)
  397.     case type
  398.     when :maxhp
  399.       value = @actor.maxhp
  400.          parameter_value = @actor.maxhp
  401.             gw = 70 * parameter_value / 5000
  402.       gc1 = text_color(10)
  403.       gc2 = text_color(10)
  404.     when :maxmp
  405.       value = @actor.maxmp
  406.       parameter_value = @actor.maxmp
  407.             gw = 70 * parameter_value / 3000
  408.       gc1 = text_color(9)
  409.       gc2 = text_color(9)
  410.     when :atk
  411.       value = @actor.atk
  412.       parameter_value = @actor.atk
  413.             gw = 70 * parameter_value / 400
  414.       gc1 = text_color(2)
  415.       gc2 = text_color(2)
  416.     when :def
  417.       value = @actor.def
  418.       parameter_value = @actor.def
  419.             gw = 70 * parameter_value / 400
  420.       gc1 = text_color(3)
  421.       gc2 = text_color(3)
  422.     when :spi
  423.       value = @actor.spi
  424.       parameter_value = @actor.spi
  425.             gw = 70 * parameter_value / 400
  426.       gc1 = text_color(5)
  427.       gc2 = text_color(5)
  428.     when :agi
  429.       value = @actor.agi
  430.       parameter_value = @actor.agi
  431.             gw = 70 * parameter_value / 400
  432.       gc1 = text_color(4)
  433.       gc2 = text_color(4)
  434.     when :hit
  435.       value = @actor.hit
  436.       parameter_value = @actor.hit
  437.             gw = 70 * parameter_value / 400
  438.       gc1 = text_color(1)
  439.       gc2 = text_color(1)
  440.     when :eva
  441.       value = @actor.eva
  442.       parameter_value = @actor.eva
  443.             gw = 70 * parameter_value / 200
  444.       gc1 = text_color(6)
  445.       gc2 = text_color(6)
  446.     when :cri
  447.       value = @actor.cri
  448.       parameter_value = @actor.cri
  449.             gw = 70 * parameter_value / 150
  450.       gc1 = text_color(8)
  451.       gc2 = text_color(8)
  452.     when :exp
  453.       value = @actor.exp
  454.       parameter_value = @actor.exp
  455.             gw = 70 * parameter_value / 150
  456.       gc1 = text_color(3)
  457.       gc2 = text_color(3)
  458.     when :equip_chance
  459.       value = @actor.equip_chance
  460.       parameter_value = @actor.equip_chance
  461.             gw = 70 * parameter_value / 100
  462.       gc1 = text_color(9)
  463.       gc2 = text_color(9)
  464.     end
  465.     new_value = @new_param[type]
  466.     self.contents.font.color = system_color
  467.      self.contents.font.size = 20
  468.     self.contents.draw_text(x + 106, y, 48, WLH, value, 2)
  469.     if new_value != nil
  470.       self.contents.font.color = new_parameter_color(value, new_value)
  471.       self.contents.draw_text(x + 176, y, 48, WLH, new_value, 2)
  472.     end
  473.         self.contents.fill_rect(50, y + WLH - 16, gw-5, 20, gauge_back_color)#x表示“黑槽20”
  474.     self.contents.gradient_fill_rect(50, y + WLH - 21, gw, 16, gc1, gc2)
  475.     self.contents.font.color = normal_color
  476. #=   self.contents.draw_text(x, y + 3, 120, WLH, parameter_name)#x表示“攻击”
  477.     self.contents.font.color = normal_color
  478. #=  normal_color   new_value    self.contents.draw_text(x + 187, y + 3, 36, WLH, parameter_value, 2)#x表示“数字”
  479.   end
  480. end

  481. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  482. #==============================================================================
  483. # □ Window_ExtendedEquipAPViewer
  484. #------------------------------------------------------------------------------
  485. #   拡張装備画面で、習得スキルを表示するウィンドウです。
  486. #==============================================================================

  487. if $imported["EquipLearnSkill"]
  488. class Window_ExtendedEquipAPViewer < Window_APViewer
  489.   #--------------------------------------------------------------------------
  490.   # ● 公開インスタンス変数
  491.   #--------------------------------------------------------------------------
  492.   attr_reader   :item                     # 表示対象のアイテム
  493.   #--------------------------------------------------------------------------
  494.   # ● オブジェクト初期化
  495.   #     x      : ウィンドウの X 座標
  496.   #     y      : ウィンドウの Y 座標
  497.   #     width  : ウィンドウの幅
  498.   #     height : ウィンドウの高さ
  499.   #     actor  : アクター
  500.   #--------------------------------------------------------------------------
  501.   def initialize(x, y, width, height, actor)
  502.     @item = nil
  503.     super
  504.     self.index = -1
  505.     self.active = false
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ○ アイテム設定
  509.   #--------------------------------------------------------------------------
  510.   def item=(new_item)
  511.     @item = new_item
  512.     refresh
  513.   end
  514.   #--------------------------------------------------------------------------
  515.   # ○ リフレッシュ
  516.   #--------------------------------------------------------------------------
  517.   def refresh
  518.     @data = []
  519.     @can_gain_ap_skills = @actor.can_gain_ap_skills
  520.     @equipment_skills = @actor.equipment_skills(true)

  521.     skills = (@item == nil ? [] : @item.learn_skills)
  522.     skills.each { |i|
  523.       @data << $data_skills[i]
  524.     }
  525.     @item_max = @data.size
  526.     create_contents
  527.     draw_caption
  528.     @item_max.times { |i| draw_item(i) }
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ○ キャプションを描画
  532.   #--------------------------------------------------------------------------
  533.   def draw_caption
  534.     self.contents.font.color = system_color
  535.     self.contents.draw_text(0, 0, width - 96, WLH,
  536.       KGC::ExtendedEquipScene::AP_WINDOW_CAPTION, 1)
  537.     self.contents.draw_text(width - 96, 0, 64, WLH, Vocab.ap, 1)
  538.     self.contents.font.color = normal_color
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # ○ スキルをマスク表示するかどうか
  542.   #     skill : スキル
  543.   #--------------------------------------------------------------------------
  544.   def mask?(skill)
  545.     return false
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ○ 項目の描画
  549.   #     index : 項目番号
  550.   #--------------------------------------------------------------------------
  551.   def draw_item(index)
  552.     rect = item_rect(index)
  553.     rect.y += WLH
  554.     self.contents.clear_rect(rect)
  555.     skill = @data[index]
  556.     if skill != nil
  557.       draw_item_name(skill, rect.x, rect.y)
  558.       if skill.need_ap > 0
  559.         if @actor.ap_full?(skill) || @actor.skill_learn?(skill)
  560.           # マスター
  561.           text = Vocab.full_ap_skill
  562.         else
  563.           # AP 蓄積中
  564.           text = sprintf("%4d/%4d", @actor.skill_ap(skill.id), skill.need_ap)
  565.         end
  566.       end
  567.       # AP を描画
  568.       rect.x = rect.width - 80
  569.       rect.width = 80
  570.       self.contents.font.color = normal_color
  571.       self.contents.draw_text(rect, text, 2)
  572.     end
  573.   end
  574. end
  575. end  # <-- if $imported["EquipLearnSkill"]

  576. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  577. #==============================================================================
  578. # ■ Scene_Equip
  579. #==============================================================================

  580. class Scene_Equip < Scene_Base
  581.   #--------------------------------------------------------------------------
  582.   # ○ 定数
  583.   #--------------------------------------------------------------------------
  584.   STANDARD_WIDTH  = Graphics.width / 2
  585.   ANIMATION_SPPED = 8
  586.   #--------------------------------------------------------------------------
  587.   # ● 開始処理
  588.   #--------------------------------------------------------------------------
  589.   alias start_KGC_ExtendedEquipScene start
  590.   def start
  591.     start_KGC_ExtendedEquipScene

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

  595.     create_command_window

  596.     @last_item = RPG::Weapon.new
  597.     @base_info_window = Window_EquipBaseInfo.new(
  598.       0, @help_window.height, @actor)

  599.     if $imported["EquipLearnSkill"] && KGC::ExtendedEquipScene::SHOW_AP_WINDOW
  600.       @ap_window = Window_ExtendedEquipAPViewer.new(0, 0, 64, 64, @actor)
  601.     end

  602.     adjust_window_for_extended_equiop_scene
  603.     Graphics.frame_reset
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ○ ウィンドウの座標・サイズを拡張装備画面向けに調整
  607.   #--------------------------------------------------------------------------
  608.   def adjust_window_for_extended_equiop_scene
  609.     @base_info_window.width = @equip_window.width

  610.     @equip_window.x = 0
  611.     @equip_window.y = @base_info_window.y + @base_info_window.height
  612.     @equip_window.height = Graphics.height - @equip_window.y
  613.     @equip_window.active = false
  614.     @equip_window.z = 100

  615.     @status_window.x = 0
  616.     @status_window.y = 100
  617.     @status_window.width = STANDARD_WIDTH
  618.     @status_window.height = 320
  619.     @status_window.visible = false
  620.     @status_window.z = 100

  621.     @item_windows.each { |window|
  622.       window.x = @equip_window.width
  623.       window.y = @help_window.height
  624.       window.z = 50
  625.       window.height = Graphics.height - @help_window.height
  626.     }

  627.     if @ap_window != nil
  628.       @ap_window.width = @item_windows[0].width
  629.       @ap_window.height =
  630.         (KGC::ExtendedEquipScene::AP_WINDOW_SKILLS + 1) * Window_Base::WLH + 32
  631.       @ap_window.x = @equip_window.width
  632.       @ap_window.y = Graphics.height - @ap_window.height
  633.       @ap_window.z = @item_windows[0].z + 20
  634.       @ap_window.refresh
  635.     end

  636.     # コマンドウィンドウ不使用の場合@equip_window.y
  637.     unless KGC::ExtendedEquipScene::USE_COMMAND_WINDOW
  638.       @command_window.visible = false
  639.       @command_window.active = false
  640.       @equip_window.active = true
  641.       @equip_window.call_update_help
  642.     end
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ○ コマンドウィンドウの作成
  646.   #--------------------------------------------------------------------------
  647.   def create_command_window
  648.     @command_window = Window_ExtendedEquipCommand.new
  649.     @command_window.help_window = @help_window
  650.     @command_window.active = true
  651.     @command_window.x = (Graphics.width - @command_window.width) / 2
  652.     @command_window.y = (Graphics.height - @command_window.height) / 2
  653.     @command_window.update_help

  654.     # 装備固定なら「最強装備」「すべて外す」を無効化
  655.     if @actor.fix_equipment
  656.       @command_window.draw_item(1, false)
  657.       @command_window.draw_item(2, false)
  658.     end
  659.   end
  660.   #--------------------------------------------------------------------------
  661.   # ● 終了処理
  662.   #--------------------------------------------------------------------------
  663.   alias terminate_KGC_ExtendedEquipScene terminate
  664.   def terminate
  665.     terminate_KGC_ExtendedEquipScene

  666.     @command_window.dispose
  667.     @base_info_window.dispose
  668.     @ap_window.dispose if @ap_window != nil
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # ○ ウィンドウをリフレッシュ
  672.   #--------------------------------------------------------------------------
  673.   def refresh_window
  674.     @base_info_window.refresh
  675.     @equip_window.refresh
  676.     @status_window.refresh
  677.     @item_windows.each { |window| window.refresh }
  678.     @ap_window.refresh if @ap_window != nil
  679.     Graphics.frame_reset
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # ● フレーム更新
  683.   #--------------------------------------------------------------------------
  684.   alias update_KGC_ExtendedEquipScene update
  685.   def update
  686.     update_command_window
  687.     if @command_window.active
  688.       update_KGC_ExtendedEquipScene
  689.       update_command_selection
  690.     else
  691.       update_KGC_ExtendedEquipScene
  692.       update_ap_window
  693.     end
  694.   end
  695.   #--------------------------------------------------------------------------
  696.   # ○ コマンドウィンドウの更新
  697.   #--------------------------------------------------------------------------
  698.   def update_command_window
  699.     @command_window.update
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● ステータスウィンドウの更新
  703.   #--------------------------------------------------------------------------
  704.   def update_status_window
  705.     @base_info_window.update
  706.     @status_window.update

  707.     if @command_window.active || @equip_window.active
  708.       @status_window.set_new_parameters({}, nil)
  709.     elsif @item_window.active
  710.       return if @last_item == @item_window.item

  711.       @last_item = @item_window.item
  712.       temp_actor = Marshal.load(Marshal.dump(@actor))
  713.       temp_actor.change_equip(@equip_window.index, @item_window.item, true)
  714.       param = {
  715.         :maxhp => temp_actor.maxhp,
  716.         :maxmp => temp_actor.maxmp,
  717.         :atk   => temp_actor.atk,
  718.         :def   => temp_actor.def,
  719.         :spi   => temp_actor.spi,
  720.         :agi   => temp_actor.agi,
  721.         :hit   => temp_actor.hit,
  722.         :eva   => temp_actor.eva,
  723.         :cri   => temp_actor.cri,
  724.         :exp   => temp_actor.exp,
  725.         :equip_chance   => temp_actor.equip_chance,
  726.       }
  727.       @status_window.equip_type = @equip_window.index
  728.       @status_window.set_new_parameters(param, @last_item)
  729.       Graphics.frame_reset
  730.     end
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # ○ AP ウィンドウの更新equip_chance
  734.   #--------------------------------------------------------------------------
  735.   def update_ap_window
  736.     return if @ap_window == nil

  737.     # 表示/非表示切り替え
  738.     button = KGC::ExtendedEquipScene::AP_WINDOW_BUTTON
  739.     if button != nil && Input.trigger?(button)
  740.       Sound.play_decision
  741.       if @ap_window.openness == 255
  742.         @ap_window.close
  743.       else
  744.         @ap_window.open
  745.       end
  746.     end

  747.     # 表示内容更新
  748.     @ap_window.update
  749.     new_item = (@equip_window.active ? @equip_window.item : @item_window.item)
  750.     @ap_window.item = new_item if @ap_window.item != new_item

  751.     # 位置更新
  752.     ay = @ap_window.y
  753.     ayb = @ap_window.y + @ap_window.height  # AP window: Bottom
  754.     cy = @item_window.y + 16
  755.     cy += @item_window.cursor_rect.y if @item_window.active
  756.     cyb = cy + Window_Base::WLH             # Cursor rect: Bottom
  757.     bottom = (ay != @item_window.y)
  758.     if bottom
  759.       # 下で被る
  760.       @ap_window.y = @item_window.y if ay < cyb
  761.     else
  762.       # 上で被る
  763.       @ap_window.y = Graphics.height - @ap_window.height if cy < ayb
  764.     end
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # ○ コマンド選択の更新
  768.   #--------------------------------------------------------------------------
  769.   def update_command_selection
  770.     update_window_position_for_equip_selection
  771.     if Input.trigger?(Input::B)
  772.       Sound.play_cancel
  773.       return_scene
  774.     elsif Input.trigger?(Input::R)
  775.       Sound.play_cursor
  776.       next_actor
  777.     elsif Input.trigger?(Input::L)
  778.       Sound.play_cursor
  779.       prev_actor
  780.     elsif Input.trigger?(Input::C)
  781.       case @command_window.index
  782.       when 0  # 装備変更
  783.         Sound.play_decision
  784.         # 装備部位ウィンドウに切り替え
  785.         @equip_window.active   = true
  786.         @command_window.active = false
  787.         @command_window.close
  788.       when 1  # 最強装備
  789.         if @actor.fix_equipment
  790.           Sound.play_buzzer
  791.           return
  792.         end
  793.         Sound.play_equip
  794.         process_equip_strongest
  795.       when 2  # すべて外す
  796.         if @actor.fix_equipment
  797.           Sound.play_buzzer
  798.           return
  799.         end
  800.         Sound.play_equip
  801.         process_remove_all
  802.       end
  803.     end
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ● 装備部位選択の更新
  807.   #--------------------------------------------------------------------------
  808.   alias update_equip_selection_KGC_ExtendedEquipScene update_equip_selection
  809.   def update_equip_selection
  810.     update_window_position_for_equip_selection
  811.     if Input.trigger?(Input::A)
  812.       if @actor.fix_equipment
  813.         Sound.play_buzzer
  814.         return
  815.       end
  816.       # 選択している装備品を外す
  817.       Sound.play_equip
  818.       @actor.change_equip(@equip_window.index, nil)
  819.       refresh_window
  820.     elsif Input.trigger?(Input::B)
  821.       Sound.play_cancel
  822.       if KGC::ExtendedEquipScene::USE_COMMAND_WINDOW
  823.         show_command_window
  824.       else
  825.         # コマンドウィンドウ不使用なら終了
  826.         return_scene
  827.       end
  828.       return
  829.     elsif Input.trigger?(Input::R)
  830.       unless KGC::ExtendedEquipScene::USE_COMMAND_WINDOW
  831.         # コマンドウィンドウ不使用時のみ切り替え
  832.         Sound.play_cursor
  833.         next_actor
  834.         return
  835.       end
  836.     elsif Input.trigger?(Input::L)
  837.       unless KGC::ExtendedEquipScene::USE_COMMAND_WINDOW
  838.         # コマンドウィンドウ不使用時のみ切り替え
  839.         Sound.play_cursor
  840.         prev_actor
  841.         return
  842.       end
  843.     elsif Input.trigger?(Input::C)
  844.       # 前回のアイテムをダミーにする
  845.       @last_item = RPG::Weapon.new
  846.     end

  847.     update_equip_selection_KGC_ExtendedEquipScene
  848.   end
  849.   #--------------------------------------------------------------------------
  850.   # ○ コマンドウィンドウに切り替え
  851.   #--------------------------------------------------------------------------
  852.   def show_command_window
  853.     @equip_window.active   = false
  854.     @command_window.active = true
  855.     @command_window.open
  856.   end
  857.   #--------------------------------------------------------------------------
  858.   # ● アイテム選択の更新
  859.   #--------------------------------------------------------------------------
  860.   alias update_item_selection_KGC_ExtendedEquipScene update_item_selection
  861.   def update_item_selection
  862.     update_window_position_for_item_selection

  863.     update_item_selection_KGC_ExtendedEquipScene

  864.     if Input.trigger?(Input::C)
  865.       @base_info_window.refresh
  866.     end
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ○ ウィンドウ位置の更新 (装備部位選択)
  870.   #--------------------------------------------------------------------------
  871.   def update_window_position_for_equip_selection
  872.     return if @item_window.x == @equip_window.width

  873.     @base_info_window.width = @equip_window.width
  874.     @item_window.x = [@item_window.x + ANIMATION_SPPED, @equip_window.width].min
  875.     if @ap_window != nil
  876.       @ap_window.x = @item_window.x
  877.     end
  878.     @equip_window.visible  = true
  879.     @status_window.visible = false
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # ○ ウィンドウ位置の更新 (アイテム選択)
  883.   #--------------------------------------------------------------------------
  884.   def update_window_position_for_item_selection
  885.     return if @item_window.x == STANDARD_WIDTH

  886.     @base_info_window.width = STANDARD_WIDTH
  887.     @item_window.x = [@item_window.x - ANIMATION_SPPED, STANDARD_WIDTH].max
  888.     if @ap_window != nil
  889.       @ap_window.x = @item_window.x
  890.     end
  891.     @equip_window.visible  = false
  892.     @status_window.visible = true
  893.   end
  894.   #--------------------------------------------------------------------------
  895.   # ○ 最強装備の処理
  896.   #--------------------------------------------------------------------------
  897.   def process_equip_strongest
  898.     # 以前のパラメータを保存
  899.     last_hp = @actor.hp
  900.     last_mp = @actor.mp
  901.     # 最強装備対象の種別を取得
  902.     types = [-1]
  903.     types += ($imported["EquipExtension"] ? @actor.equip_type : [0, 1, 2, 3])
  904.     ignore_types   = KGC::ExtendedEquipScene::IGNORE_STRONGEST_KIND.clone
  905.     judged_indices = []
  906.     weapon_range   = 0..(@actor.two_swords_style ? 1 : 0)

  907.     # 装備対象の武具をすべて外す
  908.     types.each_with_index { |t, i|
  909.       @actor.change_equip(i, nil) unless ignore_types.include?(t)
  910.     }

  911.     # 最強武器装備
  912.     weapon_range.each { |i|
  913.       judged_indices << i
  914.       # 1本目が両手持ちの場合は2本目を装備しない
  915.       if @actor.two_swords_style
  916.         weapon = @actor.weapons[0]
  917.         next if weapon != nil && weapon.two_handed
  918.       end
  919.       weapon = get_strongest_weapon(i)
  920.       @actor.change_equip(i, weapon) if weapon != nil
  921.     }

  922.     # 両手持ち武器を持っている場合は盾 (防具1) を装備しない
  923.     weapon = @actor.weapons[0]
  924.     if weapon != nil && weapon.two_handed
  925.       judged_indices |= [1]
  926.     end

  927.     # 最強防具装備
  928.     exist = true
  929.     while exist
  930.       strongest = get_strongest_armor(types, ignore_types, judged_indices)
  931.       if strongest != nil
  932.         @actor.change_equip(strongest.index, strongest.item)
  933.         judged_indices << strongest.index
  934.       else
  935.         exist = false
  936.       end
  937.     end

  938.     # 以前のパラメータを復元
  939.     @actor.hp = last_hp
  940.     @actor.mp = last_mp

  941.     refresh_window
  942.   end
  943.   #--------------------------------------------------------------------------
  944.   # ○ 最も強力な武器を取得
  945.   #     equip_type : 装備部位
  946.   #    該当するアイテムがなければ nil を返す。
  947.   #--------------------------------------------------------------------------
  948.   def get_strongest_weapon(equip_type)
  949.     # 装備可能な武器を取得
  950.     equips = $game_party.items.find_all { |item|
  951.       valid = item.is_a?(RPG::Weapon) && @actor.equippable?(item)
  952.       if valid && $imported["EquipExtension"]
  953.         valid = @actor.ep_condition_clear?(equip_type, item)
  954.       end
  955.       valid
  956.     }
  957.     return nil if equips.empty?

  958.     param_order = KGC::ExtendedEquipScene::STRONGEST_WEAPON_PARAM_ORDER
  959.     return get_strongest_item(equips, param_order)
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ○ 最も強力なアイテムを取得
  963.   #     equips      : 装備品リスト
  964.   #     param_order : パラメータ優先順位
  965.   #--------------------------------------------------------------------------
  966.   def get_strongest_item(equips, param_order)
  967.     result = []
  968.     param_order.each { |param|
  969.       # パラメータ順にソート
  970.       get_proc = KGC::ExtendedEquipScene::GET_PARAM_PROC[param]
  971.       equips   = equips.sort_by { |item| -get_proc.call(item) }
  972.       # 最もパラメータが高いアイテムを取得
  973.       highest = equips[0]
  974.       result  = equips.find_all { |item|
  975.         get_proc.call(highest) == get_proc.call(item)
  976.       }
  977.       # 候補が1つに絞れたら終了
  978.       break if result.size == 1
  979.       equips = result.clone
  980.     }

  981.     # 最も ID が大きいアイテムを取得
  982.     return (result.sort_by { |v| -v.id })[0]
  983.   end
  984.   #--------------------------------------------------------------------------
  985.   # ○ 最も強力な防具を取得 (StrongestItem)
  986.   #     types          : 装備部位リスト
  987.   #     ignore_types   : 無視する部位リスト
  988.   #     judged_indices : 判定済み部位番号リスト
  989.   #    該当するアイテムがなければ nil を返す。
  990.   #--------------------------------------------------------------------------
  991.   def get_strongest_armor(types, ignore_types, judged_indices)
  992.     # 装備可能な防具を取得
  993.     equips = $game_party.items.find_all { |item|
  994.       item.is_a?(RPG::Armor) &&
  995.         !ignore_types.include?(item.kind) &&
  996.         @actor.equippable?(item)
  997.     }
  998.     return nil if equips.empty?

  999.     param_order = KGC::ExtendedEquipScene::STRONGEST_ARMOR_PARAM_ORDER

  1000.     # 最強防具を探す
  1001.     until equips.empty?
  1002.       armor = get_strongest_item(equips, param_order)
  1003.       types.each_with_index { |t, i|
  1004.         next if judged_indices.include?(i)
  1005.         next if armor.kind != t
  1006.         if $imported["EquipExtension"]
  1007.           next unless @actor.ep_condition_clear?(i, armor)
  1008.         end
  1009.         return KGC::ExtendedEquipScene::StrongestItem.new(i, armor)
  1010.       }
  1011.       equips.delete(armor)
  1012.     end
  1013.     return nil
  1014.   end
  1015.   #--------------------------------------------------------------------------
  1016.   # ○ すべて外す処理
  1017.   #--------------------------------------------------------------------------
  1018.   def process_remove_all
  1019.     type_max = ($imported["EquipExtension"] ? @actor.equip_type.size : 4) + 1
  1020.     type_max.times { |i| @actor.change_equip(i, nil) }
  1021.     refresh_window
  1022.   end
  1023. end
  1024. #铁甲
复制代码
这个是装备扩张的脚本,我想取消 那个最强装备,变更装备的那个,点开,直接进入可以换装备,不用在加这个变更装备的选择信息,问下把哪给改下啊
[

Lv2.观梦者

姬魂

梦石
0
星屑
423
在线时间
399 小时
注册时间
2009-8-30
帖子
612

开拓者

2
发表于 2011-6-7 21:47:35 | 只看该作者
  # ◆ 拡張装備コマンドを使用する

  #  true  : 「最強装備」「すべて外す」コマンドを使用可能

  #  false : 装備変更のみ

  USE_COMMAND_WINDOW = false
【RPG MAKER MZ 】游戏制作新手群:185916404
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
158
在线时间
1 小时
注册时间
2011-6-1
帖子
3
3
发表于 2011-6-8 09:49:33 | 只看该作者
高须小龙 发表于  
# ◆ 拡張装備コマンドを使用する

  #  true  : 「最強装備」「すべて外す」コマンドを使用可能


好晕
看不明白
锂电池
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
336 小时
注册时间
2010-8-26
帖子
428
4
 楼主| 发表于 2011-6-8 10:34:53 | 只看该作者
高须小龙 发表于  
# ◆ 拡張装備コマンドを使用する

  #  true  : 「最強装備」「すべて外す」コマンドを使用可能

那样的话的确可以去掉最强装备,但是变更装备的选项还在,我是想一个选项也不要
[
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 19:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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