-
Notifications
You must be signed in to change notification settings - Fork 1
/
win_count.rb
30 lines (29 loc) · 1.38 KB
/
win_count.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#==============================================================================
# ■ 勝利回数の記録 v1.0 MIT License; see git.io/tic
#------------------------------------------------------------------------------
# 勝利回数を記録します。イベントコマンド[変数の操作]にて勝利回数を取得する
# には、オペランドにスクリプト $game_system.win_count を指定します。
#==============================================================================
class << BattleManager
#--------------------------------------------------------------------------
# ● 勝利の処理【エイリアス】
#--------------------------------------------------------------------------
alias toruic_process_victory process_victory
def process_victory
success = toruic_process_victory
$game_system.win_count += 1 if success
return success
end
end
#------------------------------------------------------------------------------
class Game_System
attr_accessor :win_count # 勝利回数
#--------------------------------------------------------------------------
# ● オブジェクト初期化【エイリアス】
#--------------------------------------------------------------------------
alias toruic4_initialize initialize
def initialize
toruic4_initialize
@win_count = 0
end
end