赞 | 5 |
VIP | 620 |
好人卡 | 38 |
积分 | 69 |
经验 | 125468 |
最后登录 | 2015-7-27 |
在线时间 | 1666 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6855
- 在线时间
- 1666 小时
- 注册时间
- 2008-10-29
- 帖子
- 6710
|
大概的做了一下...
- class Game_Battler
- attr_accessor :add_x
- alias hzhj_old_ini initialize
- def initialize
- hzhj_old_ini
- @add_x = 0
- end
- end
- class Sprite_Battler < RPG::Sprite
- MoveSpeed = 8
- alias hzhj_old_initialize initialize
- def initialize(viewport, battler = nil)
- hzhj_old_initialize(viewport, battler)
- if not @battler.nil?
- self.x = @battler.screen_x
- end
- @hzhj_x = self.x
- end
- def battler=(value)
- if @battler != value and value != nil
- self.x = value.screen_x
- end
- @hzhj_x = self.x
- @battler = value
- end
- alias hzhj_old_update update
- def update
- hzhj_old_update
- self.x = @hzhj_x
- if not @battler.nil? and not @battler.dead?
- if self.x < @battler.screen_x + @battler.add_x
- self.x = [self.x + MoveSpeed, @battler.screen_x + @battler.add_x].min
- elsif self.x > @battler.screen_x + @battler.add_x
- self.x = [self.x - MoveSpeed, @battler.screen_x + @battler.add_x].max
- end
- end
- @hzhj_x = self.x
- end
- def x
- if @effect_hzhj
- if @battler.nil?
- return super
- else
- return @battler.screen_x
- end
- else
- return super
- end
- end
- def update_animation
- @effect_hzhj = true
- super
- @effect_hzhj = false
- end
- def animation(*args)
- @effect_hzhj = true
- super(*args)
- @effect_hzhj = false
- end
- def update_damage
- @effect_hzhj = true
- super
- @effect_hzhj = false
- end
- def damage(*args)
- @effect_hzhj = true
- super(*args)
- @effect_hzhj = false
- end
- end
- class Scene_Battle
- alias hzhj_old_update_phase4_step4 update_phase4_step4
- def update_phase4_step4
- hzhj_old_update_phase4_step4
- for target in @target_battlers
- next if target.dead?
- next if target.damage != "Miss"
- if target.is_a?(Game_Actor)
- target.add_x = -64
- elsif target.is_a?(Game_Enemy)
- target.add_x = 64
- end
- end
- end
- alias hzhj_old_update_phase4_step5 update_phase4_step5
- def update_phase4_step5
- hzhj_old_update_phase4_step5
- for target in @target_battlers
- target.add_x = 0
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|