Invité
| Sujet: [VX] Changer la difficulté des combats Sam 5 Avr 2008 - 12:17 | |
| Alors voila un script trouvé et posté par moi ( sur rpg créative) il permet de changer la difficulté des combat en changeant juste les valeurs mais passons; Auteur: Je sais pas Traducteur: RPGM Posteur: RPGM - Code:
-
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #_/ ◆ 戦闘難易度 - KGC_BattleDifficulty ◆ VX ◆ #_/ ◇ Last update : 2008/02/09 ◇ #_/---------------------------------------------------------------------------- #_/ 戦闘難易度の設定を追加します。 #_/============================================================================ #_/ 【基本機能】≪ドロップアイテム拡張≫ より下に導入してください。 #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#============================================================================== # ★ カスタマイズ項目 - Customize ★ #==============================================================================
module KGC module BattleDifficulty # ◆ 難易度を保存する変数の番号 # ここで指定した番号の変数に難易度が入る。 DIFFICULTY_VARIABLE = 15
# ◆ 難易度 # 難易度設定を # DIFFICULTY << { # :name => "難易度名", # :maxhp => MaxHP 修正, # :maxmp => MaxMP 修正, # :atk => 攻撃力修正, # :def => 防御力修正, # :spi => 精神力修正, # :agi => 敏捷性修正, # :param => 攻撃力・防御力・精神力・敏捷性修正 (一括指定), # :hit => 命中率, # :eva => 回避率, # :cri => クリティカル率, # :exp => 経験値, # :gold => お金, # :drop => アイテムドロップ率, # } # という書式で作成。 # (:atk, :def, :spi, :agi は、:param より優先順位が高い) # 各項目の単位は % # :name 以外は省略可能。省略した項目は 100 扱い。 # 難易度番号は、作成順に 0, 1, 2, ... となる。 DIFFICULTY = [] # ~ ここから追加 ~ #ici pour changez les valeurs de bases DIFFICULTY << { # 難易度 0 :name => "Easy", :maxhp => 80, :maxmp => 80, :param => 80, :cri => 50, :drop => 90, } # ← 最後の } を忘れずに DIFFICULTY << { # 難易度 1 :name => "Normal", } DIFFICULTY << { # 難易度 2 :name => "Hard", :maxhp => 150, :maxmp => 130, :atk => 120, :spi => 120, :agi => 110, :drop => 120, } DIFFICULTY << { # 難易度 3 :name => "Mania", :maxhp => 200, :maxmp => 180, :atk => 150, :spi => 150, :agi => 130, :cri => 120, :drop => 140, } DIFFICULTY << { # 難易度 4 :name => "Unknown", :maxhp => 300, :maxmp => 260, :atk => 200, :spi => 200, :agi => 150, :cri => 160, :drop => 160, } DIFFICULTY << { # 難易度 5 :name => "Divine", :maxhp => 500, :maxmp => 400, :atk => 300, :spi => 300, :agi => 180, :cri => 200, :drop => 200, }
# ◆ 難易度初期設定 # DIFFICULTY のインデックス。 # デフォルトでは、1 は Normal。 INITIAL_DIFFICULTY = 1
# ◆ メニュー画面に「難易度設定」コマンドを追加する # 追加する場所は、メニューコマンドの最下部です。 # 他の部分に追加したければ、≪カスタムメニューコマンド≫ をご利用ください。 USE_MENU_DIFFICULTY_COMMAND = true end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil $imported["BattleDifficulty"] = true
module KGC::BattleDifficulty # パラメータ一覧 PARAMS = [ :maxhp, :maxmp, :atk, :def, :spi, :agi, :hit, :eva, :cri, :exp, :gold, :drop ]
module_function #-------------------------------------------------------------------------- # ○ 難易度補正値作成 #-------------------------------------------------------------------------- def create_param_revs @@param_revs = [] DIFFICULTY.each { |d| rev = {} rev[:name] = d[:name] # 一括指定を適用 if d[:param] != nil rev[:atk] = rev[:def] = rev[:spi] = rev[:agi] = d[:param] end # パラメータ指定を適用 PARAMS.each { |par| if d[par] != nil rev[par] = d[par] else rev[par] = 100 if rev[par] == nil end } # リストに追加 @@param_revs << rev } end #-------------------------------------------------------------------------- # ○ 難易度補正値取得 #-------------------------------------------------------------------------- def param_revs return @@param_revs end #-------------------------------------------------------------------------- # ○ 難易度インデックス取得 #-------------------------------------------------------------------------- def get_index vid = DIFFICULTY_VARIABLE if $game_variables[vid] < 0 || DIFFICULTY.size <= $game_variables[vid] $game_variables[vid] = INITIAL_DIFFICULTY end return $game_variables[vid] end #-------------------------------------------------------------------------- # ○ 難易度取得 #-------------------------------------------------------------------------- def get return @@param_revs[get_index] end #-------------------------------------------------------------------------- # ○ 難易度変更 # index : 難易度インデックス #-------------------------------------------------------------------------- def set(index) index = [[index, DIFFICULTY.size - 1].min, 0].max $game_variables[DIFFICULTY_VARIABLE] = index end
create_param_revs end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#============================================================================== # ■ RPG::Enemy::DropItem #==============================================================================
unless $@ class RPG::Enemy::DropItem #-------------------------------------------------------------------------- # ● 出現率 1/N の分母 N #-------------------------------------------------------------------------- alias denominator_KGC_BattleDifficulty denominator def denominator n = denominator_KGC_BattleDifficulty if n > 1 n = [n * 100 / KGC::BattleDifficulty.get[:drop], 1].max end return n end
if method_defined?(:drop_prob) #-------------------------------------------------------------------------- # ○ ドロップ率 (直接指定) #-------------------------------------------------------------------------- alias drop_prob_KGC_BattleDifficulty drop_prob def drop_prob n = drop_prob_KGC_BattleDifficulty if n < 100 && 0 < n n = [[n * KGC::BattleDifficulty.get[:drop] / 100, 1].max, 100].min end return n end end
end # class end # unless $@
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#============================================================================== # ■ Game_Enemy #==============================================================================
class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ● 基本 MaxHP の取得 #-------------------------------------------------------------------------- alias base_maxhp_KGC_BattleDifficulty base_maxhp def base_maxhp n = base_maxhp_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:maxhp] / 100 return n end #-------------------------------------------------------------------------- # ● 基本 MaxMP の取得 #-------------------------------------------------------------------------- alias base_maxmp_KGC_BattleDifficulty base_maxmp def base_maxmp n = base_maxmp_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:maxmp] / 100 return n end #-------------------------------------------------------------------------- # ● 基本攻撃力の取得 #-------------------------------------------------------------------------- alias base_atk_KGC_BattleDifficulty base_atk def base_atk n = base_atk_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:atk] / 100 return n end #-------------------------------------------------------------------------- # ● 基本防御力の取得 #-------------------------------------------------------------------------- alias base_def_KGC_BattleDifficulty base_def def base_def n = base_def_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:def] / 100 return n end #-------------------------------------------------------------------------- # ● 基本精神力の取得 #-------------------------------------------------------------------------- alias base_spi_KGC_BattleDifficulty base_spi def base_spi n = base_spi_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:spi] / 100 return n end #-------------------------------------------------------------------------- # ● 基本敏捷性の取得 #-------------------------------------------------------------------------- alias base_agi_KGC_BattleDifficulty base_agi def base_agi n = base_agi_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:agi] / 100 return n end #-------------------------------------------------------------------------- # ● 命中率の取得 #-------------------------------------------------------------------------- alias hit_KGC_BattleDifficulty hit def hit n = hit_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:hit] / 100 return n end #-------------------------------------------------------------------------- # ● 回避率の取得 #-------------------------------------------------------------------------- alias eva_KGC_BattleDifficulty eva def eva n = eva_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:eva] / 100 return n end #-------------------------------------------------------------------------- # ● クリティカル率の取得 #-------------------------------------------------------------------------- alias cri_KGC_BattleDifficulty cri def cri n = cri_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:cri] / 100 return n end #-------------------------------------------------------------------------- # ● 経験値の取得 #-------------------------------------------------------------------------- alias exp_KGC_BattleDifficulty exp def exp n = exp_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:exp] / 100 return n end #-------------------------------------------------------------------------- # ● お金の取得 #-------------------------------------------------------------------------- alias gold_KGC_BattleDifficulty gold def gold n = gold_KGC_BattleDifficulty n = n * KGC::BattleDifficulty.get[:gold] / 100 return n end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#============================================================================== # ■ Window_Command #==============================================================================
class Window_Command < Window_Selectable
unless method_defined?(:add_command) #-------------------------------------------------------------------------- # ○ コマンドを追加 # 追加した位置を返す |
|
Invité
| Sujet: Re: [VX] Changer la difficulté des combats Sam 5 Avr 2008 - 12:17 | |
| Suite: - Code:
-
#-------------------------------------------------------------------------- def add_command(command) @commands << command @item_max = @commands.size item_index = @item_max - 1 refresh_command draw_item(item_index) return item_index end #-------------------------------------------------------------------------- # ○ コマンドをリフレッシュ #-------------------------------------------------------------------------- def refresh_command buf = self.contents.clone self.height = [self.height, row_max * WLH + 32].max create_contents self.contents.blt(0, 0, buf, buf.rect) buf.dispose end #-------------------------------------------------------------------------- # ○ コマンドを挿入 #-------------------------------------------------------------------------- def insert_command(index, command) @commands.insert(index, command) @item_max = @commands.size refresh_command refresh end #-------------------------------------------------------------------------- # ○ コマンドを削除 #-------------------------------------------------------------------------- def remove_command(command) @commands.delete(command) @item_max = @commands.size refresh end end
unless method_defined?(:replace_command) #-------------------------------------------------------------------------- # ○ コマンドを置換 #-------------------------------------------------------------------------- def replace_command(index, command, enabled = true) @commands[index] = command draw_item(index, enabled) end end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#============================================================================== # ■ Scene_Title #==============================================================================
class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # ● 各種ゲームオブジェクトの作成 #-------------------------------------------------------------------------- alias create_game_objects_KGC_BattleDifficulty create_game_objects def create_game_objects create_game_objects_KGC_BattleDifficulty
# 難易度を初期化 variable_id = KGC::BattleDifficulty::DIFFICULTY_VARIABLE $game_variables[variable_id] = KGC::BattleDifficulty::INITIAL_DIFFICULTY end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#============================================================================== # ■ Scene_Menu #==============================================================================
class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- alias create_command_window_KGC_BattleDifficulty create_command_window def create_command_window create_command_window_KGC_BattleDifficulty
create_difficulty_window
return unless KGC::BattleDifficulty::USE_MENU_DIFFICULTY_COMMAND return if $imported["CustomMenuCommand"]
@__command_set_difficulty_index = @command_window.add_command(KGC::BattleDifficulty.get[:name]) if @command_window.oy > 0 @command_window.oy -= Window_Base::WLH end @command_window.index = @menu_index end #-------------------------------------------------------------------------- # ○ 難易度選択ウィンドウの作成 #-------------------------------------------------------------------------- def create_difficulty_window commands = [] KGC::BattleDifficulty::param_revs.each { |d| commands << d[:name] } @difficulty_window = Window_Command.new(160, commands) @difficulty_window.x = @command_window.width - 16 @difficulty_window.z = 1000 @difficulty_window.active = false @difficulty_window.openness = 0 end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- alias terminate_KGC_BattleDifficulty terminate def terminate terminate_KGC_BattleDifficulty
@difficulty_window.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_KGC_BattleDifficulty update def update @difficulty_window.update if @difficulty_window.active update_KGC_BattleDifficulty
update_difficulty_selection return end
update_KGC_BattleDifficulty end #-------------------------------------------------------------------------- # ● コマンド選択の更新 #-------------------------------------------------------------------------- alias update_command_selection_KGC_BattleDifficulty update_command_selection def update_command_selection call_ap_viewer_flag = false if Input.trigger?(Input::C) case @command_window.index when @__command_set_difficulty_index # 難易度設定 call_set_difficulty_flag = true end end
# 難易度設定に移行 if call_set_difficulty_flag Sound.play_decision start_difficulty_selection return end
update_command_selection_KGC_BattleDifficulty end #-------------------------------------------------------------------------- # ○ 難易度選択の開始 #-------------------------------------------------------------------------- def start_difficulty_selection @command_window.active = false dy = @command_window.cursor_rect.y limit_y = Graphics.height - @difficulty_window.height @difficulty_window.y = [[dy, limit_y].min, 0].max @difficulty_window.active = true @difficulty_window.index = KGC::BattleDifficulty.get_index @difficulty_window.open end #-------------------------------------------------------------------------- # ○ 難易度選択の終了 #-------------------------------------------------------------------------- def end_difficulty_selection @command_window.active = true @difficulty_window.active = false @difficulty_window.close end #-------------------------------------------------------------------------- # ○ 難易度選択の更新 #-------------------------------------------------------------------------- def update_difficulty_selection if Input.trigger?(Input::B) Sound.play_cancel end_difficulty_selection elsif Input.trigger?(Input::C) Sound.play_decision # 難易度を変更 KGC::BattleDifficulty.set(@difficulty_window.index) @command_window.replace_command(@__command_set_difficulty_index, KGC::BattleDifficulty.get[:name]) end_difficulty_selection end end end Screen:Je n'en ais pas mais je peux vous dire que cela se trouve dans le menu voila c'est tout et pour changez les variables; c'est au début du script |
|
dYeu retraité prématurément
Age : 29 Inscrit le : 09/02/2008 Messages : 5357
| Sujet: Re: [VX] Changer la difficulté des combats Sam 5 Avr 2008 - 12:44 | |
| Merci beaucoup pour les scripts ^^. |
|
Va-nu-pieds Lv.4
Inscrit le : 26/02/2011 Messages : 72
| Sujet: Re: [VX] Changer la difficulté des combats Mar 1 Mar 2011 - 14:12 | |
| Merci pour le partage. Elle se place au-dessus de main ou dans battler ?
Merci d'avance.
Edit: J'ai plein d'erreur dedans et je ne sais pas comment modifier tous sa y en à certain que oui mais d'autre non. |
|
Age : 33 Inscrit le : 27/06/2008 Messages : 10881
| Sujet: Re: [VX] Changer la difficulté des combats Mar 1 Mar 2011 - 15:28 | |
| On remplace très très rarement les scripts de base, donc oui c'est au dessus de main.
Si tu as des questions merci d'ouvrir un nouveau topic parce que celui-ci date de 2008, et ça s'appelle un nécropost ce que tu viens de faire là. Merci d'éviter à l'avenir.
Lock. |
|
| Sujet: Re: [VX] Changer la difficulté des combats | |
| |
|