赞 | 1 |
VIP | 0 |
好人卡 | 85 |
积分 | 1 |
经验 | 41098 |
最后登录 | 2015-3-17 |
在线时间 | 1071 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1071 小时
- 注册时间
- 2011-5-12
- 帖子
- 2317
|
变更角色位置的脚本我倒有- #==============================================================================
- # Row Changer
- #==============================================================================
- # Author : OriginalWij
- # Version : 1.3comp
- #==============================================================================
- #==============================================================================
- # To call: $scene = Scene_Row.new
- #==============================================================================
- #==============================================================================
- # Config
- #==============================================================================
- module ROW
- # Maximum party size (range = 4 to 8)
- ROW_SIZE = 8
- # Row text
- ROW_TEXT = '队形: '
- # Row title texts
- REAR_TEXT = '后排'
- MIDL_TEXT = '中心'
- FRNT_TEXT = '前线'
- # 'Row" text location in Scene_Status (X & Y)
- STATUS_X = 288
- STATUS_Y = 0
- # Row colors
- COLOR = [] # <== Do NOT Modify
- COLOR[0] = Color.new( 0, 255, 0) # Rear
- COLOR[1] = Color.new(255, 255, 0) # Middle
- COLOR[2] = Color.new(255, 0, 0) # Front
- # Background color
- BACK_COLOR = Color.new(0,0,0)
- # Border color
- BORDER_COLOR = Color.new(255,255,255)
- # Class title text
- CLASS = '职业:'
- # Row window back opacity
- OPACITY = 175
- end
- #==============================================================================
- # Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- alias rc_game_actor_initialize initialize unless $@
- def initialize(actor_id)
- rc_game_actor_initialize(actor_id)
- @row = self.class.position
- end
- #--------------------------------------------------------------------------
- # Get Row (New)
- #--------------------------------------------------------------------------
- def row
- return @row
- end
- #--------------------------------------------------------------------------
- # Set Row (New)
- #--------------------------------------------------------------------------
- def row=(new_row)
- @row = new_row
- end
- #--------------------------------------------------------------------------
- # Get Ease of Hitting (Overwrite)
- #--------------------------------------------------------------------------
- def odds
- return 8 - self.row * 3 # make rows more effective
- end
- end
- #==============================================================================
- # Window_Status
- #==============================================================================
- class Window_Status < Window_Base
- #--------------------------------------------------------------------------
- # Variables (Added)
- #--------------------------------------------------------------------------
- Row_Text = ROW::ROW_TEXT
- Row = []
- Row[0] = ROW::FRNT_TEXT
- Row[1] = ROW::MIDL_TEXT
- Row[2] = ROW::REAR_TEXT
- Row_X = ROW::STATUS_X
- Row_Y = ROW::STATUS_Y
- #--------------------------------------------------------------------------
- # Draw Basic Information (Mod)
- #--------------------------------------------------------------------------
- alias rc_window_status_draw_basic_info draw_basic_info unless $@
- def draw_basic_info(x, y)
- rw = self.contents.text_size(Row_Text).width
- self.contents.font.color = system_color
- self.contents.draw_text(Row_X, Row_Y, 100, WLH, Row_Text)
- self.contents.font.color = ROW::COLOR[2 - @actor.row]
- self.contents.draw_text(Row_X + rw, Row_Y, 100, WLH, Row[@actor.row])
- self.contents.font.color = normal_color
- rc_window_status_draw_basic_info(x, y)
- end
- end
- #==============================================================================
- # Row_Window (New)
- #==============================================================================
- class Row_Window < Window_Base
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, Graphics.width, 160) # res
- self.back_opacity = ROW::OPACITY
- @horiz_size = $game_party.members.size - 1
- @max_size = ROW::ROW_SIZE - 1
- @max_size = 3 if @max_size < 3
- @max_size = 7 if @max_size > 7
- @offset = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
- @offset += 21 if @max_size % 2 == 0
- refresh
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- super
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- x1 = (7 - @max_size) * 18
- x2 = Graphics.width - 122 - (7 - @max_size) * 18 # res
- self.contents.draw_text(x1, 8, 90, WLH, ROW::REAR_TEXT, 1)
- self.contents.draw_text(x1, 50, 90, WLH, ROW::MIDL_TEXT, 1)
- self.contents.draw_text(x1, 92, 90, WLH, ROW::FRNT_TEXT, 1)
- self.contents.draw_text(x2, 8, 90, WLH, ROW::REAR_TEXT, 1)
- self.contents.draw_text(x2, 50, 90, WLH, ROW::MIDL_TEXT, 1)
- self.contents.draw_text(x2, 92, 90, WLH, ROW::FRNT_TEXT, 1)
- for x in 0..@horiz_size
- for y in 0..2
- @x = x * 42 + @offset
- @y = y * 42
- self.contents.fill_rect(@x, @y, 40, 40, ROW::COLOR[y])
- self.contents.fill_rect(@x + 2, @y + 2, 36, 36, ROW::BACK_COLOR)
- end
- end
- if (@max_size - @horiz_size) > 0
- fill = @horiz_size + 1
- for x in fill..@max_size
- for y in 0..2
- @x = x * 42 + @offset
- @y = y * 42
- self.contents.fill_rect(@x, @y, 40, 40, Color.new(128,128,128))
- self.contents.fill_rect(@x + 2, @y + 2, 36, 36, ROW::BACK_COLOR)
- end
- end
- end
- for x in 0..@horiz_size
- actor = $game_party.members[x]
- a_pos = actor.row
- draw_actor_graphic(actor, x * 42 + 20 + @offset, (2 - a_pos) * 42 + 36)
- end
- end
- end
- #==============================================================================
- # Row_Status (New)
- #==============================================================================
- class Row_Status < Window_Base
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 160, Graphics.width, Graphics.height - 160) # res
- @actor = actor
- self.back_opacity = ROW::OPACITY
- refresh
- end
- #--------------------------------------------------------------------------
- # New Actor
- #--------------------------------------------------------------------------
- def new_actor=(actor)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- self.contents.font.color = system_color
- self.contents.draw_text(160, 0, 60, WLH, ROW::CLASS)
- self.contents.font.color = normal_color
- draw_actor_class(@actor, 188, 0)
- draw_actor_face(@actor, 6, 40)
- draw_actor_graphic(@actor, 56, 200)
- draw_basic_info(160, 32)
- draw_equipments(160, 104)
- draw_parameters(self.contents.width - 208, 0) # res
- end
- #--------------------------------------------------------------------------
- # Draw Basic Information
- #--------------------------------------------------------------------------
- def draw_basic_info(x, y)
- draw_actor_level(@actor, x, y - 4)
- draw_actor_state(@actor, x, y + WLH)
- draw_actor_hp(@actor, x, y + WLH)
- draw_actor_mp(@actor, x, y + WLH * 2)
- end
- #--------------------------------------------------------------------------
- # Draw Parameters
- #--------------------------------------------------------------------------
- def draw_parameters(x, y)
- for i in 0..10
- draw_actor_parameter(@actor, x, y + 26 * i,i )
- end
- end
- #--------------------------------------------------------------------------
- # Draw Experience Information
- #--------------------------------------------------------------------------
- def draw_exp_info(x, y)
- s1 = @actor.exp_s
- s2 = @actor.next_rest_exp_s
- s_next = sprintf(Vocab::ExpNext, Vocab::level)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 180, WLH, Vocab::ExpTotal)
- self.contents.draw_text(x, y + 40, 180, WLH, s_next)
- self.contents.font.color = normal_color
- self.contents.draw_text(x, y + 20, 180, WLH, s1, 2)
- self.contents.draw_text(x, y + 60, 180, WLH, s2, 2)
- end
- #--------------------------------------------------------------------------
- # Draw equipments
- #--------------------------------------------------------------------------
- def draw_equipments(x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
- self.contents.font.color = normal_color
- self.contents.font.size = 16
- item_number = @actor.equips.size
- item_number.times { |i|
- if [email protected][i]
- if i ==1 and @actor.two_hands_legal?
- draw_item_name(@actor.equips[i - 1], x , y + WLH * (i + 1), false)
- else
- text = "- EMPTY -"
- self.contents.draw_text(x + 24, y + WLH * (i + 1), 120, WLH, text)
- end
- else
- draw_item_name(@actor.equips[i], x , y + WLH * (i + 1))
- end}
- self.contents.font.size = Font.default_size
- end
- end
- #==============================================================================
- # Row_Cursor_Window (New)
- #==============================================================================
- class Row_Cursor_Window < Window_Selectable
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- @max_size = ROW::ROW_SIZE - 1
- @max_size = 3 if @max_size < 3
- @max_size = 7 if @max_size > 7
- x = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
- x += 21 if @max_size % 2 == 0
- super(x, 0, 80, 160)
- @column_max = 1
- @item_max = 3
- self.index = 0
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # Update Cursor
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0 # No cursor
- self.cursor_rect.empty
- elsif @index < @item_max # Normal
- self.cursor_rect.set(0, @index * 42, 40, 40)
- elsif @index >= 100 # Self
- self.cursor_rect.set(0, (@index - 100) * 42, 40, 40)
- else # All
- self.cursor_rect.set(0, 0, 40, @item_max * 40)
- end
- end
- end
- #==============================================================================
- # Column_Cursor_Window (New)
- #==============================================================================
- class Column_Cursor_Window < Window_Selectable
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- @max_size = ROW::ROW_SIZE - 1
- @max_size = 3 if @max_size < 3
- @max_size = 7 if @max_size > 7
- x = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
- x += 21 if @max_size % 2 == 0
- super(x, 0, $game_party.members.size * 42 + 32, 160, 2)
- @column_max = $game_party.members.size
- @item_max = $game_party.members.size
- self.index = 0
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # Update Cursor
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0 # No cursor
- self.cursor_rect.empty
- elsif @index < @item_max # Normal
- self.cursor_rect.set(@index * 42, 0, 40, 124)
- elsif @index >= 100 # Self
- self.cursor_rect.set((@index - 100) * 42, 0, 40, 124)
- else # All
- self.cursor_rect.set(0, 0, 40, @item_max * 124)
- end
- end
- end
-
- #==============================================================================
- # Scene_Row (New)
- #==============================================================================
- class Scene_Row < Scene_Base
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- @horiz_size = $game_party.members.size - 1
- @max_size = ROW::ROW_SIZE - 1
- @max_size = 3 if @max_size < 3
- @max_size = 7 if @max_size > 7
- @x = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
- @x += 21 if @max_size % 2 == 0
- end
- #--------------------------------------------------------------------------
- # Start
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @row_window = Row_Window.new
- @row_status = Row_Status.new($game_party.members[0])
- @row_cursor_window = Row_Cursor_Window.new
- @column_cursor_window = Column_Cursor_Window.new
- @row_cursor_window.visible = false
- @row_cursor_window.active = false
- @column_cursor_window.active = true
- end
- #--------------------------------------------------------------------------
- # Terminate
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @column_cursor_window.dispose
- @row_cursor_window.dispose
- @row_window.dispose
- @row_status.dispose
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @row_window.update
- @row_status.update
- @column_cursor_window.update
- @row_cursor_window.update
- if @column_cursor_window.active
- update_column_selection
- elsif @row_cursor_window.active
- update_row_selection
- end
- end
- #--------------------------------------------------------------------------
- # Update Column Selection
- #--------------------------------------------------------------------------
- def update_column_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Menu.new(4)
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- @actor_selected = $game_party.members[@column_cursor_window.index].id
- @row_cursor_window.x = @x + @column_cursor_window.index * 42
- ga_pos = $game_actors[@actor_selected].row
- @row_cursor_window.index = (2 - ga_pos)
- @column_cursor_window.active = @column_cursor_window.visible = false
- @row_cursor_window.active = @row_cursor_window.visible = true
- @row_status.new_actor = $game_party.members[@column_cursor_window.index]
- elsif Input.repeat?(Input::LEFT) or Input.repeat?(Input::RIGHT)
- @row_status.new_actor = $game_party.members[@column_cursor_window.index]
- end
- end
- #--------------------------------------------------------------------------
- # Update Row Selection
- #--------------------------------------------------------------------------
- def update_row_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @row_cursor_window.active = @row_cursor_window.visible = false
- @column_cursor_window.active = @column_cursor_window.visible = true
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- rcw_i = @row_cursor_window.index
- $game_actors[@actor_selected].row = (2 - rcw_i)
- @row_window.refresh
- @row_cursor_window.active = @row_cursor_window.visible = false
- @column_cursor_window.active = @column_cursor_window.visible = true
- @row_status.new_actor = $game_party.members[@column_cursor_window.index]
- end
- end
- end
复制代码 配合这个再修改横版脚本里
class Game_Actor < Game_Battler的def base_position为- def base_position
- base = N01::ACTOR_POSITION[self.index]
- @base_position_x = base[0] + self.row * 24
- @base_position_y = base[1]
- # バックアタック時はX軸を逆に
- @base_position_x = Graphics.width - base[0] if $back_attack && N01::BACK_ATTACK
- end
复制代码 这就行了~ |
|