| 赞 | 1 |
| VIP | |
| 好人卡 | |
| 积分 | 5 |
| 经验 | |
| 最后登录 | 2019-9-5 |
| 在线时间 | 664 小时 |
- 梦石
- 0
- 星屑
- 539
- 在线时间
- 664 小时
- 注册时间
- 2010-6-30
- 回帖
- 198
|
悬赏1星屑已解决
本帖最后由 Front 于 2013-12-10 14:09 编辑
自己范例里有几个脚本都有类似的一段脚本。
- 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
复制代码
几个脚本加起来以后,把主角设置的越多~读档速度就于慢.最多设置60个主角超过60个读档时间20分钟都没法进入游戏。
这算冲突吗,我把这段脚本拿掉后读档1秒直接进去了...把这些类似的脚本拿掉后会不会对脚本有影响..
范例.7z
(269.65 KB, 下载次数: 48)
这是工程文件..只是单用3个脚本而已,读档速度就明显能感觉出来了...加到正在制作的游戏工程里读档速度就变的更慢了..
装备扩张
- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
- #_/ ◆ 装備拡張 - KGC_EquipExtension ◆ VX ◆
- #_/ ◇ Last update : 2009/08/18 ◇
- #_/----------------------------------------------------------------------------
- #_/ 装備関連の機能を拡張します。
- #_/============================================================================
- #_/ 【メニュー】≪拡張装備画面≫ より下に導入してください。
- #_/ 【スキル】≪パッシブスキル≫ より上に導入してください。
- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
- #==============================================================================
- # ★ カスタマイズ項目 - Customize ★
- #==============================================================================
- module KGC
- module EquipExtension
- # ◆ 拡張装備種別
- # 先頭から順に 4, 5, 6, ... が割り当てられる。
- EXTRA_EQUIP_KIND = ["头部","饰品","指环","宿体","腿部"]
- #4 #5 #6 #7 #8
- # ◆ 装备的顺序
- # 以这里设置的顺序接续在武器的下面
- # ※ 装备个数最低为1,否则二刀流会出错
- # ** 装备种类一览 **
- # 0..盾 1..頭部 2..身体 3..装飾品 4~..↑所定義的种类
- EQUIP_TYPE = [0, 1, 2, 3, 4, 5, 6, 7, 8]
- # ◆ EP (装备点数) 制是否要使用
- USE_EP_SYSTEM = true #false
- # ◆ EP 的名称
- VOCAB_EP = "EP"
- # ◆ EP 的名称 (略)
- VOCAB_EP_A = ""
- # ◆ 是否在状态介面显示EP值
- SHOW_STATUS_EP = true#false
- # ◆ 装备预设 EP 消耗点数
- # 没有设定EP消耗点数的装备自动加上的点数
- DEFAULT_EP_COST = 5
- # ◆ 当消耗 EP 值为 0 时隐藏
- HIDE_ZERO_EP_COST = true
- # ◆ EP 上限
- EP_MAX = 60
- # ◆ EP 下限
- EP_MIN = 15
- # ◆ 最大 EP 公式
- # level..角色等级
- # 计算後小数自动取整
- EP_CALC_EXP = "level * 1.25 + 2"
- # ◆ アクター毎の最大 EP 算出式
- PERSONAL_EP_CALC_EXP = []
- # ここから下に、アクターごとの最大 EP を
- # PERSONAL_EP_CALC_EXP[アクター ID] = "計算式"
- # という書式で指定。
- # 計算式は EP_CALC_EXP と同様の書式。
- # 指定しなかったアクターは EP_CALC_EXP を使用。
- # <例> ラルフだけ優遇
- # PERSONAL_EP_CALC_EXP[1] = "level * 0.5 + 5"
- # ◆ 消耗 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
- # ◆ EP ゲージに汎用ゲージを使用する
- # ≪汎用ゲージ描画≫ 導入時のみ有効。
- ENABLE_GENERIC_GAUGE = true
- # ◆ EP ゲージ設定
- # 画像は "Graphics/System" から読み込む。
- GAUGE_IMAGE = "GaugeEP" # 画像
- GAUGE_OFFSET = [-23, -2] # 位置補正 [x, y]
- GAUGE_LENGTH = -4 # 長さ補正
- GAUGE_SLOPE = 30 # 傾き (-89 ~ 89)
- 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
- module 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
- #--------------------------------------------------------------------------
- # ○ アクターの MaxEP 補正値の取得
- # actor_id : アクター ID
- # variable_id : 取得した値を代入する変数の ID
- #--------------------------------------------------------------------------
- def get_actor_own_ep(actor_id, variable_id = 0)
- value = $game_actors[actor_id].maxep_plus
- $game_variables[variable_id] = value if variable_id > 0
- return value
- end
- #--------------------------------------------------------------------------
- # ○ アクターの MaxEP 補正値の変更
- # actor_id : アクター ID
- # value : MaxEP 補正値
- #--------------------------------------------------------------------------
- def set_actor_own_ep(actor_id, value)
- $game_actors[actor_id].maxep_plus = value
- end
- #--------------------------------------------------------------------------
- # ○ アクターの MaxEP 補正値の増加
- # actor_id : アクター ID
- # value : 増加量
- #--------------------------------------------------------------------------
- def gain_actor_ep(actor_id, value)
- $game_actors[actor_id].maxep_plus += value
- end
- #--------------------------------------------------------------------------
- # ○ アクターの装備を変更
- # actor_id : アクター ID
- # index : 装備部位 (0~)
- # item_id : 武器 or 防具 ID (0 で解除)
- # force_gain : 未所持なら取得 (true or false)
- #--------------------------------------------------------------------------
- def change_actor_equipment(actor_id, index, item_id, force_gain = false)
- actor = $game_actors[actor_id]
- return if actor == nil
- item = (index == 0 ? $data_weapons[item_id] : $data_armors[item_id])
- if actor.two_swords_style && index == 1
- item = $data_weapons[item_id]
- end
- if force_gain && $game_party.item_number(item) == 0
- $game_party.gain_item(item, 1)
- end
- actor.change_equip_by_id(index, item_id)
- end
- 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.each_line { |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.each_line { |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 # 装備タイプ
- attr_writer :maxep_plus # MaxEP 補正値
- #--------------------------------------------------------------------------
- # ● セットアップ
- # 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)
- @__last_equip_type = nil
- restore_equip
- end
- #--------------------------------------------------------------------------
- # ○ MaxEP 取得
- #--------------------------------------------------------------------------
- def maxep
- calc_exp = KGC::EquipExtension::PERSONAL_EP_CALC_EXP[self.id]
- if calc_exp == nil
- calc_exp = KGC::EquipExtension::EP_CALC_EXP
- end
- n = Integer(eval(calc_exp)) + maxep_plus
- 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
- #--------------------------------------------------------------------------
- # ○ MaxEP 補正値取得
- #--------------------------------------------------------------------------
- def maxep_plus
- @maxep_plus = 0 if @maxep_plus == nil
- return @maxep_plus
- 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)
- n = (item != nil ? $game_party.item_number(item) : 0)
- change_equip_KGC_EquipExtension(equip_type, item, test)
- # 拡張防具欄がある場合のみ
- if extra_armor_number > 0 && (item == nil || n > 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"]
- 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"]
- 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
- return if @__last_equip_type == equip_type
- # 以前の装備品・パラメータを退避
- 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
- @__last_equip_type = equip_type.clone
- 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)
- if KGC::EquipExtension::ENABLE_GENERIC_GAUGE && $imported["GenericGauge"]
- # 汎用ゲージ
- draw_gauge(KGC::EquipExtension::GAUGE_IMAGE,
- x, y, width, actor.ep, [actor.maxep, 1].max,
- KGC::EquipExtension::GAUGE_OFFSET,
- KGC::EquipExtension::GAUGE_LENGTH,
- KGC::EquipExtension::GAUGE_SLOPE)
- else
- # デフォルトゲージ
- 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
- 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, 0, 92, WLH, Vocab::weapon1)
- self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
- else
- self.contents.draw_text(4, 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 [url=mailto:1...@actor.armor_number]1...@actor.armor_number[/url]
- 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 + 160, 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
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Window_ShopStatus
- #==============================================================================
- class Window_ShopStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● アクターの現装備と能力値変化の描画
- # actor : アクター
- # x : 描画先 X 座標
- # y : 描画先 Y 座標
- #--------------------------------------------------------------------------
- def draw_actor_parameter_change(actor, x, y)
- return if @item.is_a?(RPG::Item)
- enabled = actor.equippable?(@item)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x, y, 200, WLH, actor.name)
- if @item.is_a?(RPG::Weapon)
- item1 = weaker_weapon(actor)
- elsif actor.two_swords_style and @item.kind == 0
- item1 = nil
- else
- index = actor.equip_type.index(@item.kind)
- item1 = (index != nil ? actor.equips[1 + index] : nil)
- end
- if enabled
- if @item.is_a?(RPG::Weapon)
- atk1 = item1 == nil ? 0 : item1.atk
- atk2 = @item == nil ? 0 : @item.atk
- change = atk2 - atk1
- else
- def1 = item1 == nil ? 0 : item1.def
- def2 = @item == nil ? 0 : @item.def
- change = def2 - def1
- end
- self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
- end
- draw_item_name(item1, x, y + WLH, enabled)
- 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_LimitBreak ◆ VX ◆
- #_/ ◇ Last update : 2008/01/09 ◇
- #_/----------------------------------------------------------------------------
- #_/ ゲーム中の各種上限値を変更します。
- #_/============================================================================
- #_/ 再定義が多いので、「素材」の最上部に導入してください。
- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
- #==============================================================================
- # ★ カスタマイズ項目 - Customize ★
- #==============================================================================
- module KGC
- module LimitBreak
- # ◆ 能力値算出方式
- # 0..データベース通り。
- # (100以降は計算式として PARAMETER_CALC_EXP を使用)
- #
- # 1..データベースを用いた2次関数。
- # a:レベル1の値 b:レベル2の値 c:レベル3の値 x:現レベル
- # として、
- # ax^2 + bx + c
- # を用いて能力値を算出。
- #
- # 2..データベースを用いた1次関数。
- # b:レベル2の値 c:レベル3の値 x:現レベル
- # として、
- # bx + c
- # を用いて能力値を算出。
- # (レベル 2 と 3 の値を使うのは、2次関数方式との使い分けを楽にするため)
- PARAMETER_CALC_METHOD = 0
- # ◆ レベル 100 以降の能力値計算式
- # PARAMETER_CALC_METHOD = 0 のときに使用します。
- # 【 level..現レベル param[x]..レベル x の能力値 】
- # この計算結果をレベル 99 の能力値に加算します。
- PARAMETER_CALC_EXP = "(param[99] - param[98]) * (level - 99)"
- # ◆ アクターのレベル上限
- ACTOR_FINAL_LEVEL = [1] # ← これは消さないこと!
- # ここから下に、アクターごとの最終レベルを
- # ACTOR_FINAL_LEVEL[アクターID] = 最終レベル
- # という形式で設定します。
- # <例> ↓ アクター 1 の最終レベル 999
- ACTOR_FINAL_LEVEL[1] = 70
- # ◆ アクターのレベル上限 (デフォルト)
- # 上限を指定しなかった場合は、この値を最終レベルとして使用します。
- ACTOR_FINAL_LEVEL_DEFAULT = 80
- # ◆ アクターの経験値上限
- ACTOR_EXP_LIMIT = 12000000
- # ◆ アクターの MaxHP 上限
- ACTOR_MAXHP_LIMIT = 98000
- # ◆ アクターの MaxMP 上限
- ACTOR_MAXMP_LIMIT = 98000
- # ◆ アクターの攻撃力、防御力、精神力、敏捷性上限
- ACTOR_PARAMETER_LIMIT = 9000
- # ◆ エネミーの MaxHP 上限
- ENEMY_MAXHP_LIMIT = 9999999
- # ◆ エネミーの MaxMP 上限
- ENEMY_MAXMP_LIMIT = 9999999
- # ◆ エネミーの攻撃力、防御力、精神力、敏捷性上限
- ENEMY_PARAMETER_LIMIT = 9999
- # ◆ エネミーの能力値補正
- # エネミーの各種能力値をデータベースの ○% にします。
- # データベース通りにする場合は 100 にしてください。
- ENEMY_MAXHP_RATE = 100 # MaxHP
- ENEMY_MAXMP_RATE = 100 # MaxMP
- ENEMY_ATK_RATE = 100 # 攻撃力
- ENEMY_DEF_RATE = 100 # 防御力
- ENEMY_SPI_RATE = 100 # 精神力
- ENEMY_AGI_RATE = 100 # 敏捷性
- # ◆ 所持金上限
- GOLD_LIMIT = 120000000
- # ◆ アイテム所持数上限
- ITEM_NUMBER_LIMIT = 999
- module_function
- #--------------------------------------------------------------------------
- # ○ 敵能力値直接指定
- # ここで、敵の MaxHP などを直接指定することができます。
- # データベースに入りきらない数値を指定する場合に使用してください。
- #--------------------------------------------------------------------------
- def set_enemy_parameters
- # <例> ID:10 の敵の MaxHP を 2000000 にする場合
- # $data_enemies[10].maxhp = 2000000
- # <例> ID:16 の敵の攻撃力を 5000 にする場合
- # $data_enemies[16].atk = 5000
- # <例> ID:20 の敵の防御力を2倍にする場合
- # $data_enemies[20].def *= 2
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- $imported = {} if $imported == nil
- $imported["LimitBreak"] = true
- module KGC::LimitBreak
- # 正規表現を定義
- module Regexp
- # ベースアイテム
- module BaseItem
- # 所持数上限
- NUMBER_LIMIT = /<(?:NUMBER_LIMIT|所持数上限)[ ]*(\d+)>/i
- end
- end
- module_function
- #--------------------------------------------------------------------------
- # ○ 敵の能力補正を適用
- #--------------------------------------------------------------------------
- def revise_enemy_parameters
- (1...$data_enemies.size).each { |i|
- enemy = $data_enemies[i]
- enemy.maxhp = enemy.maxhp * ENEMY_MAXHP_RATE / 100
- enemy.maxmp = enemy.maxmp * ENEMY_MAXMP_RATE / 100
- enemy.atk = enemy.atk * ENEMY_ATK_RATE / 100
- enemy.def = enemy.def * ENEMY_DEF_RATE / 100
- enemy.spi = enemy.spi * ENEMY_SPI_RATE / 100
- enemy.agi = enemy.agi * ENEMY_AGI_RATE / 100
- }
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ RPG::BaseItem
- #==============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # ○ 限界突破のキャッシュ生成
- #--------------------------------------------------------------------------
- def create_limit_break_cache
- @__number_limit = KGC::LimitBreak::ITEM_NUMBER_LIMIT
- self.note.split(/[\r\n]+/).each { |line|
- if line =~ KGC::LimitBreak::Regexp::BaseItem::NUMBER_LIMIT
- # 所持数上限
- @__number_limit = $1.to_i
- end
- }
- end
- #--------------------------------------------------------------------------
- # ○ 所持数上限取得
- #--------------------------------------------------------------------------
- def number_limit
- create_limit_break_cache if @__number_limit == nil
- return @__number_limit
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # ● MaxHP の制限値取得
- #--------------------------------------------------------------------------
- def maxhp_limit
- return KGC::LimitBreak::ENEMY_MAXHP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ MaxMP の制限値取得
- #--------------------------------------------------------------------------
- def maxmp_limit
- return KGC::LimitBreak::ENEMY_MAXMP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ● MaxMP の取得
- #--------------------------------------------------------------------------
- def maxmp
- return [[base_maxmp + @maxmp_plus, 0].max, maxmp_limit].min
- end
- #--------------------------------------------------------------------------
- # ○ 各種パラメータの制限値取得
- #--------------------------------------------------------------------------
- def parameter_limit
- return KGC::LimitBreak::ENEMY_PARAMETER_LIMIT
- end
- #--------------------------------------------------------------------------
- # ● 攻撃力の取得
- #--------------------------------------------------------------------------
- def atk
- n = [base_atk + @atk_plus, 1].max
- states.each { |state| n *= state.atk_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 防御力の取得
- #--------------------------------------------------------------------------
- def def
- n = [base_def + @def_plus, 1].max
- states.each { |state| n *= state.def_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 精神力の取得
- #--------------------------------------------------------------------------
- def spi
- n = [base_spi + @spi_plus, 1].max
- states.each { |state| n *= state.spi_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 敏捷性の取得
- #--------------------------------------------------------------------------
- def agi
- n = [base_agi + @agi_plus, 1].max
- states.each { |state| n *= state.agi_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● MaxHP の設定
- # new_maxhp : 新しい MaxHP
- #--------------------------------------------------------------------------
- def maxhp=(new_maxhp)
- @maxhp_plus += new_maxhp - self.maxhp
- @maxhp_plus = [[@maxhp_plus, -maxhp_limit].max, maxhp_limit].min
- @hp = [@hp, self.maxhp].min
- end
- #--------------------------------------------------------------------------
- # ● MaxMP の設定
- # new_maxmp : 新しい MaxMP
- #--------------------------------------------------------------------------
- def maxmp=(new_maxmp)
- @maxmp_plus += new_maxmp - self.maxmp
- @maxmp_plus = [[@maxmp_plus, -maxmp_limit].max, maxmp_limit].min
- @mp = [@mp, self.maxmp].min
- end
- #--------------------------------------------------------------------------
- # ● 攻撃力の設定
- # new_atk : 新しい攻撃力
- #--------------------------------------------------------------------------
- def atk=(new_atk)
- @atk_plus += new_atk - self.atk
- @atk_plus = [[@atk_plus, -parameter_limit].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 防御力の設定
- # new_def : 新しい防御力
- #--------------------------------------------------------------------------
- def def=(new_def)
- @def_plus += new_def - self.def
- @def_plus = [[@def_plus, -parameter_limit].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 精神力の設定
- # new_spi : 新しい精神力
- #--------------------------------------------------------------------------
- def spi=(new_spi)
- @spi_plus += new_spi - self.spi
- @spi_plus = [[@spi_plus, -parameter_limit].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 敏捷性の設定
- # agi : 新しい敏捷性
- #--------------------------------------------------------------------------
- def agi=(new_agi)
- @agi_plus += new_agi - self.agi
- @agi_plus = [[@agi_plus, -parameter_limit].max, parameter_limit].min
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 経験値計算
- #--------------------------------------------------------------------------
- def make_exp_list
- @exp_list = Array.new(final_level + 2)
- @exp_list[1] = @exp_list[final_level + 1] = 0
- m = actor.exp_basis
- n = 0.75 + actor.exp_inflation / 200.0
- (2..final_level).each { |i|
- @exp_list[i] = @exp_list[i-1] + Integer(m)
- m *= 1 + n
- n *= 0.9
- }
- end
- #--------------------------------------------------------------------------
- # ○ 最終レベルの取得
- #--------------------------------------------------------------------------
- def final_level
- n = KGC::LimitBreak::ACTOR_FINAL_LEVEL[self.id]
- return (n != nil ? n : KGC::LimitBreak::ACTOR_FINAL_LEVEL_DEFAULT)
- end
- #--------------------------------------------------------------------------
- # ● MaxHP の制限値取得
- #--------------------------------------------------------------------------
- def maxhp_limit
- return KGC::LimitBreak::ACTOR_MAXHP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ MaxMP の制限値取得
- #--------------------------------------------------------------------------
- def maxmp_limit
- return KGC::LimitBreak::ACTOR_MAXMP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ 各種パラメータの制限値取得
- #--------------------------------------------------------------------------
- def parameter_limit
- return KGC::LimitBreak::ACTOR_PARAMETER_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ 経験値の制限値取得
- #--------------------------------------------------------------------------
- def exp_limit
- return KGC::LimitBreak::ACTOR_EXP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ● 経験値の変更
- # exp : 新しい経験値
- # show : レベルアップ表示フラグ
- #--------------------------------------------------------------------------
- def change_exp(exp, show)
- last_level = @level
- last_skills = skills
- [url=home.php?mod=space&uid=13302]@exp[/url] = [[exp, exp_limit].min, 0].max
- while [url=home.php?mod=space&uid=13302]@exp[/url] >= @exp_list[@level+1] && @exp_list[@level+1] > 0
- level_up
- end
- while [url=home.php?mod=space&uid=13302]@exp[/url] < @exp_list[@level]
- level_down
- end
- @hp = [@hp, maxhp].min
- @mp = [@mp, maxmp].min
- if show && [url=home.php?mod=space&uid=22147]@level[/url] > last_level
- display_level_up(skills - last_skills)
- end
- end
- #--------------------------------------------------------------------------
- # ● レベルの変更
- # level : 新しいレベル
- # show : レベルアップ表示フラグ
- #--------------------------------------------------------------------------
- def change_level(level, show)
- level = [[level, final_level].min, 1].max
- change_exp(@exp_list[level], show)
- end
- #--------------------------------------------------------------------------
- # ○ 基本パラメータの取得
- #--------------------------------------------------------------------------
- def base_parameter(type)
- case KGC::LimitBreak::PARAMETER_CALC_METHOD
- when 0 # 数式定義
- if [url=home.php?mod=space&uid=22147]@level[/url] >= 100
- calc_text = KGC::LimitBreak::PARAMETER_CALC_EXP.dup
- calc_text.gsub!(/level/i) { "@level" }
- calc_text.gsub!(/param\[(\d+)\]/i) {
- "actor.parameters[type, #{$1.to_i}]"
- }
- return actor.parameters[type, 99] + eval(calc_text)
- end
- when 1 # 二次関数
- a = actor.parameters[type, 1]
- b = actor.parameters[type, 2]
- c = actor.parameters[type, 3]
- return ((a * [url=home.php?mod=space&uid=22147]@level[/url] + b) * @level + c)
- when 2 # 一次関数
- b = actor.parameters[type, 2]
- c = actor.parameters[type, 3]
- return (b * @level + c)
- end
- return actor.parameters[type, @level]
- end
- #--------------------------------------------------------------------------
- # ● 基本 MaxHP の取得
- #--------------------------------------------------------------------------
- def base_maxhp
- return base_parameter(0)
- end
- #--------------------------------------------------------------------------
- # ● 基本 MaxMP の取得
- #--------------------------------------------------------------------------
- def base_maxmp
- return base_parameter(1)
- end
- #--------------------------------------------------------------------------
- # ● 基本攻撃力の取得
- #--------------------------------------------------------------------------
- def base_atk
- n = base_parameter(2)
- equips.compact.each { |item| n += item.atk }
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本防御力の取得
- #--------------------------------------------------------------------------
- def base_def
- n = base_parameter(3)
- equips.compact.each { |item| n += item.def }
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本精神力の取得
- #--------------------------------------------------------------------------
- def base_spi
- n = base_parameter(4)
- equips.compact.each { |item| n += item.spi }
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本敏捷性の取得
- #--------------------------------------------------------------------------
- def base_agi
- n = base_parameter(5)
- equips.compact.each { |item| n += item.agi }
- return n
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Party
- #==============================================================================
- class Game_Party < Game_Unit
- #--------------------------------------------------------------------------
- # ○ 所持金の制限値取得
- #--------------------------------------------------------------------------
- def gold_limit
- return KGC::LimitBreak::GOLD_LIMIT
- end
- #--------------------------------------------------------------------------
- # ● ゴールドの増加 (減少)
- # n : 金額
- #--------------------------------------------------------------------------
- def gain_gold(n)
- [url=home.php?mod=space&uid=236945]@gold[/url] = [[@gold + n, 0].max, gold_limit].min
- end
- #--------------------------------------------------------------------------
- # ● アイテムの増加 (減少)
- # item : アイテム
- # n : 個数
- # include_equip : 装備品も含める
- #--------------------------------------------------------------------------
- def gain_item(item, n, include_equip = false)
- number = item_number(item)
- case item
- when RPG::Item
- @items[item.id] = [[number + n, 0].max, item.number_limit].min
- when RPG::Weapon
- @weapons[item.id] = [[number + n, 0].max, item.number_limit].min
- when RPG::Armor
- @armors[item.id] = [[number + n, 0].max, item.number_limit].min
- end
- n += number
- if include_equip && n < 0
- members.each { |actor|
- while n < 0 && actor.equips.include?(item)
- actor.discard_equip(item)
- n += 1
- end
- }
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Window_ShopBuy
- #==============================================================================
- class Window_ShopBuy < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 項目の描画
- # index : 項目番号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- number = $game_party.item_number(item)
- enabled = (item.price <= $game_party.gold && number < item.number_limit)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- draw_item_name(item, rect.x, rect.y, enabled)
- rect.width -= 4
- self.contents.draw_text(rect, item.price, 2)
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Title
- #==============================================================================
- class Scene_Title < Scene_Base
- #--------------------------------------------------------------------------
- # ● データベースのロード
- #--------------------------------------------------------------------------
- alias load_database_KGC_LimitBreak load_database
- def load_database
- load_database_KGC_LimitBreak
- set_enemy_parameters
- end
- #--------------------------------------------------------------------------
- # ● 戦闘テスト用データベースのロード
- #--------------------------------------------------------------------------
- alias load_bt_database_KGC_LimitBreak load_bt_database
- def load_bt_database
- load_bt_database_KGC_LimitBreak
- set_enemy_parameters
- end
- #--------------------------------------------------------------------------
- # ○ エネミーの能力値を設定
- #--------------------------------------------------------------------------
- def set_enemy_parameters
- KGC::LimitBreak.revise_enemy_parameters
- KGC::LimitBreak.set_enemy_parameters
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_File
- #==============================================================================
- class Scene_File < Scene_Base
- #--------------------------------------------------------------------------
- # ● セーブデータの読み込み
- # file : 読み込み用ファイルオブジェクト (オープン済み)
- #--------------------------------------------------------------------------
- alias read_save_data_KGC_LimitBreak read_save_data
- def read_save_data(file)
- read_save_data_KGC_LimitBreak(file)
- (1...$data_actors.size).each { |i|
- actor = $game_actors[i]
- actor.make_exp_list
- # レベル上限チェック
- if actor.level > actor.final_level
- while actor.level > actor.final_level
- actor.level_down
- end
- # 減少した HP などを反映させるためのおまじない
- actor.change_level(actor.final_level, false)
- end
- }
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Shop
- #==============================================================================
- class Scene_Shop < Scene_Base
- #--------------------------------------------------------------------------
- # ● 購入アイテム選択の更新
- #--------------------------------------------------------------------------
- def update_buy_selection
- @status_window.item = @buy_window.item
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command_window.active = true
- @dummy_window.visible = true
- @buy_window.active = false
- @buy_window.visible = false
- @status_window.visible = false
- @status_window.item = nil
- @help_window.set_text("")
- return
- end
- if Input.trigger?(Input::C)
- @item = @buy_window.item
- number = $game_party.item_number(@item)
- if @item == nil || @item.price > $game_party.gold ||
- number == @item.number_limit
- Sound.play_buzzer
- else
- Sound.play_decision
- max = (@item.price == 0 ?
- @item.number_limit : $game_party.gold / @item.price)
- max = [max, @item.number_limit - number].min
- @buy_window.active = false
- @buy_window.visible = false
- @number_window.set(@item, max, @item.price)
- @number_window.active = true
- @number_window.visible = true
- end
- end
- end
- end
复制代码 |
最佳答案
查看完整内容
这是无法避免的事情吧,装备扩张之后储存的装备就是整个装备类dump进存档,而不是保存编号,因为新诞生的装备并不存在于数据库里。
解决方法的话,限制背包大小吧。
|