Last active
August 29, 2015 14:04
-
-
Save lctseng/b96f6634b7b8f4ef8b0b to your computer and use it in GitHub Desktop.
RGSS3片段解析:殺怪增加變數
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_Enemy腳本中,定義敵人死亡時需要額外做的事情 | |
# 在Game_Enemy腳本列中,額外增加以下方法(method),記得要放在正確的位置(和其他方法一樣的位置) | |
# 範例:在1號開關開啟時,2號敵人死掉時,3號變數加4 | |
#-------------------------------------------------------------------------- | |
# ● 死亡 | |
#-------------------------------------------------------------------------- | |
def die | |
super | |
puts "#{self.name}死亡!" | |
if $game_switches[1] && self.enemy_id == 2 | |
$game_variables[3] += 4 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment