赞 | 6 |
VIP | 22 |
好人卡 | 15 |
积分 | 13 |
经验 | 97563 |
最后登录 | 2022-11-26 |
在线时间 | 831 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1323
- 在线时间
- 831 小时
- 注册时间
- 2007-12-25
- 帖子
- 1558
|
本帖最后由 九夜神尊 于 2011-1-14 12:22 编辑
其实我这里有相应脚本,只不过不是我的原创。不能用来发布
用法:就跟设置动画一样!- module RPG
- class Sprite < ::Sprite
- def animation_process_timing(timing, hit)
- if (timing.condition == 0) or
- (timing.condition == 1 and hit == true) or
- (timing.condition == 2 and hit == false)
- if timing.se.name != ""
- se = timing.se
- Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
- end
- case timing.flash_scope
- when 1
- self.flash(timing.flash_color, timing.flash_duration * 2)
- when 2
- if timing.flash_color.alpha == 0
- if (timing.flash_duration <= 3)
- if $_orzFly_EnhancedShake
- $game_screen.start_shake(timing.flash_color.red, timing.flash_color.green, timing.flash_color.blue * 2, timing.flash_duration - 1) unless $game_screen.nil?
- else
- $game_screen.start_shake(timing.flash_color.red, timing.flash_color.green, timing.flash_color.blue * 2) unless $game_screen.nil?
- end
- end
- else
- if self.viewport != nil
- self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
- end
- end
- when 3
- self.flash(nil, timing.flash_duration * 2)
- end
- end
- end
- end
- end
- class Spriteset_Battle
- alias :_orzFly_EnhancedShake_update :update
- def update
- ox, oy = @viewport1.ox, @viewport1.oy
- if ($game_screen.shake_duration <= 1)
- ox, oy = 0, 0
- else
- if ($game_screen.shake_type == 0)
- ox = $game_screen.shake
- elsif ($game_screen.shake_type == 1)
- oy = $game_screen.shake
- elsif ($game_screen.shake_type == 2)
- ox, oy = $game_screen.shake, $game_screen.shake
- end
- ox *= -1 if rand() < 0.5
- oy *= -1 if rand() < 0.5
- ox *= rand()
- oy *= rand()
- end
- _orzFly_EnhancedShake_update
- @viewport1.ox, @viewport1.oy = ox, oy
- @viewport1.update
- end
- end
- class Game_Screen
- attr_reader :shake_type
- attr_reader :shake_duration
- alias :_orzFly_EnhancedShake_initialize :initialize
- def initialize
- _orzFly_EnhancedShake_initialize
- @shake_type = 0
- end
- def start_shake(power, speed, duration, type = 0)
- @shake_power = power
- @shake_speed = speed
- @shake_duration = duration
- @shake_type = type
- end
- alias :_orzFly_EnhancedShake_update :update
- def update
- old_shake, old_shake_duration, old_shake_direction = @shake, @shake_duration, @shake_direction
- _orzFly_EnhancedShake_update
- @shake, @shake_duration, @shake_direction = old_shake, old_shake_duration, old_shake_direction
- if @shake_duration >= 1 or @shake != 0
- delta = (@shake_power * @shake_speed * @shake_direction) / 10.0
- if @shake_duration <= 1 and @shake * (@shake + delta) < 0
- @shake = 0
- else
- @shake += delta
- end
- if @shake > @shake_power * 2
- @shake_direction = -1
- end
- if @shake < - @shake_power * 2
- @shake_direction = 1
- end
- if @shake_duration >= 1
- @shake_duration -= 1
- end
- end
- end
- end
复制代码 使用方法:
|
|