赞 | 2 |
VIP | 7 |
好人卡 | 5 |
积分 | 1 |
经验 | 17660 |
最后登录 | 2015-2-9 |
在线时间 | 461 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 461 小时
- 注册时间
- 2010-6-28
- 帖子
- 467
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- *#==============================================================================
- # +++ MOG - Simple Movement System (v1.2) +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com
- #==============================================================================
- # Sistema simples de movimento na diagonal e dash.
- #==============================================================================
- # Sprite Dash (Opcional)
- #==============================================================================
- # Nomei o sprite do personagem da seguinte forma.
- #
- # Character Name + _Dash.png
- #
- # EX
- #
- # Aluxes_Dash.png
- #
- #==============================================================================
- #===============================================================================
- # ■ Histórico (Version History)
- #===============================================================================
- # v1.1 Corrigido o bug de não verificar o nome do personagem ao adiciona-lo ou
- # remove-lo.
- #===============================================================================
- module MOG_SIMPLE_MOVEMENT_SYSTEM
- #Definição do botão de correr.
- DASH_BUTTON = Input::A
- #Definição da velocidade normal
- NORMAL_SPEED = 3.8
- #Definição da velocidade do dash
- DASH_SPEED = 4.8
- end
- #===============================================================================
- # ■ Character
- #===============================================================================
- class Game_Character < Game_CharacterBase
- include MOG_SIMPLE_MOVEMENT_SYSTEM
- attr_accessor :dash_sprite
- #--------------------------------------------------------------------------
- # ● Dash Sprite
- #--------------------------------------------------------------------------
- alias mog_character_dash_sprite_initialize initialize
- def initialize
- @dash_sprite = [false,false,nil]
- mog_character_dash_sprite_initialize
- end
- #--------------------------------------------------------------------------
- # ● Check Dash Sprite
- #--------------------------------------------------------------------------
- def check_dash_sprite
- return if @dash_sprite[0]
- @dash_sprite[0] = true
- @dash_sprite[1] = true if RPG_FileTest.character_exist?(@character_name + "_Dash")
- @dash_sprite[4] = @character_name + "_Dash" if @dash_sprite[1]
- end
- #--------------------------------------------------------------------------
- # ● Check RealName
- #--------------------------------------------------------------------------
- def check_real_name
- return if @dash_sprite[3] != nil
- return if @character_name == ""
- @dash_sprite[3] = @character_name
- end
- #--------------------------------------------------------------------------
- # ● Reset Dash Parameter
- #--------------------------------------------------------------------------
- def reset_dash_parameter
- @dash_sprite = [false,false,nil]
- check_dash_sprite
- check_real_name
- end
- #--------------------------------------------------------------------------
- # ● Update Dash Sprite Name
- #--------------------------------------------------------------------------
- def update_dash_sprite_name(original_name = true)
- if $schala_battle_system
- return if $game_temp.battle_phase[0]
- return if self.battler != nil and self.battler.dead?
- end
- return if !@dash_sprite[1]
- if original_name
- @character_name = @dash_sprite[3]
- else
- @character_name = @dash_sprite[4]
- end
- end
- end
- #===============================================================================
- # ■ Game_CharacterBase
- #===============================================================================
- class Game_CharacterBase
- #--------------------------------------------------------------------------
- # ● Set Graphic
- #--------------------------------------------------------------------------
- alias mog_simple_movement_set_graphic set_graphic
- def set_graphic(character_name, character_index)
- mog_simple_movement_set_graphic(character_name, character_index)
- reset_dash_sprite_name if self.is_a?(Game_Player) or self.is_a?(Game_Follower)
- end
- #--------------------------------------------------------------------------
- # ● Rest Dash Sprite
- #--------------------------------------------------------------------------
- def reset_dash_sprite_name
- self.reset_dash_parameter
- end
- end
- #==============================================================================
- # ■ Game Party
- #==============================================================================
- class Game_Party < Game_Unit
- #--------------------------------------------------------------------------
- # ● Swap Order
- #--------------------------------------------------------------------------
- alias mog_simple_movement_swap_order swap_order
- def swap_order(index1, index2)
- mog_simple_movement_swap_order(index1, index2)
- $game_player.reset_dash_parameter
- for f in $game_player.followers
- f.reset_dash_parameter
- end
- $game_player.refresh
- end
- #--------------------------------------------------------------------------
- # ● Reset Party Name
- #--------------------------------------------------------------------------
- def reset_party_dash_name
- $game_player.reset_dash_parameter
- for i in $game_player.followers
- i.reset_dash_parameter
- end
- end
- #--------------------------------------------------------------------------
- # ● Add Actor
- #--------------------------------------------------------------------------
- alias mog_simple_movement_add_actor add_actor
- def add_actor(actor_id)
- mog_simple_movement_add_actor(actor_id)
- reset_party_dash_name
- end
- #--------------------------------------------------------------------------
- # ● Remove Actor
- #--------------------------------------------------------------------------
- alias mog_simple_movement_remove_actor remove_actor
- def remove_actor(actor_id)
- mog_simple_movement_remove_actor(actor_id)
- reset_party_dash_name
- end
- #--------------------------------------------------------------------------
- # ● Change Leader
- #--------------------------------------------------------------------------
- alias mog_simple_movement_change_leader change_leader
- def change_leader
- mog_simple_movement_change_leader
- reset_party_dash_name
- end
- #--------------------------------------------------------------------------
- # ● Refresh Leader
- #--------------------------------------------------------------------------
- alias mog_simple_movement_refresh_leader refresh_leader
- def refresh_leader
- mog_simple_movement_refresh_leader
- reset_party_dash_name
- end
- end
- #==============================================================================
- # ■ Game Interpreter
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # ● Command 322
- #--------------------------------------------------------------------------
- alias mog_simple_movement_system_command_322 command_322
- def command_322
- mog_simple_movement_system_command_322
- actor = $game_actors[@params[0]]
- if @params[0] == 1
- $game_player.reset_dash_parameter rescue nil
- else
- f_id = @params[0] - 2
- $game_player.followers[f_id].reset_dash_parameter rescue nil
- end
- $game_player.refresh
- end
- end
- #==============================================================================
- # ■ Game_Player
- #==============================================================================
- class Game_Player < Game_Character
- attr_accessor :dash
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_dash_sprite_player_initialize initialize
- def initialize
- [url=home.php?mod=space&uid=81012]@Dash[/url] = false
- mog_dash_sprite_player_initialize
- end
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- alias mog_dash_sprite_refresh refresh
- def refresh
- mog_dash_sprite_refresh
- check_dash_sprite
- check_real_name
- end
- #--------------------------------------------------------------------------
- # ● Dash?
- #--------------------------------------------------------------------------
- alias mog_simple_movement_dash dash?
- def dash?
- return false
- mog_simple_movement_dash
- end
- #--------------------------------------------------------------------------
- # ● Can Dash?
- #--------------------------------------------------------------------------
- def can_dash?
- return true if Input.press?(DASH_BUTTON)
- return false
- end
- #--------------------------------------------------------------------------
- # ● Update Dash Command
- #--------------------------------------------------------------------------
- def update_dash_button
- @dash = false
- @move_speed = NORMAL_SPEED
- update_dash_sprite_name(true)
- return unless can_dash?
- @dash = true
- update_dash_sprite_name(false)
- @move_speed = DASH_SPEED
- @anime_count -= 0.5 if moving?
- end
- #--------------------------------------------------------------------------
- # ● Move By Input
- #--------------------------------------------------------------------------
- def move_by_input
- return unless can_move_by_input_dash?
- update_dash_button
- case Input.dir8
- when 2,4,6,8; move_straight(Input.dir4)
- when 1; execute_input_move_diagonal(4,2)
- when 3; execute_input_move_diagonal(6,2)
- when 7; execute_input_move_diagonal(4,8)
- when 9; execute_input_move_diagonal(6,8)
- end
- end
- #--------------------------------------------------------------------------
- # ● Can Move By Input Dash
- #--------------------------------------------------------------------------
- def can_move_by_input_dash?
- return false if !movable?
- return false if self.action != nil
- return false if @stop
- return false if $game_map.interpreter.running?
- return true
- end
- #--------------------------------------------------------------------------
- # ● Execute Input Move Diagonal
- #--------------------------------------------------------------------------
- def execute_input_move_diagonal(x,y)
- move_diagonal(x, y)
- return if moving?
- move_straight(x)
- move_straight(y)
- end
- end
- #===============================================================================
- # ■ RPG_FileTest
- #===============================================================================
- module RPG_FileTest
- #--------------------------------------------------------------------------
- # ● RPG_FileTest.character_exist?
- #--------------------------------------------------------------------------
- def RPG_FileTest.character_exist?(filename)
- return Cache.character(filename) rescue return false
- end
- end
- #===============================================================================
- # ■ Game Follower
- #===============================================================================
- class Game_Follower < Game_Character
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- alias mog_dash_sprite_follower_refresh refresh
- def refresh
- mog_dash_sprite_follower_refresh
- check_dash_sprite
- check_real_name
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- alias mog_dash_sprite_follower_update update
- def update
- mog_dash_sprite_follower_update
- if $game_player.dash
- update_dash_sprite_name(false)
- else
- update_dash_sprite_name(true)
- end
- end
- end
- $mog_rgss3_simple_movement_system = true
复制代码- #==============================================================================
- # ■ 弹性滚动地图 V 1.00 BY SLICK
- #------------------------------------------------------------------------------
- # 处理主角的类。事件启动的判定、以及地图的滚动等功能。
- # 本类的实例请参考 $game_player。
- # 我:。。。这个黄金版已经被改的面目全非了
- #==============================================================================
- class Game_Player < Game_Character
- MOVESPEA = 0.265625#这数值。。。囧
- def update_scroll(last_real_x, last_real_y)
- ax1 = $game_map.adjust_x(last_real_x)
- ay1 = $game_map.adjust_y(last_real_y)
- ax2 = $game_map.adjust_x(@real_x)
- ay2 = $game_map.adjust_y(@real_y)
- movespeb = (2 ** (@move_speed+1))*MOVESPEA
- movesped = movespeb / Graphics.width
- movespec = movespeb / Graphics.height
- tmp=center_x-ax2
- $game_map.scroll_left(movesped*tmp) if tmp>0
- $game_map.scroll_right(-movesped*tmp) if tmp<0
- tmp=center_y-ay2
- $game_map.scroll_up(movespec*tmp) if tmp>0
- $game_map.scroll_down(-movespec*tmp) if tmp<0
- end
- end
复制代码 已经找到原因,以上两个插件脚本都会导致单体动画播放时。动画逐渐下移......
除了不使用外,有什么办法能解决呢?或者找到出错的原因也好......
|
|