| 赞 | 276 |
| VIP | |
| 好人卡 | |
| 积分 | 154 |
| 经验 | |
| 最后登录 | 2026-11-3 |
| 在线时间 | 2110 小时 |
- 梦石
- 1
- 星屑
- 14389
- 在线时间
- 2110 小时
- 注册时间
- 2017-9-28
- 回帖
- 607
|
发表于 2021-9-20 18:43:51
|
显示全部楼层
可以两个功能都用星潟的
剩余回合数显示- #==============================================================================
- # ■ RGSS3 ステート・強化・弱体カウント表示 Ver1.04 by 星潟
- #------------------------------------------------------------------------------
- # ステート・強化・弱体について、アイコンと共に
- # 残り持続ターン数の値を表示します。
- # 非戦闘時の表示形式も選択できます。
- # (ステートはターン数・歩数・表示なし。
- # 強化・弱体はターン数・表示なしからの選択となります)
- #
- # また、当方の状況確認コマンドとの併用時に
- # 状況確認ウィンドウ中のステート・強化・弱体にも
- # カウント表示を行わせるか否かを指定できます。
- #==============================================================================
- # ステートのメモ欄に指定
- #------------------------------------------------------------------------------
- # <ステートカウント非表示>
- #
- # ステートカウントを表示する設定にしていても
- # このステートについてはステートカウントが表示されなくなる。
- #==============================================================================
- module ST_B_REST
-
- #ステートカウント非表示の設定用キーワードを指定。
-
- Word = "ステートカウント非表示"
-
- #非戦闘時のステートの描写タイプを指定します。
- #0で残りターン、1で残り歩数、2で何も表示しません。
-
- STYPE = 0
-
- #非戦闘時の強化の描写タイプを指定します。
- #0で残りターン、1で何も表示しません。
-
- BTYPE = 0
-
- #X座標の調整値を指定します。
-
- X_POS = 0
-
- #Y座標の調整値を指定します。
-
- Y_POS = -4
-
- #文字色を配列で指定します。
- #赤、緑、青、アルファの順に指定します。
-
- COLOR = [255,255,255,255]
-
- #縁の文字色を配列で指定します。
- #赤、緑、青、アルファの順に指定します。
-
- O_CLR = [0,0,0,255]
-
- #文字の影の有無を指定します。
- #trueで有り、falseで無しとなります。
-
- SHADOW = true
-
- #フォントサイズを指定します。
-
- FSIZE = 18
-
- #状況確認コマンドスクリプトを導入しているか否かを指定します。
- #trueで導入、falseで導入していない前提で処理を行います。
- #(導入している状態で、ウィンドウにカウントを表示させたくない場合は
- # falseにして下さい)
-
- CONF = false
-
- #XPスタイルバトルスクリプトを導入しているか否かを指定します。
- #trueで導入、falseで導入していない前提で処理を行います。
-
- XPST = false
-
- #XPスタイルバトルリフォームバトルステータスを導入しているか否かを指定します。
- #trueで導入、falseで導入していない前提で処理を行います。
-
- XPRB = false
-
- end
- class Game_BattlerBase
- #--------------------------------------------------------------------------
- # リフレッシュ
- #--------------------------------------------------------------------------
- alias refresh_buff_rank refresh
- def refresh
-
- #ターン数を整数化。
-
- @buff_turns.keys.each {|i| @buff_turns[i] = @buff_turns[i].to_i}
-
- #本来の処理を実行。
-
- refresh_buff_rank
-
- end
- #--------------------------------------------------------------------------
- # ステートの残時間を描写
- #--------------------------------------------------------------------------
- def state_rest_array
-
- #配列を作成。
-
- array = []
-
- #描写タイプを取得。戦闘中はタイプ0固定。
-
- type = $game_party.in_battle ? 0 : ST_B_REST::STYPE
-
- #タイプ2の場合は空の配列を返す。
-
- return array if type == 2
-
- #現在のステート別に判定。
-
- states.each {|state|
-
- #ステートアイコンIDの場合は飛ばす。
-
- next if state.icon_index == 0
-
- #タイプ別に判定する。
-
- if state.state_count_invisible
-
- array.push("")
-
- else
- case type
-
- #タイプ0の場合、自動解除される場合は残りターン数、
- #自動解除されない場合は空の文字列を配列に入れる。
-
- when 0;array.push(state.auto_removal_timing != 0 ? @state_turns[state.id] : "")
-
- #タイプ1の場合、歩数で解除される場合は残り歩数、
- #解除されない場合は空の文字列を配列に入れる。
-
- when 1;array.push(state.remove_by_walking ? @state_steps[state.id] : "")
-
- end
- end
- }
-
- #配列を返す。
-
- array
-
- end
- #--------------------------------------------------------------------------
- # 強化・弱体の残時間を描写
- #--------------------------------------------------------------------------
- def buff_rest_array
-
- #配列を作成。
-
- array = []
-
- #描写タイプを取得。戦闘中はタイプ0固定。
-
- type = $game_party.in_battle ? 0 : ST_B_REST::BTYPE
-
- #タイプ1の場合は空の配列を返す。
-
- return array if type == 1
-
- #能力別に強化・弱体が発生しているかどうかを判定し
- #配列に残りターンを入れる。
-
- @buffs.each_with_index {|lv, i| next if buff_icon_index(lv, i) == 0
- array.push(@buff_turns[i])
- }
-
- #配列を返す。
-
- array
-
- end
- end
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ステートおよび強化/弱体のアイコンを描画
- #--------------------------------------------------------------------------
- alias draw_actor_icons_rest_draw draw_actor_icons
- def draw_actor_icons(actor, x, y, width = 96)
-
- #本来の処理を実行。
-
- draw_actor_icons_rest_draw(actor, x, y, width)
-
- #フォントデータを保存。
-
- font_data = contents.font.clone
-
- #指定したフォントに変更。
-
- contents.font.size = ST_B_REST::FSIZE
- ca1 = ST_B_REST::COLOR
- contents.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
- ca2 = ST_B_REST::O_CLR
- contents.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
- contents.font.shadow = ST_B_REST::SHADOW
-
- #残カウントの配列を準備。
-
- array = actor.state_rest_array + actor.buff_rest_array
-
- #長さに応じて配列を削る。
-
- array = array[0, width / 24]
-
- #配列の値を描写。
-
- array.each_with_index {|n, i| draw_text(
- x + 24 * i + ST_B_REST::X_POS, y + ST_B_REST::Y_POS, 24, 24, n, 2) }
-
- #保存したフォントデータを復帰。
-
- contents.font = font_data
- end
- end
- if ST_B_REST::CONF
- class Window_B_Confirm < Window_Selectable
- #--------------------------------------------------------------------------
- # 項目の描画
- #--------------------------------------------------------------------------
- alias draw_item_rest_draw draw_item
- def draw_item(index)
-
- #本来の処理を実行。
-
- draw_item_rest_draw(index)
-
- #フォントデータを保存。
-
- font_data = contents.font.clone
-
- #指定したフォントに変更。
-
- contents.font.size = ST_B_REST::FSIZE
- ca1 = ST_B_REST::COLOR
- contents.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
- ca2 = ST_B_REST::O_CLR
- contents.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
- contents.font.shadow = ST_B_REST::SHADOW
-
- if @last_actor == nil
-
- case @display_mode
- when 0
- actor = B_CONFIRM::PTMT ? $game_party.all_members[index] : $game_party.members[index]
- when 1
- actor = $game_troop.unhidden_members[index]
- end
-
- rect = item_rect(index)
-
- icons_width = (rect.width - rect.x - 150 - 96) / 24
-
- #ステートの残カウントの配列を準備。
-
- array = actor.state_rest_array
-
- #長さに応じて配列を削る。
-
- sub_array = array[0, icons_width]
-
- #配列の値を描写。
-
- sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, rect.y + y + ST_B_REST::Y_POS + line_height * 1, 24, 24, n, 2) }
-
- #長さに応じて配列を削る。
-
- sub_array = array[icons_width, icons_width * 2]
-
- #配列の値を描写。
-
- sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, rect.y + y + ST_B_REST::Y_POS + line_height * 2, 24, 24, n, 2) } if sub_array != nil
-
- #強化・弱体の残カウントの配列を準備。
-
- array = actor.buff_rest_array
-
- #長さに応じて配列を削る。
-
- sub_array = array[0, icons_width]
-
- #配列の値を描写。
-
- sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, rect.y + y + ST_B_REST::Y_POS + line_height * 3, 24, 24, n, 2) }
-
- end
-
- #保存したフォントデータを復帰。
-
- contents.font = font_data
-
- end
- end
- class Window_B_Confirm_Detail < Window_Base
- #--------------------------------------------------------------------------
- # リフレッシュ
- #--------------------------------------------------------------------------
- alias refresh_rest_draw refresh
- def refresh
-
- #バトラーを取得。
-
- actor = @window_b_confirm.last_actor
-
- #本来の処理を実行。
-
- refresh_rest_draw
-
- #フォントデータを保存。
-
- font_data = contents.font.clone
-
- #指定したフォントに変更。
-
- contents.font.size = ST_B_REST::FSIZE
- ca1 = ST_B_REST::COLOR
- contents.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
- ca2 = ST_B_REST::O_CLR
- contents.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
- contents.font.shadow = ST_B_REST::SHADOW
-
- #項目内のデータを描写していく。
-
- icons_width = (width - x - 162 - 96) / 24
-
- #ステートの残カウントの配列を準備。
-
- array = actor.state_rest_array
-
- #長さに応じて配列を削る。
-
- sub_array = array[0, icons_width]
-
- #配列の値を描写。
-
- sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, y + ST_B_REST::Y_POS + line_height * 1, 24, 24, n, 2) }
-
- #長さに応じて配列を削る。
-
- sub_array = array[icons_width, icons_width * 2]
-
- #配列の値を描写。
-
- sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, y + ST_B_REST::Y_POS + line_height * 2, 24, 24, n, 2) } if sub_array != nil
-
- #強化・弱体の残カウントの配列を準備。
-
- array = actor.buff_rest_array
-
- #長さに応じて配列を削る。
-
- sub_array = array[0, icons_width]
-
- #配列の値を描写。
-
- sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, y + ST_B_REST::Y_POS + line_height * 3, 24, 24, n, 2) }
-
- #保存したフォントデータを復帰。
-
- contents.font = font_data
-
- end
- end
- end
- class RPG::State < RPG::BaseItem
- #--------------------------------------------------------------------------
- # ステートカウント非表示フラグ
- #--------------------------------------------------------------------------
- def state_count_invisible
- (@state_count_invisible ||= /<#{ST_B_REST::Word}>/ =~ note ? 1 : 0) == 1
- end
- end
- if ST_B_REST::XPST
- class Game_Battler < Game_BattlerBase
- #--------------------------------------------------------------------------
- # ステートカウントの取得。念の為別定義
- #--------------------------------------------------------------------------
- def state_turns_for_xp_style_battle
- @state_turns
- end
- #--------------------------------------------------------------------------
- # ステートカウントの取得。念の為別定義
- #--------------------------------------------------------------------------
- def buff_turns_for_xp_style_battle
- @buff_turns
- end
- end
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # アクターのステータス配列にステートカウントを追加
- #--------------------------------------------------------------------------
- alias status_state_turns_for_xp_style_battle status
- def status(actor)
- status_state_turns_for_xp_style_battle(actor) +
- [actor.state_turns_for_xp_style_battle.clone] +
- [actor.buff_turns_for_xp_style_battle.clone]
- end
- end
- end
- if ST_B_REST::XPRB
- class Sprite_StateIcon < Sprite_BattleStatus
- #--------------------------------------------------------------------------
- # ステートアイコン配列の取得
- #--------------------------------------------------------------------------
- alias icons_turns icons
- def icons
- {:icons => icons_turns,
- :state_turns => @battler.state_turns_for_xp_style_battle.clone,
- :buff_turns => @battler.buff_turns_for_xp_style_battle.clone}
- end
- end
- end
复制代码
状态滚动
- #==============================================================================
- # ■ RGSS3 滚动状态 Ver1.00 by 星潟
- #------------------------------------------------------------------------------
- # 默认战斗中显示状态数量有限,状态数量很多时玩家无法知道全部状态。
- # 此脚本让所有状态滚动显示。
- #
- # 此外,会在强化能力、弱化能力中显示数字,表示等级数。
- #
- # 对于非默认战斗系统兼容性可能较差。
- #==============================================================================
- module BattleStateScroll
-
- #附加/解除状态时
- #设定不透明度变化的数值。
- #数值越大,不透明度变化越快。
- #数值建议在1~255之间。
-
- FadeIn = 16
-
- end
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # オブジェクト初期化
- #--------------------------------------------------------------------------
- alias initialize_actor_icons_sprites initialize
- def initialize
- @icons_sprites = []
- initialize_actor_icons_sprites
- end
- #--------------------------------------------------------------------------
- # リフレッシュ
- #--------------------------------------------------------------------------
- alias refresh_actor_icons_sprites refresh
- def refresh
- i1 = $game_party.battle_members.size
- if i1 > 0
- @icons_sprites.each_with_index {|s,i2|
- s.dispose if i2 >= i1}
- @icons_sprites.delete_if {|s| s.disposed?}
- else
- @icons_sprites.each {|s,i2| s.dispose}
- @icons_sprites = []
- end
- refresh_actor_icons_sprites
- end
- #--------------------------------------------------------------------------
- # ステートおよび強化/弱体のアイコンを描画
- #--------------------------------------------------------------------------
- def draw_actor_icons(actor, x, y, width = 96)
- i = actor.index
- @icons_sprites[i] ||= Sprite_StatesIcons.new(self,i,width / 24,self.viewport)
- icons = (actor.state_icons + actor.buff_icons)
- ib = Cache.system("IconSet")
- if width / 24 < icons.size
- ic = icons.clone
- (width / 24).times {icons.push(ic.shift)}
- end
- data_hash = {:icons => icons}
- flag1 = defined? draw_actor_icons_rest_draw
- if flag1
- rest_array = actor.state_rest_array + actor.buff_rest_array
- if width / 24 < icons.size
- rac = rest_array.clone
- (width / 24).times {rest_array.push(rac.shift)}
- end
- data_hash[:rest] = rest_array
- end
- flag2 = defined? draw_actor_icons_level_draw
- if flag2
- level_array = actor.state_level_array
- if width / 24 < level_array.size
- lac = level_array.clone
- (width / 24).times {level_array.push(lac.shift)}
- end
- data_hash[:level] = level_array
- end
- if @icons_sprites[i].data_hash != data_hash
- @icons_sprites[i].bitmap.dispose if @icons_sprites[i].bitmap && !@icons_sprites[i].bitmap.disposed?
- all_reset = (!@icons_sprites[i].data_hash or (@icons_sprites[i].data_hash[:icons] != data_hash[:icons]))
- @icons_sprites[i].data_hash = data_hash
- is = icons.size
- b = Bitmap.new((is > 0 ? is : 1) * 24,24)
- icons.each_with_index {|n, i|
- rect = Rect.new(n % 16 * 24, n / 16 * 24, 24, 24)
- b.blt(i * 24, 0, ib, rect)}
-
- if flag1
- font_data = b.font.clone
- b.font.size = ST_B_REST::FSIZE
- ca1 = ST_B_REST::COLOR
- b.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
- ca2 = ST_B_REST::O_CLR
- b.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
- b.font.shadow = ST_B_REST::SHADOW
- rest_array.each_with_index {|n, i| b.draw_text(24 * i + ST_B_REST::X_POS, ST_B_REST::Y_POS, 24, 24, n, 2) }
- b.font = font_data
- end
-
- if flag2
- font_data = b.font.clone
- b.font.size = StateLevel::FSIZE
- ca1 = StateLevel::COLOR
- b.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
- ca2 = StateLevel::O_CLR
- b.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
- b.font.shadow = StateLevel::SHADOW
- level_array.each_with_index {|n, i| b.draw_text(24 * i + StateLevel::X_POS, StateLevel::Y_POS, 24, 24, n, 2) }
- b.font = font_data
- end
-
- if all_reset
- @icons_sprites[i].bitmap = b
- @icons_sprites[i].opacity = 0
- @icons_sprites[i].src_rect = Rect.new(0,0,width,96)
- else
- src_rect = @icons_sprites[i].src_rect.clone
- @icons_sprites[i].bitmap = b
- @icons_sprites[i].src_rect = src_rect
- end
- end
- @icons_sprites[i].add_x = x
- @icons_sprites[i].add_y = y
- end
- #--------------------------------------------------------------------------
- # 更新
- #--------------------------------------------------------------------------
- unless method_defined?(:update_actor_icons_sprites)
- alias update_actor_icons_sprites update
- def update
- update_actor_icons_sprites
- @icons_sprites.each {|s| s.update}
- end
- end
- #--------------------------------------------------------------------------
- # 解放
- #--------------------------------------------------------------------------
- unless method_defined?(:dispose_actor_icons_sprites)
- alias dispose_actor_icons_sprites dispose
- def dispose
- @icons_sprites.each {|s| s.dispose}
- @icons_sprites.clear
- dispose_actor_icons_sprites
- end
- end
- end
- class Sprite_StatesIcons < Sprite
- attr_accessor :add_x
- attr_accessor :add_y
- attr_accessor :data_hash
- #--------------------------------------------------------------------------
- # 初期化
- #--------------------------------------------------------------------------
- def initialize(window,index,max_width,viewport = nil)
- @window = window
- @index = index
- @max_width = max_width
- @add_x = 0
- @add_y = 0
- super(viewport)
- end
- #--------------------------------------------------------------------------
- # 更新
- #--------------------------------------------------------------------------
- def update
- super
- self.viewport = @window.viewport if self.viewport != @window.viewport
- self.x = @window.x + @window.standard_padding + add_x
- self.y = @window.y + @window.standard_padding + add_y
- self.z = @window.z
- if @window.close? or !@window.visible
- self.visible = false
- return
- else
- self.visible = true
- end
- self.opacity += BattleStateScroll::FadeIn if self.opacity < 255
- if self.bitmap
- self.src_rect.x += 1 if self.bitmap.width / 24 > @max_width
- self.src_rect.x = 0 if (self.bitmap.width - self.src_rect.x) / 24 - @max_width < 0
- end
- end
- #--------------------------------------------------------------------------
- # 解放
- #--------------------------------------------------------------------------
- def dispose
- self.bitmap.dispose if self.bitmap && !self.bitmap.disposed?
- super
- end
- end
复制代码 |
评分
-
查看全部评分
|