lunariafantasia/Scripts/_.87.rb
2024-01-12 03:12:38 -06:00

38 lines
No EOL
1.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.

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors
# の内部で使用され、Game_Party クラス($game_partyからも参照されます。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ○
#--------------------------------------------------------------------------
def level_set(level)
return if @level >= level
level = [[level, max_level].min, 1].max
change_exp(exp_for_level(level), false)
end
end
#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
#  イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
# Game_Troop クラス、Game_Event クラスの内部で使用されます。
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ○ 仲間キャラのレベル調整。flagがtrueの場合は指定レベルと主人公レベルの高い方に合わせる
#--------------------------------------------------------------------------
def leveling(actor_id, level, flag = false)
if flag
$game_actors[actor_id].level_set([level, $game_actors[1].level].max)
else
$game_actors[actor_id].level_set(level)
end
end
end