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

Project1

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

[已经解决] 伸手——求装备拓展脚本……

[复制链接]

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
671
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

跳转到指定楼层
1
发表于 2010-11-2 18:00:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
简单点的。。。唉,菜鸟就是喜欢偷懒!

Lv1.梦旅人

梦石
0
星屑
50
在线时间
55 小时
注册时间
2010-10-22
帖子
138
2
发表于 2010-11-2 18:44:46 | 只看该作者
要用就用最好的~华丽版
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 装備拡張 - KGC_EquipExtension ◆ VX ◆
  3. #_/    ◇ Last update : 2008/11/24 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  装備関連の機能を拡張します。
  6. #_/============================================================================
  7. #_/ 【メニュー】≪拡張装備画面≫ より下に導入してください。
  8. #_/ 【スキル】≪パッシブスキル≫ より上に導入してください。
  9. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

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

  13. module KGC
  14. module EquipExtension
  15.   # ◆ 拡張装備種別
  16.   #  先頭から順に 4, 5, 6, ... が割り当てられる。
  17.   EXTRA_EQUIP_KIND = ["足", "守护"]

  18.   # ◆ 装備箇所リスト
  19.   #  武器の後に、ここで指定した順番で並ぶ。
  20.   #  ※ 装備箇所が最低一つないと、二刀流がバグる可能性があります。
  21.   #   ** 装備種別一覧 **
  22.   #  0..盾  1..頭  2..身体  3..装飾品  4~..↑で定義
  23.   EQUIP_TYPE = [0, 1, 2, 4, 3, 5]

  24.   # ◆ EP (Equip Point) 制を使用する
  25.   #  true  : EP で装備品を制限。
  26.   #  false : 通常の装備システム。
  27.   USE_EP_SYSTEM  = true
  28.   # ◆ EP の名前
  29.   VOCAB_EP       = "EP"
  30.   # ◆ EP の名前 (略)
  31.   VOCAB_EP_A     = "E"
  32.   # ◆ ステータス画面に EP を表示する
  33.   SHOW_STATUS_EP = true

  34.   # ◆ 消費 EP 既定値
  35.   #  消費 EP が指定されていない装備品で使用。
  36.   DEFAULT_EP_COST   = 1
  37.   # ◆ 消費 EP 0 は表示しない
  38.   HIDE_ZERO_EP_COST = true

  39.   # ◆ EP 上限
  40.   EP_MAX = 20
  41.   # ◆ EP 下限
  42.   EP_MIN = 10
  43.   # ◆ 最大 EP 算出式
  44.   #   level..アクターのレベル
  45.   #  自動的に整数変換されるので、結果が小数になってもOK。
  46.   EP_CALC_EXP = "level * 0.3 + 4"
  47.   # ◆ アクター毎の最大 EP 算出式
  48.   PERSONAL_EP_CALC_EXP = []
  49.   #  ここから下に、アクターごとの最大 EP を
  50.   #   PERSONAL_EP_CALC_EXP[アクター ID] = "計算式"
  51.   #  という書式で指定。
  52.   #  計算式は EP_CALC_EXP と同様の書式。
  53.   #  指定しなかったアクターは EP_CALC_EXP を使用。
  54.   #   <例> ラルフだけ優遇
  55.   # PERSONAL_EP_CALC_EXP[1] = "level * 0.5 + 5"

  56.   # ◆ 消費 EP 値の色 (アイテム名の末尾に付く数値)
  57.   #  数値  : \C[n] と同じ色。
  58.   #  Color : 指定した色。 ( Color.new(128, 255, 255) など )
  59.   EP_COST_COLOR        = 23
  60.   # ◆ EP ゲージの開始色
  61.   EP_GAUGE_START_COLOR = 28
  62.   # ◆ EP ゲージの終了色
  63.   EP_GAUGE_END_COLOR   = 29
  64. end
  65. end

  66. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  67. $imported = {} if $imported == nil
  68. $imported["EquipExtension"] = true

  69. module KGC::EquipExtension
  70.   # EP 制を使用しない場合の設定
  71.   unless USE_EP_SYSTEM
  72.     SHOW_STATUS_EP = false
  73.     HIDE_ZERO_EP_COST = true
  74.   end

  75.   # 正規表現
  76.   module Regexp
  77.     # ベースアイテム
  78.     module BaseItem
  79.       # 消費 EP
  80.       EP_COST = /<EP\s*(\d+)>/i
  81.       # 装備タイプ
  82.       EQUIP_TYPE = /<(?:EQUIP_TYPE|装備タイプ)\s*(\d+(?:\s*,\s*\d+)*)>/
  83.     end

  84.     # 防具
  85.     module Armor
  86.       # 装備種別
  87.       EQUIP_KIND = /<(?:EQUIP_KIND|装备类别)\s*(.+)>/i
  88.     end
  89.   end
  90. end

  91. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  92. #==============================================================================
  93. # □ KGC::Commands
  94. #==============================================================================

  95. module KGC
  96. module Commands
  97.   module_function
  98.   #--------------------------------------------------------------------------
  99.   # ○ アクターの装備を修復
  100.   #--------------------------------------------------------------------------
  101.   def restore_equip
  102.     (1...$data_actors.size).each { |i|
  103.       actor = $game_actors[i]
  104.       actor.restore_equip
  105.     }
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ○ アクターの装備タイプを設定
  109.   #     actor_id   : アクター ID
  110.   #     equip_type : 装備タイプ
  111.   #--------------------------------------------------------------------------
  112.   def set_actor_equip_type(actor_id, equip_type = nil)
  113.     actor = $game_actors[actor_id]
  114.     return if actor == nil
  115.     actor.equip_type = equip_type
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ○ アクターの MaxEP 補正値の取得
  119.   #     actor_id    : アクター ID
  120.   #     variable_id : 取得した値を代入する変数の ID
  121.   #--------------------------------------------------------------------------
  122.   def get_actor_own_ep(actor_id, variable_id = 0)
  123.     value = $game_actors[actor_id].maxep_plus
  124.     $game_variables[variable_id] = value if variable_id > 0
  125.     return value
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ○ アクターの MaxEP 補正値の変更
  129.   #     actor_id : アクター ID
  130.   #     value    : MaxEP 補正値
  131.   #--------------------------------------------------------------------------
  132.   def set_actor_own_ep(actor_id, value)
  133.     $game_actors[actor_id].maxep_plus = value
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ○ アクターの MaxEP 補正値の増加
  137.   #     actor_id : アクター ID
  138.   #     value    : 増加量
  139.   #--------------------------------------------------------------------------
  140.   def gain_actor_ep(actor_id, value)
  141.     $game_actors[actor_id].maxep_plus += value
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ○ アクターの装備を変更
  145.   #     actor_id   : アクター ID
  146.   #     index      : 装備部位 (0~)
  147.   #     item_id    : 武器 or 防具 ID (0 で解除)
  148.   #     force_gain : 未所持なら取得 (true or false)
  149.   #--------------------------------------------------------------------------
  150.   def change_actor_equipment(actor_id, index, item_id, force_gain = false)
  151.     actor = $game_actors[actor_id]
  152.     return if actor == nil

  153.     item = (index == 0 ? $data_weapons[item_id] : $data_armors[item_id])
  154.     if actor.two_swords_style && index == 1
  155.       item = $data_weapons[item_id]
  156.     end
  157.     if force_gain && $game_party.item_number(item) == 0
  158.       $game_party.gain_item(item, 1)
  159.     end
  160.     actor.change_equip_by_id(index, item_id)
  161.   end
  162. end
  163. end

  164. class Game_Interpreter
  165.   include KGC::Commands
  166. end

  167. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  168. #==============================================================================
  169. # ■ Vocab
  170. #==============================================================================

  171. module Vocab
  172.   # EP
  173.   def self.ep
  174.     return KGC::EquipExtension::VOCAB_EP
  175.   end

  176.   # EP (略)
  177.   def self.ep_a
  178.     return KGC::EquipExtension::VOCAB_EP_A
  179.   end

  180.   # 拡張防具欄
  181.   def self.extra_armor(index)
  182.     return KGC::EquipExtension::EXTRA_EQUIP_KIND[index]
  183.   end
  184. end

  185. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  186. #==============================================================================
  187. # ■ RPG::BaseItem
  188. #==============================================================================

  189. class RPG::BaseItem
  190.   #--------------------------------------------------------------------------
  191.   # ○ 装備拡張のキャッシュを作成
  192.   #--------------------------------------------------------------------------
  193.   def create_equip_extension_cache
  194.     @__ep_cost = KGC::EquipExtension::DEFAULT_EP_COST
  195.     @__equip_type = []

  196.     self.note.each_line { |line|
  197.       case line
  198.       when KGC::EquipExtension::Regexp::BaseItem::EP_COST
  199.         # 消費 EP
  200.         @__ep_cost = $1.to_i
  201.       when KGC::EquipExtension::Regexp::BaseItem::EQUIP_TYPE
  202.         # 装備タイプ
  203.         @__equip_type = []
  204.         $1.scan(/\d+/) { |num|
  205.           @__equip_type << num.to_i
  206.         }
  207.       end
  208.     }

  209.     # EP 制を使用しない場合は消費 EP = 0
  210.     @__ep_cost = 0 unless KGC::EquipExtension::USE_EP_SYSTEM
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ○ 消費 EP
  214.   #--------------------------------------------------------------------------
  215.   def ep_cost
  216.     create_equip_extension_cache if @__ep_cost == nil
  217.     return @__ep_cost
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ○ 装備タイプ
  221.   #--------------------------------------------------------------------------
  222.   def equip_type
  223.     create_equip_extension_cache if @__equip_type == nil
  224.     return @__equip_type
  225.   end
  226. end

  227. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  228. #==============================================================================
  229. # ■ RPG::Armor
  230. #==============================================================================

  231. class RPG::Armor < RPG::BaseItem
  232.   #--------------------------------------------------------------------------
  233.   # ○ 装備拡張のキャッシュを作成
  234.   #--------------------------------------------------------------------------
  235.   def create_equip_extension_cache
  236.     super
  237.     @__kind = -1

  238.     self.note.each_line { |line|
  239.       if line =~ KGC::EquipExtension::Regexp::Armor::EQUIP_KIND
  240.         # 装備種別
  241.         e_index = KGC::EquipExtension::EXTRA_EQUIP_KIND.index($1)
  242.         next if e_index == nil
  243.         @__kind = e_index + 4
  244.       end
  245.     }
  246.   end

  247. unless $@
  248.   #--------------------------------------------------------------------------
  249.   # ○ 種別
  250.   #--------------------------------------------------------------------------
  251.   alias kind_KGC_EquipExtension kind
  252.   def kind
  253.     create_equip_extension_cache if @__kind == nil
  254.     return (@__kind == -1 ? kind_KGC_EquipExtension : @__kind)
  255.   end
  256. end

  257. end

  258. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  259. #==============================================================================
  260. # ■ Game_Actor
  261. #==============================================================================

  262. class Game_Actor < Game_Battler
  263.   #--------------------------------------------------------------------------
  264.   # ● 公開インスタンス変数
  265.   #--------------------------------------------------------------------------
  266.   attr_writer   :equip_type               # 装備タイプ
  267.   attr_writer   :maxep_plus               # MaxEP 補正値
  268.   #--------------------------------------------------------------------------
  269.   # ● セットアップ
  270.   #     actor_id : アクター ID
  271.   #--------------------------------------------------------------------------
  272.   alias setup_KGC_EquipExtension setup
  273.   def setup(actor_id)
  274.     actor = $data_actors[actor_id]
  275.     @extra_armor_id = []

  276.     setup_KGC_EquipExtension(actor_id)

  277.     @__last_equip_type = nil
  278.     restore_equip
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ○ MaxEP 取得
  282.   #--------------------------------------------------------------------------
  283.   def maxep
  284.     calc_exp = KGC::EquipExtension::PERSONAL_EP_CALC_EXP[self.id]
  285.     if calc_exp == nil
  286.       calc_exp = KGC::EquipExtension::EP_CALC_EXP
  287.     end
  288.     n = Integer(eval(calc_exp)) + maxep_plus
  289.     return [[n, ep_limit].min, KGC::EquipExtension::EP_MIN].max
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ○ EP 取得
  293.   #--------------------------------------------------------------------------
  294.   def ep
  295.     n = 0
  296.     equips.compact.each { |item| n += item.ep_cost }
  297.     return [maxep - n, 0].max
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ○ EP 上限取得
  301.   #--------------------------------------------------------------------------
  302.   def ep_limit
  303.     return KGC::EquipExtension::EP_MAX
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ○ MaxEP 補正値取得
  307.   #--------------------------------------------------------------------------
  308.   def maxep_plus
  309.     @maxep_plus = 0 if @maxep_plus == nil
  310.     return @maxep_plus
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # ○ 防具欄の取得
  314.   #--------------------------------------------------------------------------
  315.   def equip_type
  316.     if @equip_type.is_a?(Array)
  317.       return @equip_type
  318.     else
  319.       return KGC::EquipExtension::EQUIP_TYPE
  320.     end
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ○ 防具欄の数
  324.   #--------------------------------------------------------------------------
  325.   def armor_number
  326.     return equip_type.size
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ○ 拡張防具欄の数
  330.   #--------------------------------------------------------------------------
  331.   def extra_armor_number
  332.     return [armor_number - 4, 0].max
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ○ 防具 ID リストの取得
  336.   #--------------------------------------------------------------------------
  337.   def extra_armor_id
  338.     @extra_armor_id = [] if @extra_armor_id == nil
  339.     return @extra_armor_id
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 防具オブジェクトの配列取得
  343.   #--------------------------------------------------------------------------
  344.   alias armors_KGC_EquipExtension armors
  345.   def armors
  346.     result = armors_KGC_EquipExtension

  347.     # 5番目以降の防具を追加
  348.     extra_armor_number.times { |i|
  349.       armor_id = extra_armor_id[i]
  350.       result << (armor_id == nil ? nil : $data_armors[armor_id])
  351.     }
  352.     return result
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● 装備の変更 (オブジェクトで指定)
  356.   #     equip_type : 装備部位
  357.   #     item       : 武器 or 防具 (nil なら装備解除)
  358.   #     test       : テストフラグ (戦闘テスト、または装備画面での一時装備)
  359.   #--------------------------------------------------------------------------
  360.   alias change_equip_KGC_EquipExtension change_equip
  361.   def change_equip(equip_type, item, test = false)
  362.     n = (item != nil ? $game_party.item_number(item) : 0)

  363.     change_equip_KGC_EquipExtension(equip_type, item, test)

  364.     # 拡張防具欄がある場合のみ
  365.     if extra_armor_number > 0 && (item == nil || n > 0)
  366.       item_id = item == nil ? 0 : item.id
  367.       case equip_type
  368.       when 5..armor_number  # 拡張防具欄
  369.         @extra_armor_id = [] if @extra_armor_id == nil
  370.         @extra_armor_id[equip_type - 5] = item_id
  371.       end
  372.     end

  373.     restore_battle_skill if $imported["SkillCPSystem"]
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 装備の破棄
  377.   #     item : 破棄する武器 or 防具
  378.   #    武器/防具の増減で「装備品も含める」のとき使用する。
  379.   #--------------------------------------------------------------------------
  380.   alias discard_equip_KGC_EquipExtension discard_equip
  381.   def discard_equip(item)
  382.     last_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]

  383.     discard_equip_KGC_EquipExtension(item)

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

  387.     # 拡張防具欄を検索
  388.     extra_armor_number.times { |i|
  389.       if extra_armor_id[i] == item.id
  390.         @extra_armor_id[i] = 0
  391.         break
  392.       end
  393.     }

  394.     restore_battle_skill if $imported["SkillCPSystem"]
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● 職業 ID の変更
  398.   #     class_id : 新しい職業 ID
  399.   #--------------------------------------------------------------------------
  400.   alias class_id_equal_KGC_EquipExtension class_id=
  401.   def class_id=(class_id)
  402.     class_id_equal_KGC_EquipExtension(class_id)

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

  404.     # 装備できない拡張防具を外す
  405.     for i in 5..armor_number
  406.       change_equip(i, nil) unless equippable?(equips[i])
  407.     end
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # ○ EP 条件クリア判定
  411.   #     equip_type : 装備部位
  412.   #     item       : 武器 or 防具
  413.   #--------------------------------------------------------------------------
  414.   def ep_condition_clear?(equip_type, item)
  415.     return true if item == nil  # nil は解除なので OK

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

  419.     return true
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ○ 装備を修復
  423.   #--------------------------------------------------------------------------
  424.   def restore_equip
  425.     return if @__last_equip_type == equip_type

  426.     # 以前の装備品・パラメータを退避
  427.     last_equips = equips
  428.     last_hp = self.hp
  429.     last_mp = self.mp
  430.     if $imported["SkillCPSystem"]
  431.       last_battle_skill_ids = battle_skill_ids.clone
  432.     end

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

  435.     # 装備品・パラメータを復元
  436.     last_equips.compact.each { |item| equip_legal_slot(item) }
  437.     self.hp = last_hp
  438.     self.mp = last_mp
  439.     if $imported["SkillCPSystem"]
  440.       last_battle_skill_ids.each_with_index { |s, i| set_battle_skill(i, s) }
  441.     end
  442.     @__last_equip_type = equip_type.clone
  443.     Graphics.frame_reset
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ○ 装備品を正しい箇所にセット
  447.   #     item : 武器 or 防具
  448.   #--------------------------------------------------------------------------
  449.   def equip_legal_slot(item)
  450.     if item.is_a?(RPG::Weapon)
  451.       if @weapon_id == 0
  452.         # 武器 1
  453.         change_equip(0, item)
  454.       elsif two_swords_style && @armor1_id == 0
  455.         # 武器 2 (二刀流の場合)
  456.         change_equip(1, item)
  457.       end
  458.     elsif item.is_a?(RPG::Armor)
  459.       if !two_swords_style && item.kind == equip_type[0] && @armor1_id == 0
  460.         # 先頭の防具 (二刀流でない場合)
  461.         change_equip(1, item)
  462.       else
  463.         # 装備箇所リストを作成
  464.         list = [-1, @armor2_id, @armor3_id, @armor4_id]
  465.         list += extra_armor_id
  466.         # 正しい、かつ空いている箇所にセット
  467.         equip_type.each_with_index { |kind, i|
  468.           if kind == item.kind && list[i] == 0
  469.             change_equip(i + 1, item)
  470.             break
  471.           end
  472.         }
  473.       end
  474.     end
  475.   end
  476. end

  477. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  478. #==============================================================================
  479. # ■ Window_Base
  480. #==============================================================================

  481. class Window_Base < Window
  482.   #--------------------------------------------------------------------------
  483.   # ○ EP の文字色を取得
  484.   #     actor : アクター
  485.   #--------------------------------------------------------------------------
  486.   def ep_color(actor)
  487.     return knockout_color if actor.maxep > 0 && actor.ep == 0
  488.     return normal_color
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ○ EP ゲージの色 1 の取得
  492.   #--------------------------------------------------------------------------
  493.   def ep_gauge_color1
  494.     color = KGC::EquipExtension::EP_GAUGE_START_COLOR
  495.     return (color.is_a?(Integer) ? text_color(color) : color)
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ○ EP ゲージの色 2 の取得
  499.   #--------------------------------------------------------------------------
  500.   def ep_gauge_color2
  501.     color = KGC::EquipExtension::EP_GAUGE_END_COLOR
  502.     return (color.is_a?(Integer) ? text_color(color) : color)
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ○ EP の描画
  506.   #     actor : アクター
  507.   #     x     : 描画先 X 座標
  508.   #     y     : 描画先 Y 座標
  509.   #     width : 幅
  510.   #--------------------------------------------------------------------------
  511.   def draw_actor_ep(actor, x, y, width = 120)
  512.     draw_actor_ep_gauge(actor, x, y, width)
  513.     self.contents.font.color = system_color
  514.     self.contents.draw_text(x, y, 30, WLH, Vocab::ep_a)
  515.     self.contents.font.color = ep_color(actor)
  516.     xr = x + width
  517.     if width < 120
  518.       self.contents.draw_text(xr - 40, y, 40, WLH, actor.ep, 2)
  519.     else
  520.       self.contents.draw_text(xr - 90, y, 40, WLH, actor.ep, 2)
  521.       self.contents.font.color = normal_color
  522.       self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
  523.       self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxep, 2)
  524.     end
  525.     self.contents.font.color = normal_color
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # ○ EP ゲージの描画
  529.   #     actor : アクター
  530.   #     x     : 描画先 X 座標
  531.   #     y     : 描画先 Y 座標
  532.   #     width : 幅
  533.   #--------------------------------------------------------------------------
  534.   def draw_actor_ep_gauge(actor, x, y, width = 120)
  535.     gw = width * actor.ep / [actor.maxep, 1].max
  536.     gc1 = ep_gauge_color1
  537.     gc2 = ep_gauge_color2
  538.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  539.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # ○ 消費 EP の描画
  543.   #     item    : 武器 or 防具
  544.   #     rect    : 描画する領域
  545.   #     enabled : 許可状態
  546.   #--------------------------------------------------------------------------
  547.   def draw_equipment_ep_cost(item, rect, enabled = true)
  548.     return if item == nil
  549.     # 消費 EP 0 を表示しない場合
  550.     return if KGC::EquipExtension::HIDE_ZERO_EP_COST && item.ep_cost == 0

  551.     color = KGC::EquipExtension::EP_COST_COLOR
  552.     self.contents.font.color = (color.is_a?(Integer) ?
  553.       text_color(color) : color)
  554.     self.contents.font.color.alpha = enabled ? 255 : 128
  555.     self.contents.draw_text(rect, item.ep_cost, 2)
  556.   end
  557. end

  558. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  559. #==============================================================================
  560. # ■ Window_Equip
  561. #==============================================================================

  562. class Window_Equip < Window_Selectable
  563.   #--------------------------------------------------------------------------
  564.   # ● リフレッシュ
  565.   #--------------------------------------------------------------------------
  566.   def refresh
  567.     self.contents.clear
  568.     @data = @actor.equips.clone
  569.     @item_max = [@data.size, @actor.armor_number + 1].min
  570.     create_contents

  571.     # 装備箇所を描画
  572.     self.contents.font.color = system_color
  573.     if @actor.two_swords_style
  574.       self.contents.draw_text(4,       0, 92, WLH, Vocab::weapon1)
  575.       self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
  576.     else
  577.       self.contents.draw_text(4,       0, 92, WLH, Vocab::weapon)
  578.       name = armor_slot_name(@actor.equip_type[0])
  579.       self.contents.draw_text(4, WLH * 1, 92, WLH, name)
  580.     end
  581.     for i in [email protected]_number
  582.       name = armor_slot_name(@actor.equip_type[i])
  583.       self.contents.draw_text(4, WLH * (i + 1), 92, WLH, name)
  584.     end

  585.     # 装備品を描画
  586.     rect = Rect.new(92, 0, self.width - 128, WLH)
  587.     @item_max.times { |i|
  588.       rect.y = WLH * i
  589.       draw_item_name(@data[i], rect.x, rect.y)
  590.       draw_equipment_ep_cost(@data[i], rect)
  591.     }
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # ○ 防具欄の名称を取得
  595.   #     kind : 種別
  596.   #--------------------------------------------------------------------------
  597.   def armor_slot_name(kind)
  598.     case kind
  599.     when 0..3
  600.       return eval("Vocab.armor#{kind + 1}")
  601.     else
  602.       return Vocab.extra_armor(kind - 4)
  603.     end
  604.   end

  605. unless $imported["ExtendedEquipScene"]
  606.   #--------------------------------------------------------------------------
  607.   # ● カーソルを 1 ページ後ろに移動
  608.   #--------------------------------------------------------------------------
  609.   def cursor_pagedown
  610.     return if Input.repeat?(Input::R)
  611.     super
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ● カーソルを 1 ページ前に移動
  615.   #--------------------------------------------------------------------------
  616.   def cursor_pageup
  617.     return if Input.repeat?(Input::L)
  618.     super
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ● フレーム更新
  622.   #--------------------------------------------------------------------------
  623.   def update
  624.     super
  625.     return unless self.active

  626.     if Input.repeat?(Input::RIGHT)
  627.       cursor_pagedown
  628.     elsif Input.repeat?(Input::LEFT)
  629.       cursor_pageup
  630.     end
  631.   end
  632. end

  633. end

  634. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  635. #==============================================================================
  636. # ■ Window_EquipItem
  637. #==============================================================================

  638. class Window_EquipItem < Window_Item
  639.   #--------------------------------------------------------------------------
  640.   # ● リフレッシュ
  641.   #--------------------------------------------------------------------------
  642.   def refresh
  643.     @item_enabled = []
  644.     super
  645.     @data.each { |item| @item_enabled << enable?(item) }
  646.   end
  647.   #--------------------------------------------------------------------------
  648.   # ● アイテムをリストに含めるかどうか
  649.   #     item : アイテム
  650.   #--------------------------------------------------------------------------
  651.   def include?(item)
  652.     return true if item == nil
  653.     if @equip_type == 0
  654.       return false unless item.is_a?(RPG::Weapon)
  655.     else
  656.       return false unless item.is_a?(RPG::Armor)
  657.       return false unless item.kind == @equip_type - 1
  658.     end
  659.     return @actor.equippable?(item)
  660.   end
  661.   #--------------------------------------------------------------------------
  662.   # ● アイテムを許可状態で表示するかどうか
  663.   #     item : アイテム
  664.   #--------------------------------------------------------------------------
  665.   def enable?(item)
  666.     return false unless @actor.equippable?(item)                      # 装備不可
  667.     return false unless @actor.ep_condition_clear?(@equip_type, item)  # EP 不足

  668.     return true
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # ● 項目の描画
  672.   #     index : 項目番号
  673.   #--------------------------------------------------------------------------
  674.   def draw_item(index)
  675.     super(index)   
  676.     rect = item_rect(index)
  677.     item = @data[index]

  678.     # 個数表示分の幅を削る
  679.     cw = self.contents.text_size(sprintf(":%2d", 0)).width
  680.     rect.width -= cw + 4
  681.     draw_equipment_ep_cost(item, rect, enable?(item))
  682.   end
  683.   #--------------------------------------------------------------------------
  684.   # ○ 簡易リフレッシュ
  685.   #     equip_type : 装備部位
  686.   #--------------------------------------------------------------------------
  687.   def simple_refresh(equip_type)
  688.     # 一時的に装備部位を変更
  689.     last_equip_type = @equip_type
  690.     @equip_type = equip_type

  691.     @data.each_with_index { |item, i|
  692.       # 許可状態が変化した項目のみ再描画
  693.       if enable?(item) != @item_enabled[i]
  694.         draw_item(i)
  695.         @item_enabled[i] = enable?(item)
  696.       end
  697.     }
  698.     # 装備部位を戻す
  699.     @equip_type = last_equip_type
  700.   end
  701. end

  702. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  703. #==============================================================================
  704. # ■ Window_EquipStatus
  705. #==============================================================================

  706. class Window_EquipStatus < Window_Base
  707.   #--------------------------------------------------------------------------
  708.   # ● リフレッシュ
  709.   #--------------------------------------------------------------------------
  710.   alias refresh_KGC_EquipExtension refresh
  711.   def refresh
  712.     refresh_KGC_EquipExtension

  713.     draw_actor_ep(@actor, 120, 0, 56) if KGC::EquipExtension::USE_EP_SYSTEM
  714.   end
  715. end

  716. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  717. #==============================================================================
  718. # ■ Window_Status
  719. #==============================================================================

  720. class Window_Status < Window_Base

  721. if KGC::EquipExtension::SHOW_STATUS_EP
  722.   #--------------------------------------------------------------------------
  723.   # ● 基本情報の描画
  724.   #     x : 描画先 X 座標
  725.   #     y : 描画先 Y 座標
  726.   #--------------------------------------------------------------------------
  727.   alias draw_basic_info_KGC_EquipExtension draw_basic_info
  728.   def draw_basic_info(x, y)
  729.     draw_basic_info_KGC_EquipExtension(x, y)

  730.     draw_actor_ep(@actor, x + 160, y + WLH * 4)
  731.   end
  732. end

  733.   #--------------------------------------------------------------------------
  734.   # ● 装備品の描画
  735.   #     x : 描画先 X 座標
  736.   #     y : 描画先 Y 座標
  737.   #--------------------------------------------------------------------------
  738.   def draw_equipments(x, y)
  739.     self.contents.font.color = system_color
  740.     self.contents.draw_text(x, y, 120, WLH, Vocab::equip)

  741.     item_number = [@actor.equips.size, @actor.armor_number + 1].min
  742.     item_number.times { |i|
  743.       draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
  744.     }
  745.   end
  746. end

  747. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  748. #==============================================================================
  749. # ■ Window_ShopStatus
  750. #==============================================================================

  751. class Window_ShopStatus < Window_Base
  752.   #--------------------------------------------------------------------------
  753.   # ● アクターの現装備と能力値変化の描画
  754.   #     actor : アクター
  755.   #     x     : 描画先 X 座標
  756.   #     y     : 描画先 Y 座標
  757.   #--------------------------------------------------------------------------
  758.   def draw_actor_parameter_change(actor, x, y)
  759.     return if @item.is_a?(RPG::Item)
  760.     enabled = actor.equippable?(@item)
  761.     self.contents.font.color = normal_color
  762.     self.contents.font.color.alpha = enabled ? 255 : 128
  763.     self.contents.draw_text(x, y, 200, WLH, actor.name)
  764.     if @item.is_a?(RPG::Weapon)
  765.       item1 = weaker_weapon(actor)
  766.     elsif actor.two_swords_style and @item.kind == 0
  767.       item1 = nil
  768.     else
  769.       index = actor.equip_type.index(@item.kind)
  770.       item1 = (index != nil ? actor.equips[1 + index] : nil)
  771.     end
  772.     if enabled
  773.       if @item.is_a?(RPG::Weapon)
  774.         atk1 = item1 == nil ? 0 : item1.atk
  775.         atk2 = @item == nil ? 0 : @item.atk
  776.         change = atk2 - atk1
  777.       else
  778.         def1 = item1 == nil ? 0 : item1.def
  779.         def2 = @item == nil ? 0 : @item.def
  780.         change = def2 - def1
  781.       end
  782.       self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
  783.     end
  784.     draw_item_name(item1, x, y + WLH, enabled)
  785.   end
  786. end

  787. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  788. #==============================================================================
  789. # ■ Scene_Equip
  790. #==============================================================================

  791. class Scene_Equip < Scene_Base
  792.   #--------------------------------------------------------------------------
  793.   # ● 定数
  794.   #--------------------------------------------------------------------------
  795.   EQUIP_TYPE_MAX = KGC::EquipExtension::EXTRA_EQUIP_KIND.size + 5
  796.   #--------------------------------------------------------------------------
  797.   # ● オブジェクト初期化
  798.   #     actor_index : アクターインデックス
  799.   #     equip_index : 装備インデックス
  800.   #--------------------------------------------------------------------------
  801.   alias initialize_KGC_EquipExtension initialize
  802.   def initialize(actor_index = 0, equip_index = 0)
  803.     initialize_KGC_EquipExtension(actor_index, equip_index)

  804.     unit = ($imported["LargeParty"] ?
  805.       $game_party.all_members : $game_party.members)
  806.     actor = unit[actor_index]
  807.     @equip_index = [@equip_index, actor.armor_number].min
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # ● アイテムウィンドウの作成
  811.   #--------------------------------------------------------------------------
  812.   alias create_item_windows_KGC_EquipExtension create_item_windows
  813.   def create_item_windows
  814.     create_item_windows_KGC_EquipExtension

  815.     kind = equip_kind(@equip_index)
  816.     EQUIP_TYPE_MAX.times { |i|
  817.       @item_windows[i].visible = (kind == i)
  818.     }
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # ● アイテムウィンドウの更新
  822.   #--------------------------------------------------------------------------
  823.   def update_item_windows
  824.     kind = equip_kind(@equip_window.index)
  825.     for i in 0...EQUIP_TYPE_MAX
  826.       @item_windows[i].visible = (kind == i)
  827.       @item_windows[i].update
  828.     end
  829.     @item_window = @item_windows[kind]
  830.     @item_window.simple_refresh(@equip_window.index)
  831.   end
  832.   #--------------------------------------------------------------------------
  833.   # ○ 装備欄の種別を取得
  834.   #     index : 装備欄インデックス
  835.   #--------------------------------------------------------------------------
  836.   def equip_kind(index)
  837.     if index == 0
  838.       return 0
  839.     else
  840.       return @actor.equip_type[index - 1] + 1
  841.     end
  842.   end

  843. unless $imported["ExtendedEquipScene"]
  844.   #--------------------------------------------------------------------------
  845.   # ● ステータスウィンドウの更新
  846.   #--------------------------------------------------------------------------
  847.   def update_status_window
  848.     if @equip_window.active
  849.       @status_window.set_new_parameters(nil, nil, nil, nil)
  850.     elsif @item_window.active
  851.       temp_actor = Marshal.load(Marshal.dump(@actor))
  852.       temp_actor.change_equip(@equip_window.index, @item_window.item, true)
  853.       new_atk = temp_actor.atk
  854.       new_def = temp_actor.def
  855.       new_spi = temp_actor.spi
  856.       new_agi = temp_actor.agi
  857.       @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
  858.     end
  859.     @status_window.update
  860.   end
  861. end

  862.   #--------------------------------------------------------------------------
  863.   # ● アイテム選択の更新
  864.   #--------------------------------------------------------------------------
  865.   alias update_item_selection_KGC_EquipExtension update_item_selection
  866.   def update_item_selection
  867.     if Input.trigger?(Input::C)
  868.       # 装備不可能な場合
  869.       index = @equip_window.index
  870.       item = @item_window.item
  871.       unless item == nil ||
  872.           (@actor.equippable?(item) && @actor.ep_condition_clear?(index, item))
  873.         Sound.play_buzzer
  874.         return
  875.       end
  876.     end

  877.     update_item_selection_KGC_EquipExtension
  878.   end
  879. end

  880. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  881. #==============================================================================
  882. # ■ Scene_File
  883. #==============================================================================

  884. class Scene_File < Scene_Base
  885.   #--------------------------------------------------------------------------
  886.   # ● セーブデータの読み込み
  887.   #     file : 読み込み用ファイルオブジェクト (オープン済み)
  888.   #--------------------------------------------------------------------------
  889.   alias read_save_data_KGC_EquipExtension read_save_data
  890.   def read_save_data(file)
  891.     read_save_data_KGC_EquipExtension(file)

  892.     KGC::Commands.restore_equip
  893.     Graphics.frame_reset
  894.   end
  895. end
复制代码

评分

参与人数 1星屑 +200 收起 理由
八云紫 + 200 认可答案

查看全部评分

如果您觉得大家的回答能够帮到您.希望您可以自己结贴并选出认可答案~!这样才能推进大家互助互利噢!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
115 小时
注册时间
2010-5-3
帖子
346
3
发表于 2010-11-2 20:51:20 | 只看该作者
  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, 5, 6,]

  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 = 35
  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 + 8
  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
复制代码
给你一个简单汉化的KGC的吧
回复 支持 反对

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
671
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

4
 楼主| 发表于 2010-11-2 20:54:22 | 只看该作者
貌似楼上两个是一样的?
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
518 小时
注册时间
2010-6-16
帖子
1073
5
发表于 2010-11-2 21:27:45 | 只看该作者
一个日文版,一个稍微汉化版……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
416 小时
注册时间
2006-10-21
帖子
1245
6
发表于 2010-11-4 15:30:20 | 只看该作者
http://ytomy.sakura.ne.jp/tkool/ ... ech=equip_extension
人家都更新到09年了。。还拿08的出来。。。
与时俱进啊

评分

参与人数 1星屑 +200 收起 理由
八云紫 + 200 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 15:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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