| 赞 | 7 |
| VIP | |
| 好人卡 | |
| 积分 | 15 |
| 经验 | |
| 最后登录 | 2026-6-20 |
| 在线时间 | 815 小时 |
- 梦石
- 0
- 星屑
- 1461
- 在线时间
- 815 小时
- 注册时间
- 2013-8-3
- 回帖
- 355
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
两个功能不能一起实现
状态滚动- #==============================================================================
- # ■状态剩余回合数显示 for RGSS3 Ver1.01-β
- # □作成者 kure
- #==============================================================================
- #
- # 状态备注: <不显示剩余回合数> 则不会显示剩余回合数
- #
- #==============================================================================
- # ■ RPG::State(追加定義)
- #==============================================================================
- class RPG::State < RPG::BaseItem
- #--------------------------------------------------------------------------
- # ☆残りターン非表示の定義(追加定義)
- #--------------------------------------------------------------------------
- def view_turns?
- return true unless @note
- return false if @note.include?("<不显示剩余回合数>")
- return true
- end
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● ステートおよび強化/弱体のアイコンを描画(再定義)
- #--------------------------------------------------------------------------
- def draw_actor_icons(actor, x, y, width = 96)
- icons = (actor.state_icons_adv + actor.buff_icons_adv)[0, width / 24]
-
- last = contents.font.size
- contents.font.size = 18
- change_color(crisis_color)
- icons.each_with_index {|n, i| draw_state_icon_turns(n, x + 24 * i, y) }
- change_color(normal_color)
- contents.font.size = last
-
- end
- #--------------------------------------------------------------------------
- # ● 残りのターンを加えたアイコンの描画(追加定義)
- #--------------------------------------------------------------------------
- def draw_state_icon_turns(data, x, y)
- draw_icon(data[0], x, y)
- if data[2] and $data_states[data[2]] and $data_states[data[2]].auto_removal_timing == 0
- return
- end
- draw_text(x + 12, y + 8, 12, 18, data[1],2)
- end
- end
- #==============================================================================
- # ■ Game_BattlerBase
- #==============================================================================
- class Game_BattlerBase
- #--------------------------------------------------------------------------
- # ● 現在のステートをアイコンINDEX、残りターン、ステートIDで取得(追加定義)
- #--------------------------------------------------------------------------
- def state_icons_adv
- icons = states.collect {|state| [state.icon_index, @state_turns[state.id], state.id] }
- for i in 0..icons.size - 1
- if icons[i][0] == 0
- icons[i] = nil
- else
- icons[i][1] = "" if $data_states[icons[i][2]].auto_removal_timing == 0
- icons[i][1] = "" unless $data_states[icons[i][2]].view_turns?
- end
- end
- icons.compact!
- return icons
- end
- #--------------------------------------------------------------------------
- # ● 現在の強化/弱体をアイコンINDEX、残りターンで取得(追加定義)
- #--------------------------------------------------------------------------
- def buff_icons_adv
- icons = []
- @buffs.each_with_index {|lv, i| [icons.push(buff_icon_index(lv, i)),@buff_turns[i]] }
- for i in 0..icons.size - 1
- icons[i] = nil if icons[i][0] == 0
- end
- icons.compact!
- return icons
- end
- end
复制代码
回合显示- ###--------------------------------------------------------------------------###
- # CP 滚动状态 VX script #
- # Version 1.1 #
- # #
- # Credits: #
- # Original code by: Neon Black #
- # Modified by: #
- # #
- # This work is licensed under the Creative Commons Attribution-NonCommercial #
- # 3.0 Unported License. To view a copy of this license, visit #
- # [url]http://creativecommons.org/licenses/by-nc/3.0/.[/url] #
- # Permissions beyond the scope of this license are available at #
- # [url]http://cphouseset.wordpress.com/liscense-and-terms-of-use/.[/url] #
- # #
- # Contact: #
- # NeonBlack - neonblack23@live.com (e-mail) or "neonblack23" on skype #
- ###--------------------------------------------------------------------------###
- ###--------------------------------------------------------------------------###
- # Revision information: #
- # V1.1 - 11.14.2012 #
- # Improved state rectangle drawing #
- # V1.0 - 7.15.2012 #
- # Wrote and debugged main script #
- ###--------------------------------------------------------------------------###
- ###--------------------------------------------------------------------------###
- # Compatibility: #
- # Alias - Window_Base: initialize, update #
- # Overwrites - Window_Base: draw_actor_icons #
- # New Objects - Window_Base: draw_icons_area, clear_all_icons #
- # Scroll_States: initialize, change?, update_icons, #
- # clear_icon_area #
- ###--------------------------------------------------------------------------###
- ###--------------------------------------------------------------------------###
- # Instructions: #
- # Place this script in the "Materials" section of the scripts above main. #
- # This script is plug and play and overwrites how states, buff, and debuffs #
- # are displayed. The only setting this script contains modifies the speed #
- # at which the states change and can be altered below. #
- ###--------------------------------------------------------------------------###
- ###--------------------------------------------------------------------------###
- # 说明: #
- # 可以让玩家处于多个状态时,依次滚动显示状态图标,请在下面设定滚动前等待的时间
- # #
- module CP # Do not #
- module SCROLL_STATES # change these. #
- # #
- ###----- -----###
- # 图标切换前等待的时间,单位是帧. #
- TRANS = 45 # 默认 = 45 #
- # #
- ###--------------------------------------------------------------------------###
- ###--------------------------------------------------------------------------###
- # The following lines are the actual core code of the script. While you are #
- # certainly invited to look, modifying it may result in undesirable results. #
- # Modify at your own risk! #
- ###--------------------------------------------------------------------------###
- end
- end
- $imported = {} if $imported == nil
- $imported["CP_SCROLLING_STATES"] = 1.1
- class Scroll_States ## This class holds the state icons for windows.
- attr_reader :x
- attr_reader :y
- attr_reader :width
- attr_reader :icons
- attr_accessor :bitmap
-
- def initialize(x, y, width, states, level = 0)
- @x = x ## Sets up required aspects of the states class.
- @y = y
- @width = width
- @states = states
- @bitmap = Bitmap.new([width, 1].max, 24)
- update_icons(level)
- end
-
- def change?(level) ## Determines if a refresh is required.
- return false if (@width / 24 >= @states.size)
- return true if (level % CP::SCROLL_STATES::TRANS == 0)
- return false
- end
-
- def update_icons(level)
- return @icons = [0] if @states.empty? ## Skip if no states.
- total = @width / 24
- return @icons = @states if total >= @states.size ## No refresh needed.
- start = (level / CP::SCROLL_STATES::TRANS) % @states.size
- double = @states + @states ## Doubles the states for overlap.
- top = [double.size, start + total].min
- @icons = []
- for i in start...top ## Create the shown states in order.
- @icons.push(double[i])
- end
- end
- end
- class Window_Base < Window
- alias cp_sswb_initialize initialize
- def initialize(x, y, width, height)
- cp_sswb_initialize(x, y, width, height)
- @icon_areas = {} ## Sets up an array for the states.
- @icon_scroll = false
- @icon_timer = 0
- end
-
- alias cp_sswb_update update
- def update
- cp_sswb_update
- unless @icon_areas.empty? ## Ignore if no states were drawn.
- @icon_timer += 1 ## A timer used by states.
- @icon_areas.each_value do |area|
- next unless area.change?(@icon_timer)
- draw_icons_area(area)
- end
- end
- end
-
- def draw_icons_area(area)
- contents.clear_rect(area.x, area.y, area.width, 24) ## Clears state area.
- contents.blt(area.x, area.y, area.bitmap, area.bitmap.rect)
- area.update_icons(@icon_timer) ## Updates the icons.
- area.icons.each_with_index {|n, i| draw_icon(n, area.x + 24 * i, area.y) }
- end
-
- def clear_all_icons ## Clears all icon spots for redraw.
- @icon_areas.each_key {|key| clear_icon_area(key)}
- @icon_areas = {} ## Resets the array.
- @icon_scroll = false ## Do not reset this frame.
- end
-
- def clear_icon_area(key)
- return if @icon_areas[key].nil?
- area = @icon_areas[key]
- contents.clear_rect(area.x, area.y, area.width, 24)
- contents.blt(area.x, area.y, area.bitmap, area.bitmap.rect)
- @icon_areas[key] = nil
- end
-
- def draw_actor_icons(actor, x, y, width = 96) ## Overwrite this method.
- icons = (actor.state_icons + actor.buff_icons)
- key = [x, y, width]
- clear_icon_area(key)
- temp = Scroll_States.new(x, y, width, icons) ## Creates an icon holder.
- @icon_areas[key] = temp
- rect = Rect.new(x, y, width, 24)
- @icon_areas[key].bitmap.blt(0, 0, contents, rect)
- draw_icons_area(@icon_areas[key]) ## Draw the newest set.
- end
- end
- ###--------------------------------------------------------------------------###
- # End of script. #
- ###--------------------------------------------------------------------------###
复制代码 |
|