#=========================================================================== # # ■武器熟練度v1.3.1 # # 設定項目が多いので、カスタマイズの説明をよく読んで使用してください # # v1.3の追加項目 # アクターごとのパラメータ成長曲線を変更可能になりました # カスタマイズ項目のST_CURVEの説明を読んでからご使用ください # # イベントスクリプト # ※イベント内の「スクリプト」に記述して使用してください # # ○change_weapon_level # アクターの熟練度レベルを指定値分増加させます # 使用方法 # change_weapon_level(アクターID, 属性ID, レベル上昇値, メッセージ表示フラグ) # 例) change_weapon_level(1, 2, 10, false) #   この場合、ラルフの斬撃熟練度が10増加します。 # falseなので、メッセージは表示されません。(表示する場合はtrue) # # ○test_st_curve # アクターごとのパラメータ成長曲線を表示することができます # 操作方法:R 次のアクターへ L 前のアクターへ # 右 次のパラメータタイプへ 左 前のパラメータタイプへ # #=========================================================================== module BBL_WEAPON #=========================================================================== # カスタマイズ開始 #=========================================================================== # 武器の属性IDです # 熟練度として機能させたい武器属性の分だけ属性IDを記入してください # [1, 2, 3]の場合は、属性ID1~3を持っている武器を装備した時に、熟練度が上昇します # ※ひとつの武器に複数の属性が設定されている場合は # 一番小さいID番号の属性しか熟練度はあがらないのでご注意ください WEAPON_ELEMENT = [1, 2, 3, 4, 5] # 属性の名前です # ※WEAPON_ELEMENTと同じ数と順序で指定してください WEAPON_ELEMENT_NAME = ["格闘", "斬撃", "刺突", "打撃", "弓"] # 属性のアイコンインデックスです # 番号はIcon_setの左上が0になります # ※WEAPON_ELEMENTと同じ数と順序で指定してください WEAPON_ICON = [11, 2, 4, 14, 16] # 熟練レベルが上昇した際、メッセージを表示させたくない場合はfalseにしてください WEAPON_LEVELUP_SHOW = true # バトル終了時、獲得したSPを表示させない場合は、falseにしてください GAIN_SP_SHOW = true # 熟練度ポイント獲得時のメッセージです SP_NAME = "SP" OBTAIN_SP = "%s の%sを獲得!" LEVELUP_MES = "%sの%s熟練度が%s %s に上がった!" # 熟練度レベル上昇と同時に各パラメータも上昇します # false にした場合、ステータスは変化しません STATUS_UP = true # パラメータ上昇時のメッセージを表示しないならfalseにしてください STATUS_UP_SHOW = true # パラメータ上昇時のメッセージ内容です STATUS_UP_MES = "%sが%s上がった!" STATUS_NAME = ["HP", "MP", "ATK", "DEF", "SPI", "AGI"] #------------------------------------------------------------------------- # パラメータの上昇が有効な場合、各パラメータの上昇値を設定してください # 括弧内のカテゴリーは、各属性に該当し # 数値は、熟練度がMAXになった時の値です # ※WEAPON_ELEMENTと同じ数と順序で指定してください # ATK_UP = [180, 150, 160, 140, 130]の場合 # 斬撃熟練度がMAXになった時、ATKが150加算された状態になります #------------------------------------------------------------------------- HP_UP = [1000, 1000, 1000, 1000, 1000] MP_UP = [500, 500, 500, 500, 500] ATK_UP = [180, 150, 160, 140, 130] DEF_UP = [130, 150, 210, 160, 150] SPI_UP = [120, 150, 120, 210, 150] AGI_UP = [100, 80, 50, 70, 75] #------------------------------------------------------------------------- # アクターごとにパラメータの上昇曲線を設定できます # 曲線の許容範囲は0を基準とし、-10~10までで # 正の値が大きいほど晩成型、負の値が大きいほど早熟型となります # アクターひとりに対し、各パラメータ分細かく成長タイプの設定が可能です # # ST_CURVE[アクターID] = [HP成長タイプ, MP成長タイプ, ATKの成長タイプ....] # 例)ST_CURVE[1] = [0, 0, -8, 0, 10, -8] #  例の場合、攻撃力と敏捷性が早熟型で、精神力は晩成型となります # # また、イベントスクリプトにtest_st_curveと入力して # イベントを起動させれば、各アクターの成長曲線をグラフで見ることができます #------------------------------------------------------------------------- ST_CURVE = [] # ←この行は削除・編集しないこと ST_CURVE[1] = [0, 0, 0, 0, 0, 0] # 上記ST_CURVEに設定されていないアクターの成長タイプは # すべて下記のDEFAULT_ST_CURVEの値が適応されます DEFAULT_ST_CURVE = 5 #------------------------------------------------------------------------- # 熟練度があがった時、同時にスキルも習得させる場合は編集してください # LEARN_SKILL[属性ID] = [[熟練度LV, スキルID]] # LEARN_SKILL[1] = [[5, 1]]の場合、属性ID1番の武器熟練度が5になった時 # スキルID 1番のスキルを習得します #------------------------------------------------------------------------- LEARN_SKILL = [] # ←この行は削除・編集しないこと # LEARN_SKILL[2] = [[1, 1],[1, 2],[15, 3]] #------------------------------------------------------------------------- # ステータス、装備画面を表示する際の # 熟練度表示の有無を設定します # 各ウィンドウをカスタマイズ、または他のスクリプトを導入している場合はfalseにし # 各自で導入した方がよいです # ※熟練度表示メソッド(draw_weapon_level)を使用してください #------------------------------------------------------------------------- # ステータス画面に熟練度を表示させない場合はfalseにしてください WEAPON_SKILL_STATUS = true # 装備画面に熟練度を表示させない場合はfalseにしてください # ※trueにした場合、EquipItemウィンドウの列数が1列になり #  EquipStatusウィンドウの縦幅が変わります WEAPON_SKILL_EQUIP = true #------------------------------------------------------------------------- # 熟練度表示する場合の、各ウィンドウ配置です # カテゴリー内は、左から[ステータス画面, 装備画面]の数値になります #------------------------------------------------------------------------- STATUS_WINDOW_X = [24, 16] # X座標 STATUS_WINDOW_Y = [320, 144] # Y座標 COLUMN_MAX = [3, 1] # 列数 LINE_MAX = [2, 8] # 行数 CONTENTS_WIDTH = [128, 64] # 属性ひとつ分の横幅 CONTENTS_HEIGHT = [24, 24] # 1行分の縦幅 #------------------------------------------------------------------------- # ショップ画面のステータスウィンドウをカスタマイズします #------------------------------------------------------------------------- # カスタマイズしないで、通常のショップステータス画面にする場合は # falseにしてください CUSTOM_SHOP_STATUS = true # ショップステータス画面に表示するパラメータ用語です # 左から攻撃力、防御力、精神力、敏捷性になります SHOP_STATUS_PARAM = ["ATK", "DEF", "SPI", "DEF"] # ショップステータス画面でのアクターひとり分の縦幅です SHOP_STATUS_ACTOR_HEIGHT = 32 #------------------------------------------------------------------------- # バトル勝利時に獲得するデフォルトのSP量です # SPが熟練度経験値テーブルで作成された値に達すると熟練度が上昇します # 各敵キャラにこれ以外のSPを設定させたい場合は # 敵キャラのメモ欄に "WSP(または"ウェポン")所持SP" と記入してください # 例) WSP20  ウェポン10 #------------------------------------------------------------------------- DEFAULT_SP = 2 # 熟練度のMAXレベルです LIMIT_LEVEL = 99 # 熟練度用のEXPテーブル作成用数値です # 基本的にアクターのEXPテーブルと作り方は同じです EXP_BASE = 30 # 基本値 EXP_INFLATION = 2.5 # 増加度 # trueにすると、ニューゲームを選択した際 # 作成された熟練度用のEXPテーブルが表示されます # テスト用に使用してください SHOW_EXP_LIST = false # 下の数値が1より大きいの場合、ひとりのキャラが途中で # 他の武器属性に切り替えた時、現在装備している武器の熟練度が # 他の熟練度よりも低い場合に限り、SPがSP_BONUS倍になります。 # ※これは私が製作中のゲームの仕様なのですが # プレイヤーがいろんな武器を使って楽しめるようにするための # 救済処置みたいなものです。 # 例)斬撃LV10の時、LV10以下の武器属性に切り替えるとLV10まではSP_BONUS倍の速度で成長 SP_BONUS = 1.5 #------------------------------------------------------------------------- # アクターの初期熟練度レベルです # DEFAULT_LEVEL[アクターID] = [属性1, 属性2...] # DEFAULT_LEVEL[1] = [0, 5, 0, 0, 0]の場合 # ラルフの斬撃レベルが5の状態でスタートします #------------------------------------------------------------------------- DEFAULT_LEVEL = [] #←これは編集&削除しない事 DEFAULT_LEVEL[1] = [0, 0, 0, 0, 0] DEFAULT_LEVEL[2] = [0, 0, 0, 0, 0] DEFAULT_LEVEL[3] = [0, 0, 0, 0, 0] DEFAULT_LEVEL[4] = [0, 0, 0, 0, 0] DEFAULT_LEVEL[5] = [0, 0, 0, 0, 0] DEFAULT_LEVEL[6] = [0, 0, 0, 0, 0] DEFAULT_LEVEL[7] = [0, 0, 0, 0, 0] #------------------------------------------------------------------------- # 裏パラメータ補正 # 敵への攻撃時のみ、熟練レベルに応じて裏パラメータを適応することができます # ※装備画面等の数値表示は変動しません # # CORRECT_PARAM[武器属性ID] = [攻撃力の倍率, 精神力の倍率] # 装備中の熟練レベルx攻撃力の倍率(または精神力の倍率)の値が # 基本攻撃力(または精神力)に加算されます # 例)CORRECT_PARAM[2] = [1.5, 0] # 属性ID2番(デフォルトでは斬撃)の熟練レベルx1.5の値が攻撃力に加算 # 熟練レベルが10だったら、この場合、攻撃力が+15されます #------------------------------------------------------------------------- # 裏パラメータを適応させない場合はfalseにしてください # ※使用する場合、GameBattlerクラスに追加定義を行うので # この機能が必要なければfalseにしておいたほうが無難です(競合回避) CORRECT_PARAM_ON = false # CORRECT_PARAM_ONをtrueにした場合は # WEAPON_ELEMENTに指定してある属性IDの分だけ作成する事 CORRECT_PARAM = [] #←これは編集&削除しない事 CORRECT_PARAM[1] = [1.5, 0.0] CORRECT_PARAM[2] = [1.5, 0.0] CORRECT_PARAM[3] = [1.5, 0.0] CORRECT_PARAM[4] = [1.5, 1.5] CORRECT_PARAM[5] = [1.5, 1.5] # テストプレイでバトル中に、どの程度パラメータが上昇しているのか # 見たい場合のみtrueにしてください VIEW_CORRECT_PARAM = false # KGCさんの多人数パーティを導入している場合の # 待機メンバーがSPを獲得する割合です STAND_BY_SP_RATE = 500 #=========================================================================== # カスタマイズ終了 #=========================================================================== end $imported_bbl = {} if $imported_bbl == nil #============================================================================== # ■ Game_Actor #============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ● エネミーの所持SP取得 #-------------------------------------------------------------------------- def weapon_sp result = enemy.note.scan(/(WSP|ウェポン)(\d+)/) return BBL_WEAPON::DEFAULT_SP if result.empty? result = result[0][1].to_i return result end end #============================================================================== # ■ Game_Troop #============================================================================== class Game_Troop < Game_Unit #-------------------------------------------------------------------------- # ● SPの合計計算 #-------------------------------------------------------------------------- def sp_total sp = 0 rate = 100 if $imported_bbl["ResultWindow"] if BBL::NO_DAMAGE_BONUS if $game_temp.damage_flug == false rate += BBL::SP_BONUS_RATE - 100 end end if BBL::TURN_BONUS if $game_temp.turn_bonus rate += BBL::SP_BONUS_RATE - 100 end end end for enemy in dead_members sp += ((enemy.weapon_sp * rate) / 100).round unless enemy.hidden end return sp end end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● 熟練度変更 # actor_id = アクターID # element = 武器属性ID # level = 熟練度レベルの上昇値 # show = trueで、熟練度UPメッセージを表示 #-------------------------------------------------------------------------- def change_weapon_level(actor_id, element, level, show = false) actor = $game_actors[actor_id] actor.change_weapon_level(element, level, show) end end #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler attr_accessor :weapon_exp # 熟練度経験値 attr_accessor :weapon_level # 熟練度レベル attr_accessor :weapon_lv_limit # レベル最大値 attr_accessor :weapon_levelup_flug # レベルアップフラグ attr_accessor :weapon_exp_list # 熟練度経験値テーブル attr_accessor :last_weapon_level # レベル変化前 attr_accessor :weapon_mhp # attr_accessor :weapon_mmp # attr_accessor :weapon_atk # パラメータ上昇値 attr_accessor :weapon_def # attr_accessor :weapon_spi # attr_accessor :weapon_agi # attr_accessor :total_mhp # attr_accessor :total_mmp # attr_accessor :total_atk # パラメータ上昇値(トータル) attr_accessor :total_def # attr_accessor :total_spi # attr_accessor :total_agi # attr_accessor :test_mhp # attr_accessor :test_mmp # attr_accessor :test_atk # パラメータ上昇曲線(テスト用) attr_accessor :test_def # attr_accessor :test_spi # attr_accessor :test_agi # alias setup_BBL setup def setup(actor_id) setup_BBL(actor_id) @weapon_exp = [] @weapon_level = [] @last_weapon_level = [] @weapon_lv_limit = [] @weapon_levelup_flug = false @weapon_exp_list = [] @total_mhp = 0 @total_mmp = 0 @total_atk = 0 @total_def = 0 @total_spi = 0 @total_agi = 0 @test_mhp = [] @test_mmp = [] @test_atk = [] @test_def = [] @test_spi = [] @test_agi = [] make_weapon_exp_list for i in 0..BBL_WEAPON::WEAPON_ELEMENT.max if BBL_WEAPON::WEAPON_ELEMENT.include?(i) # アクターごとの初期LV設定 default_level = default_weapon_level(i) @weapon_level[i] = default_level if default_level != nil @weapon_level[i] = 0 if default_level == nil # EXP計算 list = @weapon_exp_list @weapon_exp[i] = list[@weapon_level[i]] end end # 初期ステータス設定 default_weapon_status end #-------------------------------------------------------------------------- # ● アクターの初期武器レベル設定 #-------------------------------------------------------------------------- def default_weapon_level(element_id) weapon_list = BBL_WEAPON::WEAPON_ELEMENT default_list = BBL_WEAPON::DEFAULT_LEVEL[@actor_id] return if default_list == nil index = 0 for i in weapon_list return default_list[index] if element_id == i index += 1 end end #-------------------------------------------------------------------------- # ● アクターの初期設定(ステータス、スキル増加) #-------------------------------------------------------------------------- def default_weapon_status status_up_reset actor = $data_actors[@actor_id] default_list = BBL_WEAPON::DEFAULT_LEVEL[@actor_id] return if default_list == nil index = 0 for weapon_level in default_list if weapon_level > 0 for i in 1..weapon_level # ステータス上昇 status_up(actor, index, i) # スキル習得 element = BBL_WEAPON::WEAPON_ELEMENT[index] skills = BBL_WEAPON::LEARN_SKILL[element] if skills != nil for skill_learn in skills learn_skill(skill_learn[1]) if skill_learn[0] <= i end end end end index += 1 end end #-------------------------------------------------------------------------- # ● 熟練LV変更 # ( element_id = 属性ID level = LV上昇値)  #-------------------------------------------------------------------------- def change_weapon_level(element_id, level, show = false) old_level = @weapon_level[element_id] @weapon_level[element_id] += level @weapon_level[element_id] = BBL_WEAPON::LIMIT_LEVEL if @weapon_level[element_id] > BBL_WEAPON::LIMIT_LEVEL new_level = @weapon_level[element_id] actor = $game_actors[@actor_id] index = 0 for i in BBL_WEAPON::WEAPON_ELEMENT break if i == element_id index += 1 end for level in old_level + 1..new_level # ステータス上昇 status_up(actor, index, level) # スキル習得 element = BBL_WEAPON::WEAPON_ELEMENT[index] skills = BBL_WEAPON::LEARN_SKILL[element] unless show if skills != nil for skill_learn in skills learn_skill(skill_learn[1]) if skill_learn[0] <= level end end end end @weapon_exp[element_id] = @weapon_exp_list[@weapon_level[element_id]] if show index = actor.weapon_element_index(actor) display_weapon_level_up(actor, index, element) end end #-------------------------------------------------------------------------- # ● 熟練度必要EXPリスト作成 #-------------------------------------------------------------------------- def make_weapon_exp_list list = [] list[0] = 0 m = BBL_WEAPON::EXP_BASE n = BBL_WEAPON::EXP_INFLATION / 100.0 for i in 1..BBL_WEAPON::LIMIT_LEVEL list[i] = list[i-1] + Integer(m) m *= 1 + n n *= 0.98 end @weapon_exp_list = list p @weapon_exp_list if BBL_WEAPON::SHOW_EXP_LIST end #-------------------------------------------------------------------------- # ● 装備中の武器属性取得 #-------------------------------------------------------------------------- def using_weapon(actor) use_element = nil element = actor.element_set for element_id in element if BBL_WEAPON::WEAPON_ELEMENT.include?(element_id) use_element = element_id end end return false if use_element == nil # 武器を装備していなかったらfalseを返す return use_element # 武器の属性IDを返す end #-------------------------------------------------------------------------- # ● 使用中武器のインデックス取得 #-------------------------------------------------------------------------- def weapon_element_index(actor) index = 0 for element_id in BBL_WEAPON::WEAPON_ELEMENT break if element_id == actor.using_weapon(actor) index += 1 end return index end #-------------------------------------------------------------------------- # ● 現在の武器EXP取得(パーセンテージ) #-------------------------------------------------------------------------- def weapon_level_exp(element) list = @weapon_exp_list level = @weapon_level[element] return 100 if list[level + 1] == nil next_exp = (list[level + 1] - list[level]) * 1.0 exp = (@weapon_exp[element] - list[level]) * 1.0 n = (exp / next_exp * 100).truncate return n end #-------------------------------------------------------------------------- # ● 習得武器の最大レベルから使用中武器熟練度の差を取得 # (最大値よりも少なければtrueを返す) #-------------------------------------------------------------------------- def weapon_difference(actor) max_weapon = @weapon_level.max element = actor.using_weapon(actor) using_weapon = @weapon_level[element] return true if using_weapon < max_weapon return false end #-------------------------------------------------------------------------- # ● 熟練度レベルアップ #-------------------------------------------------------------------------- def element_levelup(actor, element, sp) # 死亡してるアクターはSP0 sp = 0 if actor.dead? # レベル上限を超えてない if @weapon_level[element] < BBL_WEAPON::LIMIT_LEVEL # 装備中の武器レベルが最大武器レベルよりも低ければSP量UP sp = sp * BBL_WEAPON::SP_BONUS if weapon_difference(actor) # SP加算 @weapon_exp[element] += sp list = @weapon_exp_list next_exp = list[@weapon_level[element] + 1] status_up_reset # ステータス上昇値初期化 # 現在のLVを記憶 @last_weapon_level[element] = @weapon_level[element] # レベル上昇判定 loop do next_exp = list[@weapon_level[element] + 1] if @weapon_exp[element] >= next_exp # レベル上昇 @weapon_level[element] += 1 @weapon_levelup_flug = true index = actor.weapon_element_index(actor) actor.status_up(actor, index, @weapon_level[element]) break if @weapon_level[element] == BBL_WEAPON::LIMIT_LEVEL else break end end unless $imported_bbl["ResultWindow"] if @weapon_levelup_flug == true && @last_weapon_level[element] != @weapon_level[element] index = actor.weapon_element_index(actor) display_weapon_level_up(actor, index, element) if BBL_WEAPON::WEAPON_LEVELUP_SHOW end end end end #-------------------------------------------------------------------------- # ● ステータスアップ #-------------------------------------------------------------------------- def status_up(actor, index, level) # カスタマイズ項目のデータからMAX上昇値を取得 mhp_data = BBL_WEAPON::HP_UP mmp_data = BBL_WEAPON::MP_UP atk_data = BBL_WEAPON::ATK_UP def_data = BBL_WEAPON::DEF_UP spi_data = BBL_WEAPON::SPI_UP agi_data = BBL_WEAPON::AGI_UP type_list = BBL_WEAPON::ST_CURVE[actor.id] type_list = [5, 5, 5, 5, 5, 5] if type_list == nil # 現在の熟練レベルから曲線タイプを経由し、合計上昇値を取得 @total_mhp = st_curve(type_list[0], level, mhp_data[index]) @total_mmp = st_curve(type_list[1], level, mmp_data[index]) @total_atk = st_curve(type_list[2], level, atk_data[index]) @total_def = st_curve(type_list[3], level, def_data[index]) @total_spi = st_curve(type_list[4], level, spi_data[index]) @total_agi = st_curve(type_list[5], level, agi_data[index]) # 今回のバトルで上昇した差分値を取得(リザルトに表示させるため) @weapon_mhp += @total_mhp - @weapon_mhp @weapon_mmp += @total_mmp - @weapon_mmp @weapon_atk += @total_atk - @weapon_atk @weapon_def += @total_def - @weapon_def @weapon_spi += @total_spi - @weapon_spi @weapon_agi += @total_agi - @weapon_agi # テスト用パラメータ上昇値配列 @test_mhp.push(@total_mhp) @test_mmp.push(@total_mmp) @test_atk.push(@total_atk) @test_def.push(@total_def) @test_spi.push(@total_spi) @test_agi.push(@total_agi) end #-------------------------------------------------------------------------- # ● ステータス上昇値初期化 #-------------------------------------------------------------------------- def status_up_reset @weapon_mhp = 0; @weapon_mmp = 0; @weapon_atk = 0; @weapon_def = 0; @weapon_spi = 0; @weapon_agi = 0 end #-------------------------------------------------------------------------- # ● ステータス曲線生成 #-------------------------------------------------------------------------- def st_curve(type, level, max_param) l = max_param * 1.0 n = type * 1.0 x = level * 1.0 a = 0 limit_l = BBL_WEAPON::LIMIT_LEVEL * 1.0 sl = (limit_l - 1) * 0.98 * 1000 result = (((l * n) * (x - 1) * (x - 1)) / sl + l * (1 - n / 10.0) * (x - 1) / (limit_l - 1)).truncate return result end #-------------------------------------------------------------------------- # ● スキル習得 #-------------------------------------------------------------------------- def weapon_learn_skill(actor, element, level) learn_skills = [] skill_name = [] skill_data = BBL_WEAPON::LEARN_SKILL[element] return if skill_data == nil for skills in skill_data unless actor.skill_learn?($data_skills[skills[1]]) learn_skills.push(skills[1]) if skills[0] <= level end end return if learn_skills == [] for skill_id in learn_skills $game_message.new_page unless $imported_bbl["ResultWindow"] actor.learn_skill(skill_id) skill = $data_skills[skill_id] skill_name.push(skill.name) text = sprintf(Vocab::ObtainSkill, skill.name) $game_message.texts.push(text) unless $imported_bbl["ResultWindow"] end return skill_name end #-------------------------------------------------------------------------- # ● 熟練度レベルアップメッセージの表示 # new_skills : 新しく習得したスキルの配列 #-------------------------------------------------------------------------- def display_weapon_level_up(actor, index, element_id) $game_message.new_page element_name = BBL_WEAPON::WEAPON_ELEMENT_NAME[index] text = sprintf(BBL_WEAPON::LEVELUP_MES, @name, element_name, Vocab::level, @weapon_level[element_id]) $game_message.texts.push(text) actor.weapon_learn_skill(actor, element_id, @weapon_level[element_id]) name_index = 0 $game_message.new_page for param in [@weapon_mhp, @weapon_mmp, @weapon_atk, @weapon_def, @weapon_spi, @weapon_agi] if param > 0 && BBL_WEAPON::STATUS_UP_SHOW text = sprintf(BBL_WEAPON::STATUS_UP_MES, BBL_WEAPON::STATUS_NAME[name_index], param) $game_message.texts.push(text) end name_index += 1 end end #-------------------------------------------------------------------------- # ● 基本MHPの取得 #-------------------------------------------------------------------------- alias base_maxhp_BBL_WEAPON base_maxhp def base_maxhp if @total_mhp != nil return base_maxhp_BBL_WEAPON + @total_mhp else return base_maxhp_BBL_WEAPON end end #-------------------------------------------------------------------------- # ● 基本MMPの取得 #-------------------------------------------------------------------------- alias base_maxmp_BBL_WEAPON base_maxmp def base_maxmp if @total_mmp != nil return base_maxmp_BBL_WEAPON + @total_mmp else return base_maxmp_BBL_WEAPON end end #-------------------------------------------------------------------------- # ● 基本攻撃力の取得 #-------------------------------------------------------------------------- alias base_atk_BBL_WEAPON base_atk def base_atk n = base_atk_BBL_WEAPON + @total_atk.truncate return n end #-------------------------------------------------------------------------- # ● 基本防御力の取得 #-------------------------------------------------------------------------- alias base_def_BBL_WEAPON base_def def base_def n = base_def_BBL_WEAPON + @total_def.truncate return n end #-------------------------------------------------------------------------- # ● 基本精神力の取得 #-------------------------------------------------------------------------- alias base_spi_BBL_WEAPON base_spi def base_spi n = base_spi_BBL_WEAPON + @total_spi.truncate return n end #-------------------------------------------------------------------------- # ● 基本敏捷性の取得 #-------------------------------------------------------------------------- alias base_agi_BBL_WEAPON base_agi def base_agi n = base_agi_BBL_WEAPON + @total_agi.truncate return n end #-------------------------------------------------------------------------- # ● 武器装備時パラメータ補正 # 装備中の武器属性とその熟練レベルから # 攻撃力と精神力の加算値を取得 #-------------------------------------------------------------------------- def correct_parameter actor = $game_actors[@actor_id] element_id = using_weapon(actor) weapon_level = @weapon_level[element_id] value = BBL_WEAPON::CORRECT_PARAM[element_id] result = [] for i in value n = (weapon_level * i).round result.push(n) end return result end end if BBL_WEAPON::CORRECT_PARAM_ON #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● 攻撃力の設定 #-------------------------------------------------------------------------- alias atk_bbl atk def atk if $game_temp.in_battle unless actor? n = atk_bbl else n = atk_bbl + correct_parameter[0] end else n = atk_bbl if BBL_WEAPON::VIEW_CORRECT_PARAM p actor.name, "元の攻撃力", atk_bbl, "加算値", correct_parameter[0], "合計", atk_bbl + correct_parameter[0] end end return n end #-------------------------------------------------------------------------- # ● 精神力の設定 #-------------------------------------------------------------------------- alias spi_bbl spi def spi if $game_temp.in_battle unless actor? n = spi_bbl else n = spi_bbl + correct_parameter[1] end else n = spi_bbl if BBL_WEAPON::VIEW_CORRECT_PARAM p actor.name, "元の精神力", spi_bbl, "加算値", correct_parameter[1], "合計", atk_bbl + correct_parameter[1] end end return n end end end class Window_Base #-------------------------------------------------------------------------- # ● 熟練度レベルの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # type : 0:ステータス画面 1:装備画面 #-------------------------------------------------------------------------- def draw_weapon_level(actor, type = 0) index = 0 data = BBL_WEAPON::WEAPON_ELEMENT icon_data = BBL_WEAPON::WEAPON_ICON column_max = BBL_WEAPON::COLUMN_MAX[type] line_max = BBL_WEAPON::LINE_MAX[type] x = BBL_WEAPON::STATUS_WINDOW_X[type] y = BBL_WEAPON::STATUS_WINDOW_Y[type] width = BBL_WEAPON::CONTENTS_WIDTH[type] height = BBL_WEAPON::CONTENTS_HEIGHT[type] for element_id in data si = (index / column_max).truncate sx = width * (index - (si * column_max)) text = actor.weapon_level[element_id] divi = actor.weapon_level_exp(element_id) text_divi = sprintf("(%1d%)", divi) text_divi = sprintf("(MAX)") if text == BBL_WEAPON::LIMIT_LEVEL self.contents.draw_text(x + sx + 64, y + (height * si), width, WLH, text_divi) self.contents.draw_text(x + sx + 24, y + (height * si), width, WLH, sprintf(" %1d", text)) draw_icon(icon_data[index], x + sx, y + (height * si)) index += 1 end end #-------------------------------------------------------------------------- # ● 熟練度レベルの描画(装備中の武器のみ) # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # type : 0:ステータス画面 1:装備画面 2:熟練度画面 #-------------------------------------------------------------------------- def draw_using_weapon_level(actor, x, y) data = BBL_WEAPON::WEAPON_ELEMENT icon_data = BBL_WEAPON::WEAPON_ICON element_id = actor.using_weapon(actor) index = actor.weapon_element_index(actor) text = actor.weapon_level[element_id] self.contents.draw_text(x + 32, y, 64, WLH, sprintf("L%1d", text)) draw_icon(icon_data[index], x, y - 4) end #-------------------------------------------------------------------------- # ● 熟練度レベルの描画(装備中の武器のみ) # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # type : 0:ステータス画面 1:装備画面 2:熟練度画面 #-------------------------------------------------------------------------- def draw_using_weapon_icon(actor, x, y) data = BBL_WEAPON::WEAPON_ELEMENT icon_data = BBL_WEAPON::WEAPON_ICON element_id = actor.using_weapon(actor) index = actor.weapon_element_index(actor) draw_icon(icon_data[index], x, y - 4) end end if BBL_WEAPON::WEAPON_SKILL_STATUS #============================================================================== # ■ Window_Status #============================================================================== class Window_Status < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ(追加定義) #-------------------------------------------------------------------------- alias refresh_BBL refresh def refresh # 追加定義 refresh_BBL draw_weapon_level(@actor, 0) end end end if BBL_WEAPON::WEAPON_SKILL_EQUIP #============================================================================== # ■ Window_EquipItem #============================================================================== class Window_EquipItem < Window_Item #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_BBL initialize def initialize(x, y, width, height, actor, equip_type) initialize_BBL(x, y, width, height, actor, equip_type) @column_max = 1 refresh end end #============================================================================== # ■ Window_EquipStatus #============================================================================== class Window_EquipStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化(再定義) #-------------------------------------------------------------------------- def initialize(x, y, actor) # 再定義 super(x, y, 208, 416 - 56) @actor = actor refresh end #-------------------------------------------------------------------------- # ● リフレッシュ(追加定義) #-------------------------------------------------------------------------- alias refresh_BBL refresh def refresh # 追加定義 refresh_BBL self.contents.font.color = normal_color draw_weapon_level(@actor, 1) end end #============================================================================== # ■ Scene_Equip #============================================================================== class Scene_Equip < Scene_Base #-------------------------------------------------------------------------- # ● アイテムウィンドウの作成(再定義) #-------------------------------------------------------------------------- def create_item_windows # 再定義 @item_windows = [] for i in 0...EQUIP_TYPE_MAX @item_windows[i] = Window_EquipItem.new(208, 208, 544 - 208, 208, @actor, i) @item_windows[i].help_window = @help_window @item_windows[i].visible = (@equip_index == i) @item_windows[i].y = 208 @item_windows[i].height = 208 @item_windows[i].active = false @item_windows[i].index = -1 end end end end if BBL_WEAPON::CUSTOM_SHOP_STATUS class Window_ShopStatus #-------------------------------------------------------------------------- # ○ リフレッシュ (再定義) #-------------------------------------------------------------------------- def refresh self.contents.clear if @item != nil number = $game_party.item_number(@item) self.contents.font.color = system_color text = Vocab::Possession self.contents.font.size = 18 self.contents.draw_text(4, 0, 200, WLH, text) self.contents.font.size = 16 name = BBL_WEAPON::SHOP_STATUS_PARAM if @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor) for i in 0...name.size x = (width - 80) / 4 * i + 4 self.contents.draw_text(x + 54, y - 88, 192, WLH, name[i]) end end self.contents.font.color = normal_color sy = 24 for actor in $game_party.members x = 4 y = sy + BBL_WEAPON::SHOP_STATUS_ACTOR_HEIGHT * actor.index draw_actor_parameter_change(actor, x, y + 24) end self.contents.font.size = 18 self.contents.font.color = normal_color text_width = contents.text_size(text).width self.contents.draw_text(text_width + 24, 0, 200, WLH, number) end end #-------------------------------------------------------------------------- # ○ アクターの現装備と能力値変化の描画 (再定義) # 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 if @item.is_a?(RPG::Weapon) item1 = weaker_weapon(actor) elsif actor.two_swords_style and @item.kind == 0 item1 = nil else item1 = actor.equips[1 + @item.kind] end equiped = (actor.weapons.include?(@item) or actor.armors.include?(@item)) icon = equiped ? 1 : 0 draw_actor_graphic(actor, x + 10, y + 28) draw_using_weapon_icon(actor, x + 26, y) self.contents.fill_rect(0, y + 22, self.width, 1, text_color(4)) if equiped self.contents.font.color = text_color(21) self.contents.draw_text(x + 32, y, self.width - 64, 24, "装備してます", 1) end if not enabled self.contents.font.color = text_color(25) self.contents.draw_text(x + 32, y, self.width - 64, 24, "装備できません", 1) end if enabled and not equiped for i in 0..3 x = (width - 80) / 4 * i + 4 draw_parameter(actor, x + 44, y, i) end end end #-------------------------------------------------------------------------- # ☆ 能力値変化の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # type : 能力値の種類 (0~3) #-------------------------------------------------------------------------- def draw_parameter(actor, x, y, type) temp_actor = actor.clone equip_type = @item.is_a?(RPG::Weapon) ? 0 : @item.kind + 1 temp_actor.change_equip(equip_type, @item, true) case type when 0 name = "ATK" old_value = actor.atk new_value = temp_actor.atk when 1 name = "DEF" old_value = actor.def new_value = temp_actor.def when 2 name = "SPI" old_value = actor.spi new_value = temp_actor.spi when 3 name = "AGI" old_value = actor.agi new_value = temp_actor.agi end self.contents.font.color = normal_color if new_value > old_value # 強くなる self.contents.font.color = power_up_color elsif new_value == old_value # 変わらず self.contents.font.color = normal_color self.contents.font.color.alpha = 128 else # 弱くなる self.contents.font.color = power_down_color end change = new_value - old_value change = change == 0 ? "…" : sprintf("%+d", change) self.contents.draw_text(x, y, 48, WLH, change, 1) end #-------------------------------------------------------------------------- # ○ 歩行グラフィックの描画 (再定義) # character_name : 歩行グラフィック ファイル名 # character_index : 歩行グラフィック インデックス # x : 描画先 X 座標 # y : 描画先 Y 座標 # opacity : 不透明度 #-------------------------------------------------------------------------- def draw_character(character_name, character_index, x, y, opacity = 255) return if character_name == nil bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity) self.contents.clear_rect(x - cw / 2, y -ch +24, 32, 8) end end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 獲得した経験値とお金の表示(再定義) #-------------------------------------------------------------------------- def display_exp_and_gold #再定義 exp = $game_troop.exp_total gold = $game_troop.gold_total sp = $game_troop.sp_total $game_party.gain_gold(gold) text = sprintf(Vocab::Victory, $game_party.name) $game_message.texts.push('\|' + text) if exp > 0 text = sprintf(Vocab::ObtainExp, exp) $game_message.texts.push('\.' + text) end if sp > 0 && BBL_WEAPON::GAIN_SP_SHOW text = sprintf(BBL_WEAPON::OBTAIN_SP, sp, BBL_WEAPON::SP_NAME) $game_message.texts.push('\.' + text) end if gold > 0 text = sprintf(Vocab::ObtainGold, gold, Vocab::gold) $game_message.texts.push('\.' + text) end wait_for_message end #-------------------------------------------------------------------------- # ● レベルアップの表示(再定義) #-------------------------------------------------------------------------- def display_level_up #再定義 exp = $game_troop.exp_total sp = $game_troop.sp_total for actor in $game_party.existing_members last_level = actor.level last_skills = actor.skills actor.gain_exp(exp, true) actor.element_levelup(actor, actor.using_weapon(actor), sp) end wait_for_message end end #============================================================================== # アクター成長曲線生成 テスト用 #-------------------------------------------------------------------------- # ■ Game_Interpreter #============================================================================== class Game_Interpreter def test_st_curve $scene = Scene_Test.new for actor in $game_party.members actor.change_weapon_level(actor.using_weapon(actor), BBL_WEAPON::LIMIT_LEVEL, false) end end end #============================================================================== # ■ Window_Test #============================================================================== class Window_Test < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 544, 416) refresh(0, 0) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(actor_id, type) self.contents.clear limit_level = BBL_WEAPON::LIMIT_LEVEL @count = 1 actor = $game_party.members[actor_id] case type when 0; param = actor.test_mhp; color = Color.new(255, 0, 0); text = "最大HP" when 1; param = actor.test_mmp; color = Color.new(0, 255, 0); text = "最大MP" when 2; param = actor.test_atk; color = Color.new(0, 0, 255); text = "攻撃力" when 3; param = actor.test_def; color = Color.new(128, 128, 0); text = "防御力" when 4; param = actor.test_spi; color = Color.new(0, 128, 128); text = "精神力" when 5; param = actor.test_agi; color = Color.new(128, 0, 128); text = "敏捷性" end column_width = 472.0 / limit_level s = 1 loop do if (param[limit_level -1] / s) > 300 s += 1 else break end end for level in 0..limit_level - 1 self.contents.fill_rect(16 + level * column_width, ((param[level] / s) * -1) + 300, column_width + 1, (param[level] / s), color) if @count == 0 || level == limit_level - 1 self.contents.font.size = 16 self.contents.draw_text(level * column_width + 8, 320, 64, WLH, level + 1) self.contents.draw_text(level * column_width + 8, 356, 64, WLH, param[level]) end @count += 1 @count = 0 if @count == limit_level / 10 end self.contents.font.color = system_color self.contents.draw_text(0, 320, 64, WLH, "熟練LV") self.contents.draw_text(0, 356, 64, WLH, "上昇値") self.contents.fill_rect(0, 320 + 20, 512, 1, system_color) self.contents.fill_rect(0, 356 + 20, 512, 1, system_color) self.contents.font.color = normal_color self.contents.font.size = 20 self.contents.draw_text(4, 0, 100, WLH, actor.name) draw_actor_face(actor, 8, 32) self.contents.font.color = system_color self.contents.font.bold = true self.contents.font.size = 24 text_width = contents.text_size(text).width self.contents.draw_text(120, 10, text_width, 48, text) self.contents.fill_rect(116, 45, text_width + 8, 2, system_color) self.contents.fill_rect(116, 47, text_width + 8, 2, text_color(19)) self.contents.font.bold = false self.contents.font.color = normal_color self.contents.font.size = 16 end end #============================================================================== # ■ Scene_Test #============================================================================== class Scene_Test < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super @actor_index = 0 @type = 0 create_menu_background create_graph end #-------------------------------------------------------------------------- # ● グラフ作成 #-------------------------------------------------------------------------- def create_graph @window_dummy = Window_Test.new end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super update_menu_background @window_dummy.update next_actor if Input.trigger?(Input::R) prev_actor if Input.trigger?(Input::L) next_type if Input.trigger?(Input::RIGHT) prev_type if Input.trigger?(Input::LEFT) return_scene if Input.trigger?(Input::B) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @window_dummy.dispose end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene Sound.play_cancel $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ● 次のタイプに切り替え #-------------------------------------------------------------------------- def next_type Audio.se_play("Audio/SE/book", 80, 100) @type += 1 @type %= 6 @window_dummy.refresh(@actor_index, @type) end #-------------------------------------------------------------------------- # ● 前のタイプに切り替え #-------------------------------------------------------------------------- def prev_type Audio.se_play("Audio/SE/book", 80, 100) @type += 6 - 1 @type %= 6 @window_dummy.refresh(@actor_index, @type) end #-------------------------------------------------------------------------- # ● 次のアクターの画面に切り替え #-------------------------------------------------------------------------- def next_actor Sound.play_cursor @actor_index += 1 @actor_index %= $game_party.members.size @window_dummy.refresh(@actor_index, @type) end #-------------------------------------------------------------------------- # ● 前のアクターの画面に切り替え #-------------------------------------------------------------------------- def prev_actor Sound.play_cursor @actor_index += $game_party.members.size - 1 @actor_index %= $game_party.members.size @window_dummy.refresh(@actor_index, @type) end end