赞 | 0 |
VIP | -1 |
好人卡 | 0 |
积分 | 1 |
经验 | 329224 |
最后登录 | 2016-9-9 |
在线时间 | 5 小时 |
Lv1.梦旅人 NewS-
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 5 小时
- 注册时间
- 2005-10-23
- 帖子
- 3651
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
效果图:
- #==============================================================================
- # ++ 戦闘回数表示 ver. 1.00 ++
- # Script by パラ犬
- # http://para.j-mx.com/
- #------------------------------------------------------------------------------
- # 歩数ウインドウに戦闘回数、倒した敵の数、逃走回数を表示します。
- #------------------------------------------------------------------------------
- # 変数をイベントに使用する場合、
- # $game_party.battle_count (戦闘回数)
- # $game_party.defeat_count (倒した敵の数)
- # $game_party.escape_count (逃走回数)
- # で、それぞれの数値を取得できます。
- #
- # 「$game_party.~」を変数に格納するスクリプトは、
- # $game_variables[変数のID] = $game_party.~
- # となります。
- #==============================================================================
- module PARA_BATTLE_COUNT
-
- # 表示項目( 0:すべて / 1:戦闘回数 / 2:倒した敵の数 / 3:逃走回数 )
- TYPE = 1
- # 各項目の名前
- NAME_ENCOUNT = "戦闘回数" # 戦闘回数
- NAME_DEFEAT = "敵撃破数" # 倒した敵の数
- NAME_ESCAPE = "逃走回数" # 逃走回数
- end
- # ↑ 設定項目ここまで
- #------------------------------------------------------------------------------
- #==============================================================================
- # ■ Game_Party
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :battle_count # 戦闘回数
- attr_reader :defeat_count # 倒した敵の数
- attr_reader :escape_count # 逃走回数
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias initialize_para_battle_count initialize
- def initialize
- initialize_para_battle_count
- @battle_count = 0
- @defeat_count = 0
- @escape_count = 0
- end
- #--------------------------------------------------------------------------
- # ○ 戦闘回数増加
- #--------------------------------------------------------------------------
- def increase_battle_count
- @battle_count = [@battle_count + 1, 9999999].min
- end
- #--------------------------------------------------------------------------
- # ○ 撃破数増加
- #--------------------------------------------------------------------------
- def increase_defeat_count(count)
- @defeat_count = [@defeat_count + count, 9999999].min
- end
- #--------------------------------------------------------------------------
- # ○ 逃走回数増加
- #--------------------------------------------------------------------------
- def increase_escape_count
- @escape_count = [@escape_count + 1, 9999999].min
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● プレバトルフェーズ開始
- #--------------------------------------------------------------------------
- alias start_phase1_para_battle_count start_phase1
- def start_phase1
- @enemies_count = $game_troop.enemies.size
- start_phase1_para_battle_count
- end
- #--------------------------------------------------------------------------
- # ● バトル終了
- # result : 結果 (0:勝利 1:逃走 2:敗北)
- #--------------------------------------------------------------------------
- alias battle_end_para_battle_count battle_end
- def battle_end(result)
- case result
- when 0
- $game_party.increase_battle_count
- $game_party.increase_defeat_count(@enemies_count)
- when 1
- $game_party.increase_battle_count
- $game_party.increase_escape_count
- exist_enemy = 0
- for enemy in $game_troop.enemies
- if enemy.exist?
- exist_enemy += 1
- end
- end
- @enemies_count = @enemies_count - exist_enemy
- $game_party.increase_defeat_count(@enemies_count)
- end
- battle_end_para_battle_count(result)
- end
- end
- #==============================================================================
- # ■ Window_Steps
- #==============================================================================
- class Window_Steps < Window_Base
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- case PARA_BATTLE_COUNT::TYPE
- when 0
- self.contents.font.size = 18
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 76, 20, PARA_BATTLE_COUNT::NAME_ENCOUNT)
- self.contents.font.color = normal_color
- self.contents.draw_text(84, 0, 40, 20, $game_party.battle_count.to_s, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(4, 21, 76, 20, PARA_BATTLE_COUNT::NAME_DEFEAT)
- self.contents.font.color = normal_color
- self.contents.draw_text(84, 21, 40, 20, $game_party.defeat_count.to_s, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(4, 42, 76, 20, PARA_BATTLE_COUNT::NAME_ESCAPE)
- self.contents.font.color = normal_color
- self.contents.draw_text(84, 42, 40, 20, $game_party.escape_count.to_s, 2)
- when 1
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, PARA_BATTLE_COUNT::NAME_ENCOUNT)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, $game_party.battle_count.to_s, 2)
- when 2
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, PARA_BATTLE_COUNT::NAME_DEFEAT)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, $game_party.defeat_count.to_s, 2)
- when 3
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, PARA_BATTLE_COUNT::NAME_ESCAPE)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, $game_party.escape_count.to_s, 2)
- end
- end
- end
复制代码
直接插入main前即可
恩,也可以制作一个与npc对话,显示已经战斗几次的功能:
事件设置如下:
[更新履歴]
2005/8/6 ver.1.00
公開。
|
|