赞 4
VIP 0
好人卡 73
积分 6
经验 41391
最后登录 2018-4-23
在线时间 830 小时
Lv2.观梦者
梦石 0
星屑 644
在线时间 830 小时
注册时间 2016-7-24
帖子 649
完成
因為一時找不到輪流播放狀態圖標的插件,所以簡單的寫了一個
預設為當擁有複數狀態時每2秒改變一次狀態圖標,如果需要調整的話可以改一下17行的數字
因為空間有限,所以名字有四個字的話會超出來,不過除了金環三節之外想不到其他人有四個字了,我只有玩過三國O雙不是很理解!
class Scene_Battle < Scene_Base
def start
super
create_spriteset
create_all_windows
BattleManager.method_wait_for_message = method( :wait_for_message )
@icon_rotate = 0
end
def update_basic
super
$game_timer .update
$game_troop .update
@spriteset .update
update_info_viewport
update_message_open
@icon_rotate += 1
if @icon_rotate > 120
$game_party .alive_members .each { |i| i.sort_states }
@status_window .refresh
@icon_rotate = 0
end
end
def update_info_viewport
move_info_viewport( 0 ) if @party_command_window .active
move_info_viewport( 0 ) if @actor_command_window .active
move_info_viewport( 0 ) if BattleManager.in_turn ?
end
def create_party_command_window
@party_command_window = Window_PartyCommand.new
@party_command_window .y = @info_viewport .rect .y - @party_command_window .height
@party_command_window .set_handler ( :fight , method( :command_fight ) )
@party_command_window .set_handler ( :escape , method( :command_escape ) )
@party_command_window .unselect
end
def create_status_window
@status_window = Window_BattleStatus.new
end
def create_actor_command_window
@actor_command_window = Window_ActorCommand.new
@actor_command_window .y = @info_viewport .rect .y - @actor_command_window .height
@actor_command_window .x = Graphics.width - @actor_command_window .width
@actor_command_window .set_handler ( :attack , method( :command_attack ) )
@actor_command_window .set_handler ( :skill , method( :command_skill ) )
@actor_command_window .set_handler ( :guard , method( :command_guard ) )
@actor_command_window .set_handler ( :item , method( :command_item ) )
@actor_command_window .set_handler ( :cancel , method( :prior_command ) )
end
end
class Window_BattleEnemy < Window_Selectable
def initialize( info_viewport)
super ( 0 , info_viewport.rect .y , window_width, fitting_height( 6 ) )
refresh
self .visible = false
@info_viewport = info_viewport
end
def window_width
Graphics.width
end
end
class Window_PartyCommand < Window_Command
def window_width
return 100
end
def visible_line_number
return 3
end
def alignment
return 1
end
end
class Window_BattleStatus < Window_Selectable
def window_width
Graphics.width
end
def col_max
return 2
end
def draw_actor_icons( actor, x, y, width = 96 )
icons = ( actor.state_icons + actor.buff_icons ) [ 0 , width / 24 ]
icons.each_with_index { |n, i| draw_icon( n, x + 24 * i, y) }
end
def draw_basic_area( rect, actor)
draw_actor_name( actor, rect.x - 7 , rect.y , 100 )
draw_actor_icons( actor, rect.x + 59 , rect.y , 24 )
end
def spacing
return 4
end
def draw_actor_hp( actor, x, y, width = 124 )
draw_gauge( x+60 , y, width-15 , actor.hp_rate , hp_gauge_color1, hp_gauge_color2)
change_color( system_color)
draw_text( x+55 , y, 30 , line_height, Vocab::hp_a)
draw_current_and_max_values( x+45 , y, width, actor.hp , actor.mhp ,
hp_color( actor) , normal_color)
end
def draw_actor_mp( actor, x, y, width = 124 )
draw_gauge( x+42 , y, width-15 , actor.mp_rate , mp_gauge_color1, mp_gauge_color2)
change_color( system_color)
draw_text( x+38 , y, 30 , line_height, Vocab::mp_a)
draw_current_and_max_values( x+25 , y, width, actor.mp , actor.mmp ,
mp_color( actor) , normal_color)
end
def draw_actor_tp( actor, x, y, width = 124 )
draw_gauge( x+25 , y, width-20 , actor.tp_rate , tp_gauge_color1, tp_gauge_color2)
change_color( system_color)
draw_text( x+20 , y, 30 , line_height, Vocab::tp_a)
change_color( tp_color( actor) )
draw_text( x + width - 37 , y, 42 , line_height, actor.tp .to_i , 2 )
end
end
class Game_Actor < Game_Battler
def sort_states
@states = @states .rotate !( 1 )
end
end
class Scene_Battle < Scene_Base
def start
super
create_spriteset
create_all_windows
BattleManager.method_wait_for_message = method( :wait_for_message )
@icon_rotate = 0
end
def update_basic
super
$game_timer .update
$game_troop .update
@spriteset .update
update_info_viewport
update_message_open
@icon_rotate += 1
if @icon_rotate > 120
$game_party .alive_members .each { |i| i.sort_states }
@status_window .refresh
@icon_rotate = 0
end
end
def update_info_viewport
move_info_viewport( 0 ) if @party_command_window .active
move_info_viewport( 0 ) if @actor_command_window .active
move_info_viewport( 0 ) if BattleManager.in_turn ?
end
def create_party_command_window
@party_command_window = Window_PartyCommand.new
@party_command_window .y = @info_viewport .rect .y - @party_command_window .height
@party_command_window .set_handler ( :fight , method( :command_fight ) )
@party_command_window .set_handler ( :escape , method( :command_escape ) )
@party_command_window .unselect
end
def create_status_window
@status_window = Window_BattleStatus.new
end
def create_actor_command_window
@actor_command_window = Window_ActorCommand.new
@actor_command_window .y = @info_viewport .rect .y - @actor_command_window .height
@actor_command_window .x = Graphics.width - @actor_command_window .width
@actor_command_window .set_handler ( :attack , method( :command_attack ) )
@actor_command_window .set_handler ( :skill , method( :command_skill ) )
@actor_command_window .set_handler ( :guard , method( :command_guard ) )
@actor_command_window .set_handler ( :item , method( :command_item ) )
@actor_command_window .set_handler ( :cancel , method( :prior_command ) )
end
end
class Window_BattleEnemy < Window_Selectable
def initialize( info_viewport)
super ( 0 , info_viewport.rect .y , window_width, fitting_height( 6 ) )
refresh
self .visible = false
@info_viewport = info_viewport
end
def window_width
Graphics.width
end
end
class Window_PartyCommand < Window_Command
def window_width
return 100
end
def visible_line_number
return 3
end
def alignment
return 1
end
end
class Window_BattleStatus < Window_Selectable
def window_width
Graphics.width
end
def col_max
return 2
end
def draw_actor_icons( actor, x, y, width = 96 )
icons = ( actor.state_icons + actor.buff_icons ) [ 0 , width / 24 ]
icons.each_with_index { |n, i| draw_icon( n, x + 24 * i, y) }
end
def draw_basic_area( rect, actor)
draw_actor_name( actor, rect.x - 7 , rect.y , 100 )
draw_actor_icons( actor, rect.x + 59 , rect.y , 24 )
end
def spacing
return 4
end
def draw_actor_hp( actor, x, y, width = 124 )
draw_gauge( x+60 , y, width-15 , actor.hp_rate , hp_gauge_color1, hp_gauge_color2)
change_color( system_color)
draw_text( x+55 , y, 30 , line_height, Vocab::hp_a)
draw_current_and_max_values( x+45 , y, width, actor.hp , actor.mhp ,
hp_color( actor) , normal_color)
end
def draw_actor_mp( actor, x, y, width = 124 )
draw_gauge( x+42 , y, width-15 , actor.mp_rate , mp_gauge_color1, mp_gauge_color2)
change_color( system_color)
draw_text( x+38 , y, 30 , line_height, Vocab::mp_a)
draw_current_and_max_values( x+25 , y, width, actor.mp , actor.mmp ,
mp_color( actor) , normal_color)
end
def draw_actor_tp( actor, x, y, width = 124 )
draw_gauge( x+25 , y, width-20 , actor.tp_rate , tp_gauge_color1, tp_gauge_color2)
change_color( system_color)
draw_text( x+20 , y, 30 , line_height, Vocab::tp_a)
change_color( tp_color( actor) )
draw_text( x + width - 37 , y, 42 , line_height, actor.tp .to_i , 2 )
end
end
class Game_Actor < Game_Battler
def sort_states
@states = @states .rotate !( 1 )
end
end