class Game_System
attr_accessor :difficulty # 難易度
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_BattleDifficulty initialize
def initialize
# 元の処理を実行
initialize_KGC_BattleDifficulty
@difficulty = KGC::BD_INITIAL_DIFFICULTY
end
#--------------------------------------------------------------------------
# ● 難易度一覧
#--------------------------------------------------------------------------
def difficulty_list
return KGC::BD_DIFFICULTY_LIST
end
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 基本 MaxHP の取得
#--------------------------------------------------------------------------
alias base_maxhp_KGC_BattleDifficulty base_maxhp
def base_maxhp
n = base_maxhp_KGC_BattleDifficulty
n *= Difficulty.get[1]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本 MaxSP の取得
#--------------------------------------------------------------------------
alias base_maxsp_KGC_BattleDifficulty base_maxsp
def base_maxsp
n = base_maxsp_KGC_BattleDifficulty
n *= Difficulty.get[2]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本腕力の取得
#--------------------------------------------------------------------------
alias base_str_KGC_BattleDifficulty base_str
def base_str
n = base_str_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本器用さの取得
#--------------------------------------------------------------------------
alias base_dex_KGC_BattleDifficulty base_dex
def base_dex
n = base_dex_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本素早さの取得
#--------------------------------------------------------------------------
alias base_agi_KGC_BattleDifficulty base_agi
def base_agi
n = base_agi_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本魔力の取得
#--------------------------------------------------------------------------
alias base_int_KGC_BattleDifficulty base_int
def base_int
n = base_int_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本攻撃力の取得
#--------------------------------------------------------------------------
alias base_atk_KGC_BattleDifficulty base_atk
def base_atk
n = base_atk_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本物理防御の取得
#--------------------------------------------------------------------------
alias base_pdef_KGC_BattleDifficulty base_pdef
def base_pdef
n = base_pdef_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本魔法防御の取得
#--------------------------------------------------------------------------
alias base_mdef_KGC_BattleDifficulty base_mdef
def base_mdef
n = base_mdef_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● 基本回避修正の取得
#--------------------------------------------------------------------------
alias base_eva_KGC_BattleDifficulty base_eva
def base_eva
n = base_eva_KGC_BattleDifficulty
n *= Difficulty.get[3]
return n / 100
end
#--------------------------------------------------------------------------
# ● EXP の取得
#--------------------------------------------------------------------------
alias exp_KGC_BattleDifficulty exp
def exp
n = exp_KGC_BattleDifficulty
n *= Difficulty.get[4]
return n / 100
end
#--------------------------------------------------------------------------
# ● ゴールドの取得
#--------------------------------------------------------------------------
alias gold_KGC_BattleDifficulty gold
def gold
n = gold_KGC_BattleDifficulty
n *= Difficulty.get[5]
return n / 100
end
#--------------------------------------------------------------------------
# ● トレジャー出現率の取得
#--------------------------------------------------------------------------
alias treasure_prob_KGC_BattleDifficulty treasure_prob
def treasure_prob
n = treasure_prob_KGC_BattleDifficulty
if n < 100
n *= Difficulty.get[6]
return [n / 100, 100].min
else
return n
end
end
end[/pre][/fold]
與以下設置腳本整合
意思就是可以在以下的設置裡面調整以上那個戰鬥難易度
[fold=設置腳本][pre lang="ruby"]# * KShlenam XP
# The Options Menu Script with Dash Feature included!
# Scripter : Kyonides Arkanthes
# v1.0.6 - 2023-07-20
def get_volume(pos)
case pos
when 0 then $game_system.bgm_volume
when 1 then $game_system.bgs_volume
when 2 then $game_system.me_volume
when 3 then $game_system.se_volume
end
end
def index=(pos)
@cursor.y = LABELS_OFFSET_Y + pos * 56
end
def dash_index=(pos)
@dash_cursor.x = @dash_x + 64 * pos
end
def full_index=(pos)
@full_cursor.x = @dash_x + 64 * pos
end
def next_scene
case @last_scene
when :title
$scene = Scene_Title.new(@external_index)
when :menu
$scene = Scene_Menu.new(@external_index)
else
$scene = Scene_Map.new
end
end
def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(6)
#next_scene
return @index = nil
elsif Input.trigger?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index = (@index - 1) % @spriteset.total
@spriteset.index = @index
elsif Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @spriteset.total
@spriteset.index = @index
end
case @index
when 0
update_bgm
when 1
update_bgs
when 2
update_me
when 3
update_se
when 4
update_dash
when 5
update_fullscreen
end
end
def update_bgm
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
$game_system.bgm_decrease
$game_system.bgm_play(@bgm)
@spriteset.bar_update(0)
elsif Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
$game_system.bgm_increase
$game_system.bgm_play(@bgm)
@spriteset.bar_update(0)
end
end
def update_bgs
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
$game_system.bgs_decrease
@spriteset.bar_update(1)
elsif Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
$game_system.bgs_increase
@spriteset.bar_update(1)
end
end
def update_me
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
$game_system.me_decrease
@spriteset.bar_update(2)
elsif Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
$game_system.me_increase
@spriteset.bar_update(2)
end
end
def update_se
if Input.trigger?(Input::LEFT)
$game_system.se_decrease
$game_system.se_play($data_system.cursor_se)
@spriteset.bar_update(3)
elsif Input.trigger?(Input::RIGHT)
$game_system.se_increase
$game_system.se_play($data_system.cursor_se)
@spriteset.bar_update(3)
end
end
def update_dash
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
$game_system.auto_dash = !$game_system.auto_dash
@spriteset.dash_index = $game_system.auto_dash ? 0 : 1
end
end
def update_fullscreen
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
$game_system.fullscreen = !$game_system.fullscreen
@spriteset.full_index = $game_system.fullscreen ? 0 : 1
KShlenam.toggle_fullscreen
end
end
end
end
class Sprite
def set_xy(nx, ny)
self.x = nx
self.y = ny
end
def set_xyz(nx, ny, nz)
self.x = nx
self.y = ny
self.z = nz
end
def dispose_all
bitmap.dispose if bitmap
dispose
end
end
class Game_System
alias :kyon_shlenam_gm_sys_init :initialize
def initialize
kyon_shlenam_gm_sys_init
@bgm_volume = KShlenam.volume_levels[0]
@bgs_volume = KShlenam.volume_levels[1]
@me_volume = KShlenam.volume_levels[2]
@se_volume = KShlenam.volume_levels[3]
@auto_dash = KShlenam::AUTO_DASH
@fullscreen = KShlenam::FULLSCREEN
end
def save_volume_levels
KShlenam.volume_levels = [@bgm_volume, @bgs_volume, @me_volume, @se_volume]
end
def bgm_play(bgm)
@playing_bgm = bgm
if bgm and !bgm.name.empty?
Audio.bgm_play("Audio/BGM/" + bgm.name, @bgm_volume, bgm.pitch)
else
Audio.bgm_stop
end
Graphics.frame_reset
end
def bgs_play(bgs)
@playing_bgs = bgs
if bgs and !bgs.name.empty?
Audio.bgs_play("Audio/BGS/" + bgs.name, @bgs_volume, bgs.pitch)
else
Audio.bgs_stop
end
Graphics.frame_reset
end
def me_play(me)
if me != nil and me.name != ""
Audio.me_play("Audio/ME/" + me.name, @me_volume, me.pitch)
else
Audio.me_stop
end
Graphics.frame_reset
end
def se_play(se)
return unless se and se.name != ""
Audio.se_play("Audio/SE/" + se.name, @se_volume, se.pitch)
end
class Game_Map
alias :kyon_shlenam_gm_map_init :initialize
def initialize
kyon_shlenam_gm_map_init
@anti_dash_maps = KShlenam::NO_DASH_MAPS.dup
end
def add_anti_dash(mid)
@anti_dash_maps << mid
@anti_dash_maps = @anti_dash_maps.uniq.sort
end
def remove_anti_dash(mid)
@anti_dash_maps.delete(mid)
end
def disable_dash?
@anti_dash_maps.include?(@map_id)
end
def anti_dash?(mid)
@anti_dash_maps.include?(mid)
end
end
class Game_Player
def dash?
return false if @move_route_forcing
return false if $game_map.disable_dash?
return true if $game_system.auto_dash
return Input.press?(KShlenam::DASH_BUTTON)
end
def update_move
distance = 2 ** @move_speed
distance *= 1.5 if dash?
if @y * 128 > @real_y
@real_y = [@real_y + distance, @y * 128].min
end
if @x * 128 < @real_x
@real_x = [@real_x - distance, @x * 128].max
end
if @x * 128 > @real_x
@real_x = [@real_x + distance, @x * 128].min
end
if @y * 128 < @real_y
@real_y = [@real_y - distance, @y * 128].max
end
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
end
end
class Scene_Load
alias :kyon_shlenam_scn_ld_rsd :read_save_data
def read_save_data(file)
kyon_shlenam_scn_ld_rsd(file)
KShlenam.toggle_fullscreen if $game_system.fullscreen
end
end[/pre][/fold]