bad-end-collector/Scripts/_.rb
2024-05-18 13:05:37 -05:00

89 lines
No EOL
3.7 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
#敵の強さを変数で管理するスクリプトです
#
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
=begin
難易度ごとに倍率を変更できるようにしました。
DIFFICULTで難易度の変数を設定し、
PALAMでそれぞれの難易度の倍率を設定します。
難易度の数値は上から0,1,2・・・というふうに
DIFFICULTに5をいれるとゲーム内の変数5番の値の
難易度になります。
=end
module MARU_degree
#-----------------------------------------------------------------------------
#設定項目
#難易度の変数
DIFFICULT = 5
#[HP,MP,攻撃力,防御力,魔法力,魔法防御,敏捷性,運,経験値,お金]
PALAM = [[1,1,1,1,1,1,1,1,1,1],#hard = 0
[1.5,1,1.5,1.25,1.5,1.25,1.25,1.5,2,1],#very hard = 1
[2.5,2,2.2,2,2.2,2,2,2,2,2],#mania = 2
[2.5,2,2.2,2,2.2,2,2,2,2,2],
[0.7,0.5,0.75,0.5,0.75,0.5,0.5,0.75,1,1]#nomal = 4
]
#経験値を難易度によって変更するかのスイッチ
EXP_CHANGE = 59
#お金を難易度によって変更するかのスイッチ
GOLD_CHANGE = 60
#難易度の初期設定
DEF = 0
#設定終了
#-----------------------------------------------------------------------------
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
#  敵キャラを扱うクラスです。このクラスは Game_Troop クラス($game_troop
# 内部で使用されます。
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 通常能力値の取得
#--------------------------------------------------------------------------
alias maru_param param
def param(param_id)
value = param_base(param_id) + param_plus(param_id)
value *= param_rate(param_id) * param_buff_rate(param_id) * degree(param_id)
[[value, param_max(param_id)].min, param_min(param_id)].max.to_i
end
#--------------------------------------------------------------------------
# ● 経験値の取得
#--------------------------------------------------------------------------
alias ori_exp exp
def exp
ori_exp
if $game_switches[MARU_degree::EXP_CHANGE] = true
enemy.exp * MARU_degree::PALAM[$game_variables[MARU_degree::DIFFICULT]][8]
end
end
#--------------------------------------------------------------------------
# ● お金の取得
#--------------------------------------------------------------------------
alias ori_gold gold
def gold
ori_gold
if $game_switches[MARU_degree::GOLD_CHANGE] = true
enemy.gold * MARU_degree::PALAM[$game_variables[MARU_degree::DIFFICULT]][9]
end
end
#--------------------------------------------------------------------------
# ● 難易度による変化率取得
#--------------------------------------------------------------------------
def degree(param_id)
return MARU_degree::PALAM[$game_variables[MARU_degree::DIFFICULT]][param_id]
end
end
#----------------------------------------------------------------------------
# ● 難易度の初期設定
#----------------------------------------------------------------------------
class Scene_Title
alias ori_command_new_game command_new_game
def command_new_game
ori_command_new_game
$game_variables[MARU_degree::DIFFICULT] = MARU_degree::DEF
end
end