Last active
August 29, 2015 14:04
-
-
Save lctseng/93c8903076bf5f98bbf2 to your computer and use it in GitHub Desktop.
RGSS2片段:戰鬥經驗值變數化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
# ■ Game_Actor | |
#------------------------------------------------------------------------------ | |
# 處理角色的類。本類在 Game_Actors 類 ($game_actors) 的內部使用、 | |
# Game_Party 類請參考 ($game_party) 。 | |
#============================================================================== | |
class Game_Actor < Game_Battler | |
#-------------------------------------------------------------------------- | |
# ● 獲取經驗值變數 | |
#-------------------------------------------------------------------------- | |
def gain_exp_variable(exp) | |
$game_variables[self.id + 10] += exp | |
end | |
end | |
#============================================================================== | |
# ■ Scene_Battle | |
#------------------------------------------------------------------------------ | |
# 處理戰鬥畫面的類。 | |
#============================================================================== | |
class Scene_Battle < Scene_Base | |
#-------------------------------------------------------------------------- | |
# ● 顯示升級 - 修改定義 | |
#-------------------------------------------------------------------------- | |
def display_level_up | |
exp = $game_troop.exp_total | |
for actor in $game_party.existing_members | |
last_level = actor.level | |
last_skills = actor.skills | |
actor.gain_exp_variable(exp) | |
end | |
wait_for_message | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment