赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 3902 |
最后登录 | 2015-1-14 |
在线时间 | 139 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 139 小时
- 注册时间
- 2013-1-30
- 帖子
- 65
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 575539640 于 2013-4-9 21:59 编辑
这是只用装备扩张的效果
这是都使用,但 装备扩张 脚本在 装备技能修炼 的前面
这也是都使用,但 装备技能修炼 脚本在 装备扩张 的前面
有办法让装备的项目不消失,也显示装备技能的经验栏吗? 谢谢
下面是脚本
装备扩张
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #_/ ◆ 装備拡張 - KGC_EquipExtension ◆ VX ◆ #_/ ◇ Last update : 2008/02/10 ◇ #_/---------------------------------------------------------------------------- #_/ 装備関連の機能を拡張します。 #_/============================================================================ #_/ 【メニュー】≪拡張装備画面≫ より下に導入してください。 #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ★ カスタマイズ項目 - Customize ★ #============================================================================== module KGC module EquipExtension # ◆ 扩张的装备种类名称 # 从前面的皆下去 4 5 6 7 8 9 10 EXTRA_EQUIP_KIND = ["项链","戒指","披风","手套","鞋","道具","其他"] # ◆ 装备的顺序 # 以这里设置的顺序接续在武器的下面 # ※ 装备个数最低为1,否则二刀流会出错 # ** 装备种类一览 ** # 0..盾 1..帽子 2..铠甲 3..徽章 4~..↑所定義的种类 EQUIP_TYPE = [0,1,4,2,6,3,5,5,7,8,9,9,10,10] # ◆ EP (装备点数) 制是否要使用 USE_EP_SYSTEM = true # ◆ EP 的名称 VOCAB_EP = "装备负重" # ◆ EP 的名称 (略) VOCAB_EP_A = "" # ◆ 是否在状态介面显示EP值 SHOW_STATUS_EP = true # ◆ 装备预设 EP 消耗点数 # 没有设定EP消耗点数的装备自动加上的点数 DEFAULT_EP_COST = 2 # ◆ 当消耗 EP 值为 0 时隐藏 HIDE_ZERO_EP_COST = true # ◆ EP 上限 EP_MAX = 300 # ◆ EP 下限 EP_MIN = 30 # ◆ 最大 EP 公式 # level..角色等级 # 计算後小数自动取整 EP_CALC_EXP = "level * 2 + 10" # ◆ 消耗 EP 値的文字颜色 (接续在装备名称後面的文字) # 数字 : 与 \C[n] 同样的颜色 (也就是在窗口外观设置的颜色色号) # Color : 指定颜色。 ( Color.new(128, 255, 255)) EP_COST_COLOR = 23 # ◆ EP 槽開始色 EP_GAUGE_START_COLOR = 28 # ◆ EP 槽结束色 EP_GAUGE_END_COLOR = 29 end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ $imported = {} if $imported == nil $imported["EquipExtension"] = true module KGC::EquipExtension # EP 制を使用しない場合の設定 unless USE_EP_SYSTEM SHOW_STATUS_EP = false HIDE_ZERO_EP_COST = true end # 正規表現 module Regexp # ベースアイテム module BaseItem # 消費 EP EP_COST = /<EP\s*(\d+)>/i # 装備タイプ EQUIP_TYPE = /<(?:EQUIP_TYPE|装備タイプ)\s*(\d+(?:\s*,\s*\d+)*)>/ end # 防具 module Armor # 装備種別 EQUIP_KIND = /<(?:EQUIP_KIND|武器种类)\s*(.+)>/i end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # □ KGC::Commands #============================================================================== module KGC::Commands module_function #-------------------------------------------------------------------------- # ○ アクターの装備を修復 #-------------------------------------------------------------------------- def restore_equip (1...$data_actors.size).each { |i| actor = $game_actors[i] actor.restore_equip } end #-------------------------------------------------------------------------- # ○ アクターの装備タイプを設定 # actor_id : アクター ID # equip_type : 装備タイプ #-------------------------------------------------------------------------- def set_actor_equip_type(actor_id, equip_type = nil) actor = $game_actors[actor_id] return if actor == nil actor.equip_type = equip_type end end class Game_Interpreter include KGC::Commands end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Vocab #============================================================================== module Vocab # EP def self.ep return KGC::EquipExtension::VOCAB_EP end # EP (略) def self.ep_a return KGC::EquipExtension::VOCAB_EP_A end # 拡張防具欄 def self.extra_armor(index) return KGC::EquipExtension::EXTRA_EQUIP_KIND[index] end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ RPG::BaseItem #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # ○ 装備拡張のキャッシュを作成 #-------------------------------------------------------------------------- def create_equip_extension_cache @__ep_cost = KGC::EquipExtension::DEFAULT_EP_COST @__equip_type = [] self.note.split(/[\r\n]+/).each { |line| case line when KGC::EquipExtension::Regexp::BaseItem::EP_COST # 消費 EP @__ep_cost = $1.to_i when KGC::EquipExtension::Regexp::BaseItem::EQUIP_TYPE # 装備タイプ @__equip_type = [] $1.scan(/\d+/) { |num| @__equip_type << num.to_i } end } # EP 制を使用しない場合は消費 EP = 0 @__ep_cost = 0 unless KGC::EquipExtension::USE_EP_SYSTEM end #-------------------------------------------------------------------------- # ○ 消費 EP #-------------------------------------------------------------------------- def ep_cost create_equip_extension_cache if @__ep_cost == nil return @__ep_cost end #-------------------------------------------------------------------------- # ○ 装備タイプ #-------------------------------------------------------------------------- def equip_type create_equip_extension_cache if @__equip_type == nil return @__equip_type end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ RPG::Armor #============================================================================== class RPG::Armor < RPG::BaseItem #-------------------------------------------------------------------------- # ○ 装備拡張のキャッシュを作成 #-------------------------------------------------------------------------- def create_equip_extension_cache super @__kind = -1 self.note.split(/[\r\n]+/).each { |line| if line =~ KGC::EquipExtension::Regexp::Armor::EQUIP_KIND # 装備タイプ e_index = KGC::EquipExtension::EXTRA_EQUIP_KIND.index($1) next if e_index == nil @__kind = e_index + 4 end } end unless $@ #-------------------------------------------------------------------------- # ○ 種別 #-------------------------------------------------------------------------- alias kind_KGC_EquipExtension kind def kind create_equip_extension_cache if @__kind == nil return (@__kind == -1 ? kind_KGC_EquipExtension : @__kind) end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_writer :equip_type # 装備タイプ #-------------------------------------------------------------------------- # ● セットアップ # actor_id : アクター ID #-------------------------------------------------------------------------- alias setup_KGC_EquipExtension setup def setup(actor_id) actor = $data_actors[actor_id] @extra_armor_id = [] setup_KGC_EquipExtension(actor_id) restore_equip end #-------------------------------------------------------------------------- # ○ MaxEP 取得 #-------------------------------------------------------------------------- def maxep n = Integer(eval(KGC::EquipExtension::EP_CALC_EXP)) return [[n, ep_limit].min, KGC::EquipExtension::EP_MIN].max end #-------------------------------------------------------------------------- # ○ EP 取得 #-------------------------------------------------------------------------- def ep n = 0 equips.compact.each { |item| n += item.ep_cost } return [maxep - n, 0].max end #-------------------------------------------------------------------------- # ○ EP 上限取得 #-------------------------------------------------------------------------- def ep_limit return KGC::EquipExtension::EP_MAX end #-------------------------------------------------------------------------- # ○ 防具欄の取得 #-------------------------------------------------------------------------- def equip_type if @equip_type.is_a?(Array) return @equip_type else return KGC::EquipExtension::EQUIP_TYPE end end #-------------------------------------------------------------------------- # ○ 防具欄の数 #-------------------------------------------------------------------------- def armor_number return equip_type.size end #-------------------------------------------------------------------------- # ○ 拡張防具欄の数 #-------------------------------------------------------------------------- def extra_armor_number return [armor_number - 4, 0].max end #-------------------------------------------------------------------------- # ○ 防具 ID リストの取得 #-------------------------------------------------------------------------- def extra_armor_id @extra_armor_id = [] if @extra_armor_id == nil return @extra_armor_id end #-------------------------------------------------------------------------- # ● 防具オブジェクトの配列取得 #-------------------------------------------------------------------------- alias armors_KGC_EquipExtension armors def armors result = armors_KGC_EquipExtension # 5番目以降の防具を追加 extra_armor_number.times { |i| armor_id = extra_armor_id[i] result << (armor_id == nil ? nil : $data_armors[armor_id]) } return result end #-------------------------------------------------------------------------- # ● 装備の変更 (オブジェクトで指定) # equip_type : 装備部位 # item : 武器 or 防具 (nil なら装備解除) # test : テストフラグ (戦闘テスト、または装備画面での一時装備) #-------------------------------------------------------------------------- alias change_equip_KGC_EquipExtension change_equip def change_equip(equip_type, item, test = false) change_equip_KGC_EquipExtension(equip_type, item, test) # 拡張防具欄がある場合のみ if extra_armor_number > 0 item_id = item == nil ? 0 : item.id case equip_type when 5..armor_number # 拡張防具欄 @extra_armor_id = [] if @extra_armor_id == nil @extra_armor_id[equip_type - 5] = item_id end end restore_battle_skill if $imported["SkillCPSystem"] restore_passive_rev if $imported["PassiveSkill"] end #-------------------------------------------------------------------------- # ● 装備の破棄 # item : 破棄する武器 or 防具 # 武器/防具の増減で「装備品も含める」のとき使用する。 #-------------------------------------------------------------------------- alias discard_equip_KGC_EquipExtension discard_equip def discard_equip(item) last_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id] discard_equip_KGC_EquipExtension(item) curr_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id] return unless item.is_a?(RPG::Armor) # 防具でない return if last_armors != curr_armors # 既に破棄された # 拡張防具欄を検索 extra_armor_number.times { |i| if extra_armor_id[i] == item.id @extra_armor_id[i] = 0 break end } restore_battle_skill if $imported["SkillCPSystem"] restore_passive_rev if $imported["PassiveSkill"] end #-------------------------------------------------------------------------- # ● 職業 ID の変更 # class_id : 新しい職業 ID #-------------------------------------------------------------------------- alias class_id_equal_KGC_EquipExtension class_id= def class_id=(class_id) class_id_equal_KGC_EquipExtension(class_id) return if extra_armor_number == 0 # 拡張防具欄がない # 装備できない拡張防具を外す for i in 5..armor_number change_equip(i, nil) unless equippable?(equips[i]) end end #-------------------------------------------------------------------------- # ○ EP 条件クリア判定 # equip_type : 装備部位 # item : 武器 or 防具 #-------------------------------------------------------------------------- def ep_condition_clear?(equip_type, item) return true if item == nil # nil は解除なので OK curr_item = equips[equip_type] offset = (curr_item != nil ? curr_item.ep_cost : 0) return false if self.ep < (item.ep_cost - offset) # EP 不足 return true end #-------------------------------------------------------------------------- # ○ 装備を修復 #-------------------------------------------------------------------------- def restore_equip # 以前の装備品・パラメータを退避 last_equips = equips last_hp = self.hp last_mp = self.mp if $imported["SkillCPSystem"] last_battle_skill_ids = battle_skill_ids.clone end # 全装備解除 last_equips.each_index { |i| change_equip(i, nil) } # 装備品・パラメータを復元 last_equips.compact.each { |item| equip_legal_slot(item) } self.hp = last_hp self.mp = last_mp if $imported["SkillCPSystem"] last_battle_skill_ids.each_with_index { |s, i| set_battle_skill(i, s) } end Graphics.frame_reset end #-------------------------------------------------------------------------- # ○ 装備品を正しい箇所にセット # item : 武器 or 防具 #-------------------------------------------------------------------------- def equip_legal_slot(item) if item.is_a?(RPG::Weapon) if @weapon_id == 0 # 武器 1 change_equip(0, item) elsif two_swords_style && @armor1_id == 0 # 武器 2 (二刀流の場合) change_equip(1, item) end elsif item.is_a?(RPG::Armor) if !two_swords_style && item.kind == equip_type[0] && @armor1_id == 0 # 先頭の防具 (二刀流でない場合) change_equip(1, item) else # 装備箇所リストを作成 list = [-1, @armor2_id, @armor3_id, @armor4_id] list += extra_armor_id # 正しい、かつ空いている箇所にセット equip_type.each_with_index { |kind, i| if kind == item.kind && list[i] == 0 change_equip(i + 1, item) break end } end end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ○ EP の文字色を取得 # actor : アクター #-------------------------------------------------------------------------- def ep_color(actor) return knockout_color if actor.maxep > 0 && actor.ep == 0 return normal_color end #-------------------------------------------------------------------------- # ○ EP ゲージの色 1 の取得 #-------------------------------------------------------------------------- def ep_gauge_color1 color = KGC::EquipExtension::EP_GAUGE_START_COLOR return (color.is_a?(Integer) ? text_color(color) : color) end #-------------------------------------------------------------------------- # ○ EP ゲージの色 2 の取得 #-------------------------------------------------------------------------- def ep_gauge_color2 color = KGC::EquipExtension::EP_GAUGE_END_COLOR return (color.is_a?(Integer) ? text_color(color) : color) end #-------------------------------------------------------------------------- # ○ EP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 幅 #-------------------------------------------------------------------------- def draw_actor_ep(actor, x, y, width = 120) draw_actor_ep_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::ep_a) self.contents.font.color = ep_color(actor) xr = x + width if width < 120 self.contents.draw_text(xr - 40, y, 40, WLH, actor.ep, 2) else self.contents.draw_text(xr - 90, y, 40, WLH, actor.ep, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2) self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxep, 2) end self.contents.font.color = normal_color end #-------------------------------------------------------------------------- # ○ EP ゲージの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 幅 #-------------------------------------------------------------------------- def draw_actor_ep_gauge(actor, x, y, width = 120) gw = width * actor.ep / [actor.maxep, 1].max gc1 = ep_gauge_color1 gc2 = ep_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) end #-------------------------------------------------------------------------- # ○ 消費 EP の描画 # item : 武器 or 防具 # rect : 描画する領域 # enabled : 許可状態 #-------------------------------------------------------------------------- def draw_equipment_ep_cost(item, rect, enabled = true) return if item == nil # 消費 EP 0 を表示しない場合 return if KGC::EquipExtension::HIDE_ZERO_EP_COST && item.ep_cost == 0 color = KGC::EquipExtension::EP_COST_COLOR self.contents.font.color = (color.is_a?(Integer) ? text_color(color) : color) self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect, item.ep_cost, 2) end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_Equip #============================================================================== class Window_Equip < Window_Selectable #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @data = @actor.equips.clone @item_max = [@data.size, @actor.armor_number + 1].min create_contents # 装備箇所を描画 self.contents.font.color = system_color if @actor.two_swords_style self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1) self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2) else self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon) name = armor_slot_name(@actor.equip_type[0]) self.contents.draw_text(4, WLH * 1, 92, WLH, name) end for i in [email]1...@actor.armor_number[/email] name = armor_slot_name(@actor.equip_type[i]) self.contents.draw_text(4, WLH * (i + 1), 92, WLH, name) end # 装備品を描画 rect = Rect.new(92, 0, self.width - 128, WLH) @item_max.times { |i| rect.y = WLH * i draw_item_name(@data[i], rect.x, rect.y) draw_equipment_ep_cost(@data[i], rect) } end #-------------------------------------------------------------------------- # ○ 防具欄の名称を取得 # kind : 種別 #-------------------------------------------------------------------------- def armor_slot_name(kind) case kind when 0..3 return eval("Vocab.armor#{kind + 1}") else return Vocab.extra_armor(kind - 4) end end unless $imported["ExtendedEquipScene"] #-------------------------------------------------------------------------- # ● カーソルを 1 ページ後ろに移動 #-------------------------------------------------------------------------- def cursor_pagedown return if Input.repeat?(Input::R) super end #-------------------------------------------------------------------------- # ● カーソルを 1 ページ前に移動 #-------------------------------------------------------------------------- def cursor_pageup return if Input.repeat?(Input::L) super end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super return unless self.active if Input.repeat?(Input::RIGHT) cursor_pagedown elsif Input.repeat?(Input::LEFT) cursor_pageup end end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_EquipItem #============================================================================== class Window_EquipItem < Window_Item #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh @item_enabled = [] super @data.each { |item| @item_enabled << enable?(item) } end #-------------------------------------------------------------------------- # ● アイテムをリストに含めるかどうか # item : アイテム #-------------------------------------------------------------------------- def include?(item) return true if item == nil if @equip_type == 0 return false unless item.is_a?(RPG::Weapon) else return false unless item.is_a?(RPG::Armor) return false unless item.kind == @equip_type - 1 end return @actor.equippable?(item) end #-------------------------------------------------------------------------- # ● アイテムを許可状態で表示するかどうか # item : アイテム #-------------------------------------------------------------------------- def enable?(item) return false unless @actor.equippable?(item) # 装備不可 return false unless @actor.ep_condition_clear?(@equip_type, item) # EP 不足 return true end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) super(index) rect = item_rect(index) item = @data[index] # 個数表示分の幅を削る cw = self.contents.text_size(sprintf(":%2d", 0)).width rect.width -= cw + 4 draw_equipment_ep_cost(item, rect, enable?(item)) end #-------------------------------------------------------------------------- # ○ 簡易リフレッシュ # equip_type : 装備部位 #-------------------------------------------------------------------------- def simple_refresh(equip_type) # 一時的に装備部位を変更 last_equip_type = @equip_type @equip_type = equip_type @data.each_with_index { |item, i| # 許可状態が変化した項目のみ再描画 if enable?(item) != @item_enabled[i] draw_item(i) @item_enabled[i] = enable?(item) end } # 装備部位を戻す @equip_type = last_equip_type end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_EquipStatus #============================================================================== class Window_EquipStatus < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias refresh_KGC_EquipExtension refresh def refresh refresh_KGC_EquipExtension draw_actor_ep(@actor, 120, 0, 56) if KGC::EquipExtension::USE_EP_SYSTEM end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_Status #============================================================================== class Window_Status < Window_Base if KGC::EquipExtension::SHOW_STATUS_EP #-------------------------------------------------------------------------- # ● 基本情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- alias draw_basic_info_KGC_EquipExtension draw_basic_info def draw_basic_info(x, y) draw_basic_info_KGC_EquipExtension(x, y) draw_actor_ep(@actor, x + 180, y + WLH * 4) end end #-------------------------------------------------------------------------- # ● 装備品の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_equipments(x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, Vocab::equip) item_number = [@actor.equips.size, @actor.armor_number + 1].min item_number.times { |i| draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1)) } end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Scene_Equip #============================================================================== class Scene_Equip < Scene_Base #-------------------------------------------------------------------------- # ● 定数 #-------------------------------------------------------------------------- EQUIP_TYPE_MAX = KGC::EquipExtension::EXTRA_EQUIP_KIND.size + 5 #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor_index : アクターインデックス # equip_index : 装備インデックス #-------------------------------------------------------------------------- alias initialize_KGC_EquipExtension initialize def initialize(actor_index = 0, equip_index = 0) initialize_KGC_EquipExtension(actor_index, equip_index) unit = ($imported["LargeParty"] ? $game_party.all_members : $game_party.members) actor = unit[actor_index] @equip_index = [@equip_index, actor.armor_number].min end #-------------------------------------------------------------------------- # ● アイテムウィンドウの作成 #-------------------------------------------------------------------------- alias create_item_windows_KGC_EquipExtension create_item_windows def create_item_windows create_item_windows_KGC_EquipExtension kind = equip_kind(@equip_index) EQUIP_TYPE_MAX.times { |i| @item_windows[i].visible = (kind == i) } end #-------------------------------------------------------------------------- # ● アイテムウィンドウの更新 #-------------------------------------------------------------------------- def update_item_windows kind = equip_kind(@equip_window.index) for i in 0...EQUIP_TYPE_MAX @item_windows[i].visible = (kind == i) @item_windows[i].update end @item_window = @item_windows[kind] @item_window.simple_refresh(@equip_window.index) end #-------------------------------------------------------------------------- # ○ 装備欄の種別を取得 # index : 装備欄インデックス #-------------------------------------------------------------------------- def equip_kind(index) if index == 0 return 0 else return @actor.equip_type[index - 1] + 1 end end unless $imported["ExtendedEquipScene"] #-------------------------------------------------------------------------- # ● ステータスウィンドウの更新 #-------------------------------------------------------------------------- def update_status_window if @equip_window.active @status_window.set_new_parameters(nil, nil, nil, nil) elsif @item_window.active temp_actor = Marshal.load(Marshal.dump(@actor)) temp_actor.change_equip(@equip_window.index, @item_window.item, true) new_atk = temp_actor.atk new_def = temp_actor.def new_spi = temp_actor.spi new_agi = temp_actor.agi @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi) end @status_window.update end end #-------------------------------------------------------------------------- # ● アイテム選択の更新 #-------------------------------------------------------------------------- alias update_item_selection_KGC_EquipExtension update_item_selection def update_item_selection if Input.trigger?(Input::C) # 装備不可能な場合 index = @equip_window.index item = @item_window.item unless item == nil || (@actor.equippable?(item) && @actor.ep_condition_clear?(index, item)) Sound.play_buzzer return end end update_item_selection_KGC_EquipExtension end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Scene_File #============================================================================== class Scene_File < Scene_Base #-------------------------------------------------------------------------- # ● セーブデータの読み込み # file : 読み込み用ファイルオブジェクト (オープン済み) #-------------------------------------------------------------------------- alias read_save_data_KGC_EquipExtension read_save_data def read_save_data(file) read_save_data_KGC_EquipExtension(file) KGC::Commands.restore_equip Graphics.frame_reset end end
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ 装備拡張 - KGC_EquipExtension ◆ VX ◆
#_/ ◇ Last update : 2008/02/10 ◇
#_/----------------------------------------------------------------------------
#_/ 装備関連の機能を拡張します。
#_/============================================================================
#_/ 【メニュー】≪拡張装備画面≫ より下に導入してください。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ カスタマイズ項目 - Customize ★
#==============================================================================
module KGC
module EquipExtension
# ◆ 扩张的装备种类名称
# 从前面的皆下去 4 5 6 7 8 9 10
EXTRA_EQUIP_KIND = ["项链","戒指","披风","手套","鞋","道具","其他"]
# ◆ 装备的顺序
# 以这里设置的顺序接续在武器的下面
# ※ 装备个数最低为1,否则二刀流会出错
# ** 装备种类一览 **
# 0..盾 1..帽子 2..铠甲 3..徽章 4~..↑所定義的种类
EQUIP_TYPE = [0,1,4,2,6,3,5,5,7,8,9,9,10,10]
# ◆ EP (装备点数) 制是否要使用
USE_EP_SYSTEM = true
# ◆ EP 的名称
VOCAB_EP = "装备负重"
# ◆ EP 的名称 (略)
VOCAB_EP_A = ""
# ◆ 是否在状态介面显示EP值
SHOW_STATUS_EP = true
# ◆ 装备预设 EP 消耗点数
# 没有设定EP消耗点数的装备自动加上的点数
DEFAULT_EP_COST = 2
# ◆ 当消耗 EP 值为 0 时隐藏
HIDE_ZERO_EP_COST = true
# ◆ EP 上限
EP_MAX = 300
# ◆ EP 下限
EP_MIN = 30
# ◆ 最大 EP 公式
# level..角色等级
# 计算後小数自动取整
EP_CALC_EXP = "level * 2 + 10"
# ◆ 消耗 EP 値的文字颜色 (接续在装备名称後面的文字)
# 数字 : 与 \C[n] 同样的颜色 (也就是在窗口外观设置的颜色色号)
# Color : 指定颜色。 ( Color.new(128, 255, 255))
EP_COST_COLOR = 23
# ◆ EP 槽開始色
EP_GAUGE_START_COLOR = 28
# ◆ EP 槽结束色
EP_GAUGE_END_COLOR = 29
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["EquipExtension"] = true
module KGC::EquipExtension
# EP 制を使用しない場合の設定
unless USE_EP_SYSTEM
SHOW_STATUS_EP = false
HIDE_ZERO_EP_COST = true
end
# 正規表現
module Regexp
# ベースアイテム
module BaseItem
# 消費 EP
EP_COST = /<EP\s*(\d+)>/i
# 装備タイプ
EQUIP_TYPE = /<(?:EQUIP_TYPE|装備タイプ)\s*(\d+(?:\s*,\s*\d+)*)>/
end
# 防具
module Armor
# 装備種別
EQUIP_KIND = /<(?:EQUIP_KIND|武器种类)\s*(.+)>/i
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ KGC::Commands
#==============================================================================
module KGC::Commands
module_function
#--------------------------------------------------------------------------
# ○ アクターの装備を修復
#--------------------------------------------------------------------------
def restore_equip
(1...$data_actors.size).each { |i|
actor = $game_actors[i]
actor.restore_equip
}
end
#--------------------------------------------------------------------------
# ○ アクターの装備タイプを設定
# actor_id : アクター ID
# equip_type : 装備タイプ
#--------------------------------------------------------------------------
def set_actor_equip_type(actor_id, equip_type = nil)
actor = $game_actors[actor_id]
return if actor == nil
actor.equip_type = equip_type
end
end
class Game_Interpreter
include KGC::Commands
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Vocab
#==============================================================================
module Vocab
# EP
def self.ep
return KGC::EquipExtension::VOCAB_EP
end
# EP (略)
def self.ep_a
return KGC::EquipExtension::VOCAB_EP_A
end
# 拡張防具欄
def self.extra_armor(index)
return KGC::EquipExtension::EXTRA_EQUIP_KIND[index]
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# ○ 装備拡張のキャッシュを作成
#--------------------------------------------------------------------------
def create_equip_extension_cache
@__ep_cost = KGC::EquipExtension::DEFAULT_EP_COST
@__equip_type = []
self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::EquipExtension::Regexp::BaseItem::EP_COST
# 消費 EP
@__ep_cost = $1.to_i
when KGC::EquipExtension::Regexp::BaseItem::EQUIP_TYPE
# 装備タイプ
@__equip_type = []
$1.scan(/\d+/) { |num|
@__equip_type << num.to_i
}
end
}
# EP 制を使用しない場合は消費 EP = 0
@__ep_cost = 0 unless KGC::EquipExtension::USE_EP_SYSTEM
end
#--------------------------------------------------------------------------
# ○ 消費 EP
#--------------------------------------------------------------------------
def ep_cost
create_equip_extension_cache if @__ep_cost == nil
return @__ep_cost
end
#--------------------------------------------------------------------------
# ○ 装備タイプ
#--------------------------------------------------------------------------
def equip_type
create_equip_extension_cache if @__equip_type == nil
return @__equip_type
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::Armor
#==============================================================================
class RPG::Armor < RPG::BaseItem
#--------------------------------------------------------------------------
# ○ 装備拡張のキャッシュを作成
#--------------------------------------------------------------------------
def create_equip_extension_cache
super
@__kind = -1
self.note.split(/[\r\n]+/).each { |line|
if line =~ KGC::EquipExtension::Regexp::Armor::EQUIP_KIND
# 装備タイプ
e_index = KGC::EquipExtension::EXTRA_EQUIP_KIND.index($1)
next if e_index == nil
@__kind = e_index + 4
end
}
end
unless $@
#--------------------------------------------------------------------------
# ○ 種別
#--------------------------------------------------------------------------
alias kind_KGC_EquipExtension kind
def kind
create_equip_extension_cache if @__kind == nil
return (@__kind == -1 ? kind_KGC_EquipExtension : @__kind)
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_writer :equip_type # 装備タイプ
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias setup_KGC_EquipExtension setup
def setup(actor_id)
actor = $data_actors[actor_id]
@extra_armor_id = []
setup_KGC_EquipExtension(actor_id)
restore_equip
end
#--------------------------------------------------------------------------
# ○ MaxEP 取得
#--------------------------------------------------------------------------
def maxep
n = Integer(eval(KGC::EquipExtension::EP_CALC_EXP))
return [[n, ep_limit].min, KGC::EquipExtension::EP_MIN].max
end
#--------------------------------------------------------------------------
# ○ EP 取得
#--------------------------------------------------------------------------
def ep
n = 0
equips.compact.each { |item| n += item.ep_cost }
return [maxep - n, 0].max
end
#--------------------------------------------------------------------------
# ○ EP 上限取得
#--------------------------------------------------------------------------
def ep_limit
return KGC::EquipExtension::EP_MAX
end
#--------------------------------------------------------------------------
# ○ 防具欄の取得
#--------------------------------------------------------------------------
def equip_type
if @equip_type.is_a?(Array)
return @equip_type
else
return KGC::EquipExtension::EQUIP_TYPE
end
end
#--------------------------------------------------------------------------
# ○ 防具欄の数
#--------------------------------------------------------------------------
def armor_number
return equip_type.size
end
#--------------------------------------------------------------------------
# ○ 拡張防具欄の数
#--------------------------------------------------------------------------
def extra_armor_number
return [armor_number - 4, 0].max
end
#--------------------------------------------------------------------------
# ○ 防具 ID リストの取得
#--------------------------------------------------------------------------
def extra_armor_id
@extra_armor_id = [] if @extra_armor_id == nil
return @extra_armor_id
end
#--------------------------------------------------------------------------
# ● 防具オブジェクトの配列取得
#--------------------------------------------------------------------------
alias armors_KGC_EquipExtension armors
def armors
result = armors_KGC_EquipExtension
# 5番目以降の防具を追加
extra_armor_number.times { |i|
armor_id = extra_armor_id[i]
result << (armor_id == nil ? nil : $data_armors[armor_id])
}
return result
end
#--------------------------------------------------------------------------
# ● 装備の変更 (オブジェクトで指定)
# equip_type : 装備部位
# item : 武器 or 防具 (nil なら装備解除)
# test : テストフラグ (戦闘テスト、または装備画面での一時装備)
#--------------------------------------------------------------------------
alias change_equip_KGC_EquipExtension change_equip
def change_equip(equip_type, item, test = false)
change_equip_KGC_EquipExtension(equip_type, item, test)
# 拡張防具欄がある場合のみ
if extra_armor_number > 0
item_id = item == nil ? 0 : item.id
case equip_type
when 5..armor_number # 拡張防具欄
@extra_armor_id = [] if @extra_armor_id == nil
@extra_armor_id[equip_type - 5] = item_id
end
end
restore_battle_skill if $imported["SkillCPSystem"]
restore_passive_rev if $imported["PassiveSkill"]
end
#--------------------------------------------------------------------------
# ● 装備の破棄
# item : 破棄する武器 or 防具
# 武器/防具の増減で「装備品も含める」のとき使用する。
#--------------------------------------------------------------------------
alias discard_equip_KGC_EquipExtension discard_equip
def discard_equip(item)
last_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
discard_equip_KGC_EquipExtension(item)
curr_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
return unless item.is_a?(RPG::Armor) # 防具でない
return if last_armors != curr_armors # 既に破棄された
# 拡張防具欄を検索
extra_armor_number.times { |i|
if extra_armor_id[i] == item.id
@extra_armor_id[i] = 0
break
end
}
restore_battle_skill if $imported["SkillCPSystem"]
restore_passive_rev if $imported["PassiveSkill"]
end
#--------------------------------------------------------------------------
# ● 職業 ID の変更
# class_id : 新しい職業 ID
#--------------------------------------------------------------------------
alias class_id_equal_KGC_EquipExtension class_id=
def class_id=(class_id)
class_id_equal_KGC_EquipExtension(class_id)
return if extra_armor_number == 0 # 拡張防具欄がない
# 装備できない拡張防具を外す
for i in 5..armor_number
change_equip(i, nil) unless equippable?(equips[i])
end
end
#--------------------------------------------------------------------------
# ○ EP 条件クリア判定
# equip_type : 装備部位
# item : 武器 or 防具
#--------------------------------------------------------------------------
def ep_condition_clear?(equip_type, item)
return true if item == nil # nil は解除なので OK
curr_item = equips[equip_type]
offset = (curr_item != nil ? curr_item.ep_cost : 0)
return false if self.ep < (item.ep_cost - offset) # EP 不足
return true
end
#--------------------------------------------------------------------------
# ○ 装備を修復
#--------------------------------------------------------------------------
def restore_equip
# 以前の装備品・パラメータを退避
last_equips = equips
last_hp = self.hp
last_mp = self.mp
if $imported["SkillCPSystem"]
last_battle_skill_ids = battle_skill_ids.clone
end
# 全装備解除
last_equips.each_index { |i| change_equip(i, nil) }
# 装備品・パラメータを復元
last_equips.compact.each { |item| equip_legal_slot(item) }
self.hp = last_hp
self.mp = last_mp
if $imported["SkillCPSystem"]
last_battle_skill_ids.each_with_index { |s, i| set_battle_skill(i, s) }
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# ○ 装備品を正しい箇所にセット
# item : 武器 or 防具
#--------------------------------------------------------------------------
def equip_legal_slot(item)
if item.is_a?(RPG::Weapon)
if @weapon_id == 0
# 武器 1
change_equip(0, item)
elsif two_swords_style && @armor1_id == 0
# 武器 2 (二刀流の場合)
change_equip(1, item)
end
elsif item.is_a?(RPG::Armor)
if !two_swords_style && item.kind == equip_type[0] && @armor1_id == 0
# 先頭の防具 (二刀流でない場合)
change_equip(1, item)
else
# 装備箇所リストを作成
list = [-1, @armor2_id, @armor3_id, @armor4_id]
list += extra_armor_id
# 正しい、かつ空いている箇所にセット
equip_type.each_with_index { |kind, i|
if kind == item.kind && list[i] == 0
change_equip(i + 1, item)
break
end
}
end
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ○ EP の文字色を取得
# actor : アクター
#--------------------------------------------------------------------------
def ep_color(actor)
return knockout_color if actor.maxep > 0 && actor.ep == 0
return normal_color
end
#--------------------------------------------------------------------------
# ○ EP ゲージの色 1 の取得
#--------------------------------------------------------------------------
def ep_gauge_color1
color = KGC::EquipExtension::EP_GAUGE_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ EP ゲージの色 2 の取得
#--------------------------------------------------------------------------
def ep_gauge_color2
color = KGC::EquipExtension::EP_GAUGE_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ EP の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 幅
#--------------------------------------------------------------------------
def draw_actor_ep(actor, x, y, width = 120)
draw_actor_ep_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::ep_a)
self.contents.font.color = ep_color(actor)
xr = x + width
if width < 120
self.contents.draw_text(xr - 40, y, 40, WLH, actor.ep, 2)
else
self.contents.draw_text(xr - 90, y, 40, WLH, actor.ep, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxep, 2)
end
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# ○ EP ゲージの描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 幅
#--------------------------------------------------------------------------
def draw_actor_ep_gauge(actor, x, y, width = 120)
gw = width * actor.ep / [actor.maxep, 1].max
gc1 = ep_gauge_color1
gc2 = ep_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
#--------------------------------------------------------------------------
# ○ 消費 EP の描画
# item : 武器 or 防具
# rect : 描画する領域
# enabled : 許可状態
#--------------------------------------------------------------------------
def draw_equipment_ep_cost(item, rect, enabled = true)
return if item == nil
# 消費 EP 0 を表示しない場合
return if KGC::EquipExtension::HIDE_ZERO_EP_COST && item.ep_cost == 0
color = KGC::EquipExtension::EP_COST_COLOR
self.contents.font.color = (color.is_a?(Integer) ?
text_color(color) : color)
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, item.ep_cost, 2)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_Equip
#==============================================================================
class Window_Equip < Window_Selectable
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = @actor.equips.clone
@item_max = [@data.size, @actor.armor_number + 1].min
create_contents
# 装備箇所を描画
self.contents.font.color = system_color
if @actor.two_swords_style
self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1)
self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
else
self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon)
name = armor_slot_name(@actor.equip_type[0])
self.contents.draw_text(4, WLH * 1, 92, WLH, name)
end
for i in [email]1...@actor.armor_number[/email]
name = armor_slot_name(@actor.equip_type[i])
self.contents.draw_text(4, WLH * (i + 1), 92, WLH, name)
end
# 装備品を描画
rect = Rect.new(92, 0, self.width - 128, WLH)
@item_max.times { |i|
rect.y = WLH * i
draw_item_name(@data[i], rect.x, rect.y)
draw_equipment_ep_cost(@data[i], rect)
}
end
#--------------------------------------------------------------------------
# ○ 防具欄の名称を取得
# kind : 種別
#--------------------------------------------------------------------------
def armor_slot_name(kind)
case kind
when 0..3
return eval("Vocab.armor#{kind + 1}")
else
return Vocab.extra_armor(kind - 4)
end
end
unless $imported["ExtendedEquipScene"]
#--------------------------------------------------------------------------
# ● カーソルを 1 ページ後ろに移動
#--------------------------------------------------------------------------
def cursor_pagedown
return if Input.repeat?(Input::R)
super
end
#--------------------------------------------------------------------------
# ● カーソルを 1 ページ前に移動
#--------------------------------------------------------------------------
def cursor_pageup
return if Input.repeat?(Input::L)
super
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
return unless self.active
if Input.repeat?(Input::RIGHT)
cursor_pagedown
elsif Input.repeat?(Input::LEFT)
cursor_pageup
end
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_EquipItem
#==============================================================================
class Window_EquipItem < Window_Item
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
@item_enabled = []
super
@data.each { |item| @item_enabled << enable?(item) }
end
#--------------------------------------------------------------------------
# ● アイテムをリストに含めるかどうか
# item : アイテム
#--------------------------------------------------------------------------
def include?(item)
return true if item == nil
if @equip_type == 0
return false unless item.is_a?(RPG::Weapon)
else
return false unless item.is_a?(RPG::Armor)
return false unless item.kind == @equip_type - 1
end
return @actor.equippable?(item)
end
#--------------------------------------------------------------------------
# ● アイテムを許可状態で表示するかどうか
# item : アイテム
#--------------------------------------------------------------------------
def enable?(item)
return false unless @actor.equippable?(item) # 装備不可
return false unless @actor.ep_condition_clear?(@equip_type, item) # EP 不足
return true
end
#--------------------------------------------------------------------------
# ● 項目の描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_item(index)
super(index)
rect = item_rect(index)
item = @data[index]
# 個数表示分の幅を削る
cw = self.contents.text_size(sprintf(":%2d", 0)).width
rect.width -= cw + 4
draw_equipment_ep_cost(item, rect, enable?(item))
end
#--------------------------------------------------------------------------
# ○ 簡易リフレッシュ
# equip_type : 装備部位
#--------------------------------------------------------------------------
def simple_refresh(equip_type)
# 一時的に装備部位を変更
last_equip_type = @equip_type
@equip_type = equip_type
@data.each_with_index { |item, i|
# 許可状態が変化した項目のみ再描画
if enable?(item) != @item_enabled[i]
draw_item(i)
@item_enabled[i] = enable?(item)
end
}
# 装備部位を戻す
@equip_type = last_equip_type
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_EquipStatus
#==============================================================================
class Window_EquipStatus < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias refresh_KGC_EquipExtension refresh
def refresh
refresh_KGC_EquipExtension
draw_actor_ep(@actor, 120, 0, 56) if KGC::EquipExtension::USE_EP_SYSTEM
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_Status
#==============================================================================
class Window_Status < Window_Base
if KGC::EquipExtension::SHOW_STATUS_EP
#--------------------------------------------------------------------------
# ● 基本情報の描画
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
alias draw_basic_info_KGC_EquipExtension draw_basic_info
def draw_basic_info(x, y)
draw_basic_info_KGC_EquipExtension(x, y)
draw_actor_ep(@actor, x + 180, y + WLH * 4)
end
end
#--------------------------------------------------------------------------
# ● 装備品の描画
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
def draw_equipments(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
item_number = [@actor.equips.size, @actor.armor_number + 1].min
item_number.times { |i|
draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
}
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Equip
#==============================================================================
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# ● 定数
#--------------------------------------------------------------------------
EQUIP_TYPE_MAX = KGC::EquipExtension::EXTRA_EQUIP_KIND.size + 5
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_index : アクターインデックス
# equip_index : 装備インデックス
#--------------------------------------------------------------------------
alias initialize_KGC_EquipExtension initialize
def initialize(actor_index = 0, equip_index = 0)
initialize_KGC_EquipExtension(actor_index, equip_index)
unit = ($imported["LargeParty"] ?
$game_party.all_members : $game_party.members)
actor = unit[actor_index]
@equip_index = [@equip_index, actor.armor_number].min
end
#--------------------------------------------------------------------------
# ● アイテムウィンドウの作成
#--------------------------------------------------------------------------
alias create_item_windows_KGC_EquipExtension create_item_windows
def create_item_windows
create_item_windows_KGC_EquipExtension
kind = equip_kind(@equip_index)
EQUIP_TYPE_MAX.times { |i|
@item_windows[i].visible = (kind == i)
}
end
#--------------------------------------------------------------------------
# ● アイテムウィンドウの更新
#--------------------------------------------------------------------------
def update_item_windows
kind = equip_kind(@equip_window.index)
for i in 0...EQUIP_TYPE_MAX
@item_windows[i].visible = (kind == i)
@item_windows[i].update
end
@item_window = @item_windows[kind]
@item_window.simple_refresh(@equip_window.index)
end
#--------------------------------------------------------------------------
# ○ 装備欄の種別を取得
# index : 装備欄インデックス
#--------------------------------------------------------------------------
def equip_kind(index)
if index == 0
return 0
else
return @actor.equip_type[index - 1] + 1
end
end
unless $imported["ExtendedEquipScene"]
#--------------------------------------------------------------------------
# ● ステータスウィンドウの更新
#--------------------------------------------------------------------------
def update_status_window
if @equip_window.active
@status_window.set_new_parameters(nil, nil, nil, nil)
elsif @item_window.active
temp_actor = Marshal.load(Marshal.dump(@actor))
temp_actor.change_equip(@equip_window.index, @item_window.item, true)
new_atk = temp_actor.atk
new_def = temp_actor.def
new_spi = temp_actor.spi
new_agi = temp_actor.agi
@status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
end
@status_window.update
end
end
#--------------------------------------------------------------------------
# ● アイテム選択の更新
#--------------------------------------------------------------------------
alias update_item_selection_KGC_EquipExtension update_item_selection
def update_item_selection
if Input.trigger?(Input::C)
# 装備不可能な場合
index = @equip_window.index
item = @item_window.item
unless item == nil ||
(@actor.equippable?(item) && @actor.ep_condition_clear?(index, item))
Sound.play_buzzer
return
end
end
update_item_selection_KGC_EquipExtension
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# ● セーブデータの読み込み
# file : 読み込み用ファイルオブジェクト (オープン済み)
#--------------------------------------------------------------------------
alias read_save_data_KGC_EquipExtension read_save_data
def read_save_data(file)
read_save_data_KGC_EquipExtension(file)
KGC::Commands.restore_equip
Graphics.frame_reset
end
end
下面是 装备技能
#------------------------------------------------------------------------------ # ■ 装备技能修炼v1.0(VX) # by:Ultra # 1.0(XP) # /2010.5.29 # 1.0(VX) # /2010.7.12 # -添加了VX专属条形槽(RGSS2渐变描绘) # -添加了VX双手武器的判断 # -部分逻辑的改变 #------------------------------------------------------------------------------ # -AP条形槽设定 #----类型 #1:正常 2:渐变型 3:自定义 $VXAS_AP = 3 #----背景的颜色[r,g,b,o] $VXAS_B = [0,0,0,200] #----自定义渐变条形槽 $VXAS_K = [255,255,255,0] #边框颜色[r,g,b,o] $VXAS_RGBO1 = [50,100,200,255] #始渐变色[r,g,b,o] $VXAS_RGBO2 = [180,200,50,255] #终渐变色[r,g,b,o] #~ -武器 防具对应的技能: #~ ----在武器,防具名称最后加上 @技能ID #~ ----例如:铜剑@20★ 铜剑的对应技能为 20 号 #~ -AP增减方法: #~ ----全队员增加 $as.gain_ap(5,$as.sk) ★全部队员技能 ap+5 #~ ----详细角色增加 $as.gain_ap(33,{1=>[1,2,3],7=>[2]}) ★1号角色技能1,2,3号 ap+33,7号角色技能2号 ap+33 #~ ----多角色增加 #~ for i in 1..8 #~ $as.gain_ap(10,$as.sk(2,i)) ★1到8号角色技能 ap+10 #~ end #~ ----减少ap方法同上,gain_ap改为lose_ap即可 #~ -AP最大值设定: #~ ----脚本24行 #~ -战斗胜利获得的AP: #~ ----在敌人队伍名称最后加上 @AP值 #~ ----例如:幽灵*2@10 ★ 战斗胜利 全部队员 ap+10 #~ -检查更新AP的方法: #~ ----$game_actors[id].iniek ★ 正常情况下不会用到。(注明此方法以提供需求用户使用) #~ -事件的 增减特技: #~ ----1:如果减少技能时,这个技能正被角色装备中,是无效的(减不掉) #~ ----2:与 1 相反(即没装备中),是可以遗忘的(ap=0) #~ ----3:增加时,该技能的ap直接满(直接习得) #~ -事件的‘更改角色职业’ #~ ----更改职业时被脱下装备时,它的技能也会遗忘(ap值保留,改回职业时 可以继续修炼这个技能) #~ ----这样设定希望你可以更好的做到‘职业平衡’的效果 #------------------------------------------------------------------------------ class As attr_accessor :as attr_accessor :maxas def initialize @as = {} @maxas = {} for i in 1...$data_actors.size @as[i] = [] for n in 0...$data_skills.size @as[i][n] = 0 end end for i in 1...$data_actors.size @maxas[i] = [] for n in 0...$data_skills.size @maxas[i][n] = 100 end end ##################MAXAP################## #基本设定方法 @maxas[1][10] = 10 # 1号角色10号技能最大ap=888 @maxas[1][82] = 999 ##################MAXAP################## end def sk(n = 0,w = 0) @data = [] @data_s = {} case n when 0 for b in 0...$game_party.members.size actor = $game_party.members[b] for i in 0...$game_party.members[b].skills.size skill = $game_party.members[b].skills[i] if skill != nil @data.push(skill.id) end end @data_s[actor.id] = @data @data = [] end when 1 actor = $game_party.members[w] for i in 0...$game_party.members[w].skills.size skill = $game_party.members[w].skills[i] if skill != nil @data.push(skill.id) end end @data_s[actor.id] = @data @data = [] when 2 actor = $game_actors[w] for i in 0...$game_actors[w].skills.size skill = $game_actors[w].skills[i] if skill != nil @data.push(skill.id) end end @data_s[actor.id] = @data @data = [] end return @data_s end def gain_ap(s,id ={}) for b in id.keys for i in 0...id[b].size max = @maxas[b][id[b][i]] if not max == nil @as[b][id[b][i]] += s if @as[b][id[b][i]] >= max @as[b][id[b][i]] = max end end end end end def lose_ap(s,id ={}) for b in id.keys for i in 0...id[b].size @as[b][id[b][i]] -= s if @as[b][id[b][i]] <= 0 @as[b][id[b][i]] = 0 end end end end #actor_id:角色ID skill_id[id,newid]:技能ID ewhy:0=旧装备 1=新装备 2=空白装备 3=空白物品 def lf_ap(actor_id,ewhy,skill_id=[]) if ewhy == 0 $game_actors[actor_id].learn_skills(skill_id[0]) elsif ewhy == 1 eap = $as.as[actor_id][skill_id[0]] == $as.maxas[actor_id][skill_id[0]] ? true : false if eap == true $game_actors[actor_id].learn_skills(skill_id[0]) $game_actors[actor_id].learn_skills(skill_id[1]) else $game_actors[actor_id].forget_skills(skill_id[0]) $game_actors[actor_id].learn_skills(skill_id[1]) end elsif ewhy == 2 $game_actors[actor_id].learn_skills(skill_id[1]) elsif ewhy == 3 eap = $as.as[actor_id][skill_id[0]] == $as.maxas[actor_id][skill_id[0]] ? true : false if eap == true $game_actors[actor_id].learn_skills(skill_id[0]) else $game_actors[actor_id].forget_skills(skill_id[0]) end end end end class Game_Actor def equippable_as?(item) if item.is_a?(RPG::Weapon) v = self.class.weapon_set.include?(item.id) if !v aek = $data_weapons[item.id].aek $as.lf_ap(self.id,3,[aek]) if aek != nil end return v end if item.is_a?(RPG::Armor) v = self.class.armor_set.include?(item.id) if !v aek = $data_armors[item.id].aek $as.lf_ap(self.id,3,[aek]) if aek != nil end return false if two_swords_style and item.kind == 0 return v end return false end def class_id=(class_id) @class_id = class_id for i in 0..4 # 卸下不可装备的装备物品 change_equip(i, nil) unless equippable_as?(equips[i]) end end def iniek data = equips data.compact! for i in 0...data.size if data[i].aek != nil $as.lf_ap(self.id,0,[data[i].aek]) end end end def skill_aek data = equips data2 = [] data.compact! for i in 0...data.size if data[i].aek != nil data2.push(data[i].aek) end end return data2 end def learn_skill(skill_id) unless skill_learn?($data_skills[skill_id]) $as.as[self.id][skill_id] = $as.maxas[self.id][skill_id] @skills.push(skill_id) @skills.sort! end end def forget_skill(skill_id) skill_aek = $game_actors[self.id].skill_aek if not skill_aek.include?(skill_id) $as.as[self.id][skill_id] = 0 @skills.delete(skill_id) end end def learn_skills(skill_id) unless skill_learn?($data_skills[skill_id]) @skills.push(skill_id) @skills.sort! end end def forget_skills(skill_id) @skills.delete(skill_id) end def change_equip(equip_type, item, test = false) last_item = equips[equip_type] unless test return if $game_party.item_number(item) == 0 if item != nil $game_party.gain_item(last_item, 1) $game_party.lose_item(item, 1) end item_id = item == nil ? 0 : item.id case equip_type when 0 # 武器 @weapon_id = item_id unless two_hands_legal? # 非双手装备的场合,自动卸下装备 #★VX★ aek = $data_armors[equips[1].id].aek $as.lf_ap(self.id,3,[aek]) if aek != nil change_equip(1, nil, test) #★VX★ end when 1 # 盾 @armor1_id = item_id unless two_hands_legal? # 非双手装备的场合,自动卸下装备 #★VX★ aek = $data_weapons[equips[0].id].aek $as.lf_ap(self.id,3,[aek]) if aek != nil #★VX★ change_equip(0, nil, test) end when 2 # 头部防具 @armor2_id = item_id when 3 # 身体防具 @armor3_id = item_id when 4 # 装饰品 @armor4_id = item_id end end end class Game_Party def setup_starting_members @actors = [] for i in $data_system.party_members @actors.push(i) $game_actors[i].iniek end end def add_actor(actor_id) if @actors.size < MAX_MEMBERS and not @actors.include?(actor_id) $game_actors[actor_id].iniek @actors.push(actor_id) $game_player.refresh end end end module RPG class Troop def name name = @name.split(/@/)[0] return name != nil ? name : "" end def ap ap = @name.split(/@/)[1] return ap != nil ? ap.to_i : 0 end end class Armor def name name = @name.split(/@/)[0] return name != nil ? name : "" end def aek aek = @name.split(/@/)[1] return aek != nil ? aek.to_i : nil end end class Weapon def name name = @name.split(/@/)[0] return name != nil ? name : "" end def aek aek = @name.split(/@/)[1] return aek != nil ? aek.to_i : nil end end end class Window_Base < Window def draw_actor_ap(actor_id,skill_id,x,y,width = 128,value = false) as = $as.as[actor_id][skill_id] maxas = $as.maxas[actor_id][skill_id] r = 10 g = 100 b = 255 r2 = 100 g2 = 200 b2 = 150 o = 255 color_b = Color.new(55,180,255,200) w = width * as / maxas y += 14 #背景 self.contents.fill_rect(x, y, width, 4, Color.new($VXAS_B[0],$VXAS_B[1],$VXAS_B[2],$VXAS_B[3])) #描绘 if $VXAS_AP == 1 color_b = Color.new(55,180,255,255) self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o)) self.contents.fill_rect(x, y+1, w, 1,Color.new(r+46,g+79,b+10,o)) self.contents.fill_rect(x, y+2, w, 1,Color.new(r+13,g+59,b-41,o)) self.contents.fill_rect(x, y+3, w, 1,Color.new(r+18,g+73,b-43,o)) elsif $VXAS_AP == 2 color_b = Color.new(255,255,255,255) self.contents.gradient_fill_rect(x, y, w, 1, Color.new(r+46,g+79,b+12,o),Color.new(r2+46,g2+79,b2+12,o)) self.contents.gradient_fill_rect(x, y+1, w, 1, Color.new(r+46,g+79,b+10,o),Color.new(r2+46,g2+79,b2+10,o)) self.contents.gradient_fill_rect(x, y+2, w, 1, Color.new(r+13,g+59,b-41,o),Color.new(r2+13,g2+59,b2-41,o)) self.contents.gradient_fill_rect(x, y+3, w, 1, Color.new(r+18,g+73,b-43,o),Color.new(r2+18,g2+73,b2-43,o)) elsif $VXAS_AP == 3 && !$VXAS_RGBO1.empty? && !$VXAS_RGBO2.empty? color_b = Color.new($VXAS_K[0],$VXAS_K[1],$VXAS_K[2],$VXAS_K[3]) r = $VXAS_RGBO1[0] g = $VXAS_RGBO1[1] b = $VXAS_RGBO1[2] o = $VXAS_RGBO1[3] r2 = $VXAS_RGBO2[0] g2 = $VXAS_RGBO2[1] b2 = $VXAS_RGBO2[2] o2 = $VXAS_RGBO2[3] self.contents.gradient_fill_rect(x, y, w, 1, Color.new(r+46,g+79,b+12,o),Color.new(r2+46,g2+79,b2+12,o2)) self.contents.gradient_fill_rect(x, y+1, w, 1, Color.new(r+46,g+79,b+10,o),Color.new(r2+46,g2+79,b2+10,o2)) self.contents.gradient_fill_rect(x, y+2, w, 1, Color.new(r+13,g+59,b-41,o),Color.new(r2+13,g2+59,b2-41,o2)) self.contents.gradient_fill_rect(x, y+3, w, 1, Color.new(r+18,g+73,b-43,o),Color.new(r2+18,g2+73,b2-43,o2)) else color_b = Color.new(55,180,255,255) self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o)) self.contents.fill_rect(x, y+1, w, 1,Color.new(r+46,g+79,b+10,o)) self.contents.fill_rect(x, y+2, w, 1,Color.new(r+13,g+59,b-41,o)) self.contents.fill_rect(x, y+3, w, 1,Color.new(r+18,g+73,b-43,o)) end #边框 self.contents.fill_rect(x-1, y-1, width+2, 1, color_b) self.contents.fill_rect(x-1, y+4, width+2, 1, color_b) self.contents.fill_rect(x-1, y, 1, 4, color_b) self.contents.fill_rect(x+width, y, 1, 4, color_b) self.contents.font.size = 15 name = $data_skills[skill_id].name self.contents.draw_text(x-20, y-22, 48, 32, "Ap") self.contents.draw_text(x, y-(11+14), 68, 32, name) self.contents.font.size = 15 unless value self.contents.draw_text(x+width, y-15, 20, 32, as.to_s, 2) self.contents.draw_text(x+width+20, y-15, 12, 32, "/", 1) self.contents.draw_text(x+width+20+12, y-15, 20, 32, maxas.to_s) end self.contents.font.size = Font.default_size end end #------------------------------------------------------------------------------- class Scene_Title alias :orig_create_game_objects :create_game_objects def create_game_objects orig_create_game_objects #★★★★★★★★★★★★★★★★★★★ $as = As.new #★★★★★★★★★★★★★★★★★★★ end end class Window_Help def set_es(text,actor_id,aek) if text != @text self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, WLH, text) draw_actor_ap(actor_id,aek,380,4,80) @text = text end end end class Window_Equip def refresh self.contents.clear @data = [] for item in @actor.equips do @data.push(item) end @item_max = @data.size self.contents.font.color = system_color if @actor.two_swords_style self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1) self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2) else self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon) self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::armor1) end self.contents.draw_text(4, WLH * 2, 92, WLH, Vocab::armor2) self.contents.draw_text(4, WLH * 3, 92, WLH, Vocab::armor3) self.contents.draw_text(4, WLH * 4, 92, WLH, Vocab::armor4) draw_item_name(@data[0], 62, WLH * 0) draw_item_name(@data[1], 62, WLH * 1) draw_item_name(@data[2], 62, WLH * 2) draw_item_name(@data[3], 62, WLH * 3) draw_item_name(@data[4], 62, WLH * 4) #★★★★★★★★★★★★★★★★★★★ x=190 for i in 0..4 if @data[i] != nil and @data[i].aek != nil if $as.maxas[@actor.id][@data[i].aek] == nil return else self.contents.font.size = 15 draw_actor_ap(@actor.id,@data[i].aek,x+15,4+WLH*i,80,true) self.contents.font.size = Font.default_size end end end #★★★★★★★★★★★★★★★★★★★ end def update_help if item != nil && item.aek != nil @help_window.set_es(item.description,@actor.id,item.aek) else @help_window.set_text(item == nil ? "" : item.description) end end end class Window_Item def update_help if item != nil && item.aek != nil && @actor != nil @help_window.set_es(item.description,@actor.id,item.aek) else @help_window.set_text(item == nil ? "" : item.description) end end end class Scene_Equip def update_item_selection if Input.trigger?(Input::B) Sound.play_cancel @equip_window.active = true @item_window.active = false @item_window.index = -1 elsif Input.trigger?(Input::C) Sound.play_equip #★★★★★★★★★★★★★★★★★★★ item = @item_window.item i = @equip_window.item if i.id == item.id elsif i.id != item.id and i != nil and item != nil if i.aek != nil and item.aek != nil $as.lf_ap(@actor.id,1,[i.aek,item.aek]) elsif i.aek != nil $as.lf_ap(@actor.id,3,[i.aek,nil]) elsif item.aek != nil $as.lf_ap(@actor.id,2,[nil,item.aek]) end elsif i == nil if item.aek != nil $as.lf_ap(@actor.id,2,[nil,item.aek]) end elsif item == nil if i.aek != nil $as.lf_ap(@actor.id,3,[i.aek,nil]) end end #★★★★★★★★★★★★★★★★★★★ @actor.change_equip(@equip_window.index, @item_window.item) @equip_window.active = true @item_window.active = false @item_window.index = -1 @equip_window.refresh for item_window in @item_windows item_window.refresh end end end end class Scene_File alias :orig_write_save_data :write_save_data def write_save_data(file) orig_write_save_data(file) Marshal.dump($as,file) end alias :orig_read_save_data :read_save_data def read_save_data(file) orig_read_save_data(file) $as = Marshal.load(file) end end class Scene_Battle alias :orig_process_victory :process_victory def process_victory orig_process_victory #★★★★★★★★★★★★★★★★★★★ ap = $game_troop.troop.ap $as.gain_ap(ap,$as.sk) #★★★★★★★★★★★★★★★★★★★ end end
#------------------------------------------------------------------------------
# ■ 装备技能修炼v1.0(VX)
# by:Ultra
# 1.0(XP)
# /2010.5.29
# 1.0(VX)
# /2010.7.12
# -添加了VX专属条形槽(RGSS2渐变描绘)
# -添加了VX双手武器的判断
# -部分逻辑的改变
#------------------------------------------------------------------------------
# -AP条形槽设定
#----类型
#1:正常 2:渐变型 3:自定义
$VXAS_AP = 3
#----背景的颜色[r,g,b,o]
$VXAS_B = [0,0,0,200]
#----自定义渐变条形槽
$VXAS_K = [255,255,255,0] #边框颜色[r,g,b,o]
$VXAS_RGBO1 = [50,100,200,255] #始渐变色[r,g,b,o]
$VXAS_RGBO2 = [180,200,50,255] #终渐变色[r,g,b,o]
#~ -武器 防具对应的技能:
#~ ----在武器,防具名称最后加上 @技能ID
#~ ----例如:铜剑@20★ 铜剑的对应技能为 20 号
#~ -AP增减方法:
#~ ----全队员增加 $as.gain_ap(5,$as.sk) ★全部队员技能 ap+5
#~ ----详细角色增加 $as.gain_ap(33,{1=>[1,2,3],7=>[2]}) ★1号角色技能1,2,3号 ap+33,7号角色技能2号 ap+33
#~ ----多角色增加
#~ for i in 1..8
#~ $as.gain_ap(10,$as.sk(2,i)) ★1到8号角色技能 ap+10
#~ end
#~ ----减少ap方法同上,gain_ap改为lose_ap即可
#~ -AP最大值设定:
#~ ----脚本24行
#~ -战斗胜利获得的AP:
#~ ----在敌人队伍名称最后加上 @AP值
#~ ----例如:幽灵*2@10 ★ 战斗胜利 全部队员 ap+10
#~ -检查更新AP的方法:
#~ ----$game_actors[id].iniek ★ 正常情况下不会用到。(注明此方法以提供需求用户使用)
#~ -事件的 增减特技:
#~ ----1:如果减少技能时,这个技能正被角色装备中,是无效的(减不掉)
#~ ----2:与 1 相反(即没装备中),是可以遗忘的(ap=0)
#~ ----3:增加时,该技能的ap直接满(直接习得)
#~ -事件的‘更改角色职业’
#~ ----更改职业时被脱下装备时,它的技能也会遗忘(ap值保留,改回职业时 可以继续修炼这个技能)
#~ ----这样设定希望你可以更好的做到‘职业平衡’的效果
#------------------------------------------------------------------------------
class As
attr_accessor :as
attr_accessor :maxas
def initialize
@as = {}
@maxas = {}
for i in 1...$data_actors.size
@as[i] = []
for n in 0...$data_skills.size
@as[i][n] = 0
end
end
for i in 1...$data_actors.size
@maxas[i] = []
for n in 0...$data_skills.size
@maxas[i][n] = 100
end
end
##################MAXAP##################
#基本设定方法
@maxas[1][10] = 10 # 1号角色10号技能最大ap=888
@maxas[1][82] = 999
##################MAXAP##################
end
def sk(n = 0,w = 0)
@data = []
@data_s = {}
case n
when 0
for b in 0...$game_party.members.size
actor = $game_party.members[b]
for i in 0...$game_party.members[b].skills.size
skill = $game_party.members[b].skills[i]
if skill != nil
@data.push(skill.id)
end
end
@data_s[actor.id] = @data
@data = []
end
when 1
actor = $game_party.members[w]
for i in 0...$game_party.members[w].skills.size
skill = $game_party.members[w].skills[i]
if skill != nil
@data.push(skill.id)
end
end
@data_s[actor.id] = @data
@data = []
when 2
actor = $game_actors[w]
for i in 0...$game_actors[w].skills.size
skill = $game_actors[w].skills[i]
if skill != nil
@data.push(skill.id)
end
end
@data_s[actor.id] = @data
@data = []
end
return @data_s
end
def gain_ap(s,id ={})
for b in id.keys
for i in 0...id[b].size
max = @maxas[b][id[b][i]]
if not max == nil
@as[b][id[b][i]] += s
if @as[b][id[b][i]] >= max
@as[b][id[b][i]] = max
end
end
end
end
end
def lose_ap(s,id ={})
for b in id.keys
for i in 0...id[b].size
@as[b][id[b][i]] -= s
if @as[b][id[b][i]] <= 0
@as[b][id[b][i]] = 0
end
end
end
end
#actor_id:角色ID skill_id[id,newid]:技能ID ewhy:0=旧装备 1=新装备 2=空白装备 3=空白物品
def lf_ap(actor_id,ewhy,skill_id=[])
if ewhy == 0
$game_actors[actor_id].learn_skills(skill_id[0])
elsif ewhy == 1
eap = $as.as[actor_id][skill_id[0]] == $as.maxas[actor_id][skill_id[0]] ? true : false
if eap == true
$game_actors[actor_id].learn_skills(skill_id[0])
$game_actors[actor_id].learn_skills(skill_id[1])
else
$game_actors[actor_id].forget_skills(skill_id[0])
$game_actors[actor_id].learn_skills(skill_id[1])
end
elsif ewhy == 2
$game_actors[actor_id].learn_skills(skill_id[1])
elsif ewhy == 3
eap = $as.as[actor_id][skill_id[0]] == $as.maxas[actor_id][skill_id[0]] ? true : false
if eap == true
$game_actors[actor_id].learn_skills(skill_id[0])
else
$game_actors[actor_id].forget_skills(skill_id[0])
end
end
end
end
class Game_Actor
def equippable_as?(item)
if item.is_a?(RPG::Weapon)
v = self.class.weapon_set.include?(item.id)
if !v
aek = $data_weapons[item.id].aek
$as.lf_ap(self.id,3,[aek]) if aek != nil
end
return v
end
if item.is_a?(RPG::Armor)
v = self.class.armor_set.include?(item.id)
if !v
aek = $data_armors[item.id].aek
$as.lf_ap(self.id,3,[aek]) if aek != nil
end
return false if two_swords_style and item.kind == 0
return v
end
return false
end
def class_id=(class_id)
@class_id = class_id
for i in 0..4 # 卸下不可装备的装备物品
change_equip(i, nil) unless equippable_as?(equips[i])
end
end
def iniek
data = equips
data.compact!
for i in 0...data.size
if data[i].aek != nil
$as.lf_ap(self.id,0,[data[i].aek])
end
end
end
def skill_aek
data = equips
data2 = []
data.compact!
for i in 0...data.size
if data[i].aek != nil
data2.push(data[i].aek)
end
end
return data2
end
def learn_skill(skill_id)
unless skill_learn?($data_skills[skill_id])
$as.as[self.id][skill_id] = $as.maxas[self.id][skill_id]
@skills.push(skill_id)
@skills.sort!
end
end
def forget_skill(skill_id)
skill_aek = $game_actors[self.id].skill_aek
if not skill_aek.include?(skill_id)
$as.as[self.id][skill_id] = 0
@skills.delete(skill_id)
end
end
def learn_skills(skill_id)
unless skill_learn?($data_skills[skill_id])
@skills.push(skill_id)
@skills.sort!
end
end
def forget_skills(skill_id)
@skills.delete(skill_id)
end
def change_equip(equip_type, item, test = false)
last_item = equips[equip_type]
unless test
return if $game_party.item_number(item) == 0 if item != nil
$game_party.gain_item(last_item, 1)
$game_party.lose_item(item, 1)
end
item_id = item == nil ? 0 : item.id
case equip_type
when 0 # 武器
@weapon_id = item_id
unless two_hands_legal? # 非双手装备的场合,自动卸下装备
#★VX★
aek = $data_armors[equips[1].id].aek
$as.lf_ap(self.id,3,[aek]) if aek != nil
change_equip(1, nil, test)
#★VX★
end
when 1 # 盾
@armor1_id = item_id
unless two_hands_legal? # 非双手装备的场合,自动卸下装备
#★VX★
aek = $data_weapons[equips[0].id].aek
$as.lf_ap(self.id,3,[aek]) if aek != nil
#★VX★
change_equip(0, nil, test)
end
when 2 # 头部防具
@armor2_id = item_id
when 3 # 身体防具
@armor3_id = item_id
when 4 # 装饰品
@armor4_id = item_id
end
end
end
class Game_Party
def setup_starting_members
@actors = []
for i in $data_system.party_members
@actors.push(i)
$game_actors[i].iniek
end
end
def add_actor(actor_id)
if @actors.size < MAX_MEMBERS and not @actors.include?(actor_id)
$game_actors[actor_id].iniek
@actors.push(actor_id)
$game_player.refresh
end
end
end
module RPG
class Troop
def name
name = @name.split(/@/)[0]
return name != nil ? name : ""
end
def ap
ap = @name.split(/@/)[1]
return ap != nil ? ap.to_i : 0
end
end
class Armor
def name
name = @name.split(/@/)[0]
return name != nil ? name : ""
end
def aek
aek = @name.split(/@/)[1]
return aek != nil ? aek.to_i : nil
end
end
class Weapon
def name
name = @name.split(/@/)[0]
return name != nil ? name : ""
end
def aek
aek = @name.split(/@/)[1]
return aek != nil ? aek.to_i : nil
end
end
end
class Window_Base < Window
def draw_actor_ap(actor_id,skill_id,x,y,width = 128,value = false)
as = $as.as[actor_id][skill_id]
maxas = $as.maxas[actor_id][skill_id]
r = 10
g = 100
b = 255
r2 = 100
g2 = 200
b2 = 150
o = 255
color_b = Color.new(55,180,255,200)
w = width * as / maxas
y += 14
#背景
self.contents.fill_rect(x, y, width, 4,
Color.new($VXAS_B[0],$VXAS_B[1],$VXAS_B[2],$VXAS_B[3]))
#描绘
if $VXAS_AP == 1
color_b = Color.new(55,180,255,255)
self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o))
self.contents.fill_rect(x, y+1, w, 1,Color.new(r+46,g+79,b+10,o))
self.contents.fill_rect(x, y+2, w, 1,Color.new(r+13,g+59,b-41,o))
self.contents.fill_rect(x, y+3, w, 1,Color.new(r+18,g+73,b-43,o))
elsif $VXAS_AP == 2
color_b = Color.new(255,255,255,255)
self.contents.gradient_fill_rect(x, y, w, 1,
Color.new(r+46,g+79,b+12,o),Color.new(r2+46,g2+79,b2+12,o))
self.contents.gradient_fill_rect(x, y+1, w, 1,
Color.new(r+46,g+79,b+10,o),Color.new(r2+46,g2+79,b2+10,o))
self.contents.gradient_fill_rect(x, y+2, w, 1,
Color.new(r+13,g+59,b-41,o),Color.new(r2+13,g2+59,b2-41,o))
self.contents.gradient_fill_rect(x, y+3, w, 1,
Color.new(r+18,g+73,b-43,o),Color.new(r2+18,g2+73,b2-43,o))
elsif $VXAS_AP == 3 && !$VXAS_RGBO1.empty? && !$VXAS_RGBO2.empty?
color_b = Color.new($VXAS_K[0],$VXAS_K[1],$VXAS_K[2],$VXAS_K[3])
r = $VXAS_RGBO1[0]
g = $VXAS_RGBO1[1]
b = $VXAS_RGBO1[2]
o = $VXAS_RGBO1[3]
r2 = $VXAS_RGBO2[0]
g2 = $VXAS_RGBO2[1]
b2 = $VXAS_RGBO2[2]
o2 = $VXAS_RGBO2[3]
self.contents.gradient_fill_rect(x, y, w, 1,
Color.new(r+46,g+79,b+12,o),Color.new(r2+46,g2+79,b2+12,o2))
self.contents.gradient_fill_rect(x, y+1, w, 1,
Color.new(r+46,g+79,b+10,o),Color.new(r2+46,g2+79,b2+10,o2))
self.contents.gradient_fill_rect(x, y+2, w, 1,
Color.new(r+13,g+59,b-41,o),Color.new(r2+13,g2+59,b2-41,o2))
self.contents.gradient_fill_rect(x, y+3, w, 1,
Color.new(r+18,g+73,b-43,o),Color.new(r2+18,g2+73,b2-43,o2))
else
color_b = Color.new(55,180,255,255)
self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o))
self.contents.fill_rect(x, y+1, w, 1,Color.new(r+46,g+79,b+10,o))
self.contents.fill_rect(x, y+2, w, 1,Color.new(r+13,g+59,b-41,o))
self.contents.fill_rect(x, y+3, w, 1,Color.new(r+18,g+73,b-43,o))
end
#边框
self.contents.fill_rect(x-1, y-1, width+2, 1, color_b)
self.contents.fill_rect(x-1, y+4, width+2, 1, color_b)
self.contents.fill_rect(x-1, y, 1, 4, color_b)
self.contents.fill_rect(x+width, y, 1, 4, color_b)
self.contents.font.size = 15
name = $data_skills[skill_id].name
self.contents.draw_text(x-20, y-22, 48, 32, "Ap")
self.contents.draw_text(x, y-(11+14), 68, 32, name)
self.contents.font.size = 15
unless value
self.contents.draw_text(x+width, y-15, 20, 32, as.to_s, 2)
self.contents.draw_text(x+width+20, y-15, 12, 32, "/", 1)
self.contents.draw_text(x+width+20+12, y-15, 20, 32, maxas.to_s)
end
self.contents.font.size = Font.default_size
end
end
#-------------------------------------------------------------------------------
class Scene_Title
alias :orig_create_game_objects :create_game_objects
def create_game_objects
orig_create_game_objects
#★★★★★★★★★★★★★★★★★★★
$as = As.new
#★★★★★★★★★★★★★★★★★★★
end
end
class Window_Help
def set_es(text,actor_id,aek)
if text != @text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, WLH, text)
draw_actor_ap(actor_id,aek,380,4,80)
@text = text
end
end
end
class Window_Equip
def refresh
self.contents.clear
@data = []
for item in @actor.equips do @data.push(item) end
@item_max = @data.size
self.contents.font.color = system_color
if @actor.two_swords_style
self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1)
self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
else
self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon)
self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::armor1)
end
self.contents.draw_text(4, WLH * 2, 92, WLH, Vocab::armor2)
self.contents.draw_text(4, WLH * 3, 92, WLH, Vocab::armor3)
self.contents.draw_text(4, WLH * 4, 92, WLH, Vocab::armor4)
draw_item_name(@data[0], 62, WLH * 0)
draw_item_name(@data[1], 62, WLH * 1)
draw_item_name(@data[2], 62, WLH * 2)
draw_item_name(@data[3], 62, WLH * 3)
draw_item_name(@data[4], 62, WLH * 4)
#★★★★★★★★★★★★★★★★★★★
x=190
for i in 0..4
if @data[i] != nil and @data[i].aek != nil
if $as.maxas[@actor.id][@data[i].aek] == nil
return
else
self.contents.font.size = 15
draw_actor_ap(@actor.id,@data[i].aek,x+15,4+WLH*i,80,true)
self.contents.font.size = Font.default_size
end
end
end
#★★★★★★★★★★★★★★★★★★★
end
def update_help
if item != nil && item.aek != nil
@help_window.set_es(item.description,@actor.id,item.aek)
else
@help_window.set_text(item == nil ? "" : item.description)
end
end
end
class Window_Item
def update_help
if item != nil && item.aek != nil && @actor != nil
@help_window.set_es(item.description,@actor.id,item.aek)
else
@help_window.set_text(item == nil ? "" : item.description)
end
end
end
class Scene_Equip
def update_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
elsif Input.trigger?(Input::C)
Sound.play_equip
#★★★★★★★★★★★★★★★★★★★
item = @item_window.item
i = @equip_window.item
if i.id == item.id
elsif i.id != item.id and i != nil and item != nil
if i.aek != nil and item.aek != nil
$as.lf_ap(@actor.id,1,[i.aek,item.aek])
elsif i.aek != nil
$as.lf_ap(@actor.id,3,[i.aek,nil])
elsif item.aek != nil
$as.lf_ap(@actor.id,2,[nil,item.aek])
end
elsif i == nil
if item.aek != nil
$as.lf_ap(@actor.id,2,[nil,item.aek])
end
elsif item == nil
if i.aek != nil
$as.lf_ap(@actor.id,3,[i.aek,nil])
end
end
#★★★★★★★★★★★★★★★★★★★
@actor.change_equip(@equip_window.index, @item_window.item)
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
@equip_window.refresh
for item_window in @item_windows
item_window.refresh
end
end
end
end
class Scene_File
alias :orig_write_save_data :write_save_data
def write_save_data(file)
orig_write_save_data(file)
Marshal.dump($as,file)
end
alias :orig_read_save_data :read_save_data
def read_save_data(file)
orig_read_save_data(file)
$as = Marshal.load(file)
end
end
class Scene_Battle
alias :orig_process_victory :process_victory
def process_victory
orig_process_victory
#★★★★★★★★★★★★★★★★★★★
ap = $game_troop.troop.ap
$as.gain_ap(ap,$as.sk)
#★★★★★★★★★★★★★★★★★★★
end
end
|
|