赞 | 0 |
VIP | 10 |
好人卡 | 25 |
积分 | 1 |
经验 | 13460 |
最后登录 | 2016-3-31 |
在线时间 | 251 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 251 小时
- 注册时间
- 2009-11-13
- 帖子
- 453
|
我只想到一种方法,搜一个全键盘脚本,
在事件里并行处理。
条件分歧,当按下tab键时。
条件分歧,当角色 xxxx在队伍中时
条件分歧,当角色 xxxx2在队伍中时
跟换角色xxxx行走图
大概就是这个样子了,就是不停的判定,因为烦所以建议用公共事件做
因为是队伍第一人的行走图,所以我这只是换汤不换药而已。脚本我还写不出来。
不过我有一个是在菜单里跟换队伍顺序的脚本
我都不知道从哪里弄来的了。- class Window_Change_Turn_Left < Window_Selectable
- attr_accessor :now_group
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(30, 20, 152, 440)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.z += 10
- self.contents.font.size = 20
- self.index = 0
-
- @now_group = []
- for i in 0..$game_party.actors.size-1
- @now_group.push($game_party.actors[i])
- end
- @item_max = @now_group.size
-
- refresh
- end
-
- def delete_actor(actor)
- @now_group.delete(actor)
- @item_max = @now_group.size
- refresh
- end
-
- def set_actor(actor)
- # @now_group.clear
- @now_group.push(actor)
- @item_max = @now_group.size
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0..@now_group.size-1
- x = 4
- y = 4 + i * 102
- actor = @now_group[i]
- draw_actor_name(actor, x+32, y)
- draw_actor_graphic(actor, x+12, y+48)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- self.cursor_rect.set(0, @index*102, 120, 102)
- end
- end
- class Window_Change_Turn_Right < Window_Selectable
- attr_accessor :actor_group
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(232, 20, 152, 440)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.z += 10
- self.contents.font.size = 20
- @actor_group = []
- self.index = 0
- refresh
- end
- # 设置角色
- def set_actor(actor)
- @actor_group.push(actor)
- refresh
- end
-
- def delete_actor(actor)
- @actor_group.delete(actor)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.clear
- end
-
- if @actor_group.size == $game_party.actors.size
- for i in 0..$game_party.actors.size-1
- $game_party.actors[i] = @actor_group[i]
- end
- $game_player.refresh
- end
-
- if @actor_group.size != 0
- for i in 0..@actor_group.size-1
- x = 4
- y = 4 + i * 102
- actor = @actor_group[i]
- draw_actor_name(actor, x+32, y)
- draw_actor_graphic(actor, x+12, y+48)
- end
- end
-
- end
- def update_cursor_rect
- self.cursor_rect.empty
- end
-
- end
- class Scene_Change_Turn
- def main
- #cmd = Window_Command.new#($game_party.actors.size)
- #cmd.index = 5
- #cmd.active = false
- @change_turn_left_window = Window_Change_Turn_Left.new
- @change_turn_left_window.x = -152
- # 获取角色
- @change_turn_actor = @change_turn_left_window.now_group[@change_turn_left_window.index]
- @change_turn_right_window = Window_Change_Turn_Right.new
- @change_turn_right_window.x = -152
-
- Graphics.transition
- # 窗口滑动
- for i in 1..8
- @change_turn_left_window.x += 22
- @change_turn_right_window.x += 48
- if i==8
- @change_turn_left_window.x = 30
- @change_turn_right_window.x = 232
- end
- Graphics.update
- end
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update_change_turn_scene
- # 如果画面被切换的话就中断循环
- if $scene != self
- break
- end
- end
-
- if @fangx == 1
- for i in 1..9
- @change_turn_left_window.x += 76
- @change_turn_right_window.x += 51
- Graphics.update
- end
- else
- for i in 1..9
- @change_turn_left_window.x -= 22
- @change_turn_right_window.x -= 48
- Graphics.update
- end
- end
- Graphics.transition
- # cmd.dispose
- @change_turn_left_window.dispose
- @change_turn_right_window.dispose
- end
-
- def update_change_turn_scene
- @change_turn_left_window.update
- if @change_turn_actor != @change_turn_left_window.now_group[@change_turn_left_window.index]
- @change_turn_actor = @change_turn_left_window.now_group[@change_turn_left_window.index]
- end
-
- if @change_turn_left_window.active
- change_turn_update_actor_window
- return
- end
- end
-
- def change_turn_update_actor_window
- if @change_turn_left_window.now_group.size == 0
- for i in 1..20
- Graphics.update
- end
- @fangx = 1
- $scene = Scene_Menu.new(5)
- return
- end
-
- if Input.trigger?(Input::B)
- if @change_turn_left_window.now_group.size == $game_party.actors.size
- $game_system.se_play($data_system.cancel_se)
- $scene = Scene_Menu.new(5)
- return
- else
- n = $game_party.actors.size-@change_turn_left_window.now_group.size
- $game_system.se_play($data_system.cancel_se)
- k = @change_turn_right_window.actor_group[@change_turn_right_window.actor_group.size-1]
- @change_turn_right_window.delete_actor(k)
- @change_turn_left_window.set_actor(k)
- end
- end
-
- if Input.trigger?(Input::C)
- if @change_turn_left_window.now_group.size == $game_party.actors.size
- if @change_turn_actor.hp == 0
- # 演奏无效 SE
- $game_system.se_play($data_system.buzzer_se)
- else
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- @change_turn_right_window.set_actor(@change_turn_actor)
- @change_turn_left_window.delete_actor(@change_turn_actor)
- if @change_turn_left_window.now_group.size == @change_turn_left_window.index and
- @change_turn_left_window.now_group.size != 0
- @change_turn_left_window.index -= 1
- end
- end
- else
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- @change_turn_right_window.set_actor(@change_turn_actor)
- @change_turn_left_window.delete_actor(@change_turn_actor)
- if @change_turn_left_window.now_group.size == @change_turn_left_window.index and
- @change_turn_left_window.now_group.size != 0
- @change_turn_left_window.index -= 1
- end
- end
- return
- end
-
- end
-
- end
复制代码 |
评分
-
查看全部评分
|