赞 | 11 |
VIP | 107 |
好人卡 | 119 |
积分 | 149 |
经验 | 180043 |
最后登录 | 2024-9-8 |
在线时间 | 3303 小时 |
Lv4.逐梦者 送快递的水表员
- 梦石
- 10
- 星屑
- 4867
- 在线时间
- 3303 小时
- 注册时间
- 2012-6-27
- 帖子
- 7160
|
本帖最后由 Password 于 2012-10-13 13:09 编辑
好吧……这是原脚本,会报错。- #===============================================================
- # 脚本来自黑幕 : [url=http://diyrpg.net]http://diyrpg.net[/url] 你可选择不保留
- # 作者 : 狐狸
- # 移植修改 Eienshinken
- #==============================================================================
- # ■ Game_Screen
- #------------------------------------------------------------------------------
- # 更改色调以及画面闪烁、保存画面全体关系处理数据的类。本类的实例请参考
- # $game_screen。
- #==============================================================================
- class Game_Screen
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :shake_x # 震动位置X坐标
- attr_reader :shake_y # 震动位置Y坐标
- #--------------------------------------------------------------------------
- # ● 初试化对像
- #--------------------------------------------------------------------------
- alias ini initialize
- def initialize
- ini
- @shake_x = 0
- @shake_y = 0
- @shake_power_fox = 0
- @shake_duration_fox = 0
- #加入半透明
- $Back = Sprite.new
- #$Back.bitmap = Bitmap.new("")
- $Back.opacity = 0
- $Back.z = 9999
- @tone_zhenshu = 0
- @tone_mingan = 0
- end
- #--------------------------------------------------------------------------
- # ● 开始震动
- # power : 强度
- # duration : 帧数
- # fangxiang: 方向 0为左右 1为上下 2为上下左右
- #--------------------------------------------------------------------------
- def start_shake_fox(power, duration,fangxiang = 0)
- @shake_power_fox = power
- @shake_duration_fox = duration
- @fangxiang = fangxiang
- if fangxiang == 2
- @fudu = power/(duration/8)
- else
- @fudu = power/(duration/4)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新震动X
- #--------------------------------------------------------------------------
- def zhendongx
- # 画面震动X坐标计算
- if @shake_duration_fox >= 1 or @shake_x != 0
- #p @shake_duration % 8,@shake_power
- #总 40帧 强度20 次数10
- case @shake_duration_fox % 4
- when 0,2
- @shake_x = 0
- when 3
- @shake_x = @shake_power_fox
- when 1
- @shake_x = -@shake_power_fox
- @shake_power_fox -= @fudu if @shake_power_fox > 0
- end
- if @shake_duration_fox >= 1
- @shake_duration_fox -= 1
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新震动Y
- #--------------------------------------------------------------------------
- def zhendongy
- # 画面震动Y坐标计算
- if @shake_duration_fox >= 1 or @shake_y != 0
- #总 40帧 强度20 次数10
- case @shake_duration_fox % 4
- when 0,2
- @shake_y = 0
- when 3
- @shake_y = @shake_power_fox
- when 1
- @shake_y = -@shake_power_fox
- @shake_power_fox -= @fudu if @shake_power_fox > 0
- end
- if @shake_duration_fox >= 1
- @shake_duration_fox -= 1
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新震动XY同时
- #--------------------------------------------------------------------------
- def zhendongxy
- # 画面同时震动XY坐标计算
- if @shake_duration_fox >= 1 or @shake_x != 0 or @shake_y != 0
- #总 40帧 强度20 次数10
- case @shake_duration_fox % 8
- when 0
- @shake_x = -@shake_power_fox
- when 7,5
- @shake_x = 0
- when 6
- @shake_x = @shake_power_fox
- when 4
- @shake_y = -@shake_power_fox
- when 3
- @shake_y = 0
- when 2
- @shake_y = @shake_power_fox
- when 1
- @shake_y = 0
- @shake_power_fox -= @fudu if @shake_power_fox > 0
- end
- if @shake_duration_fox >= 1
- @shake_duration_fox -= 1
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 开始淡入
- # tone : 明暗
- # zhenshu : 时间
- #--------------------------------------------------------------------------
- def start_tone(tone, zhenshu,pic = nil)
- if pic != nil
- $Back.bitmap = Bitmap.new("Graphics/Transitions/#{pic}" )
- $Back.zoom_x = 1
- $Back.zoom_y = 1
- else
- $Back.bitmap = Bitmap.new("Graphics/Transitions/淡入淡出" )
- $Back.zoom_x = 10
- $Back.zoom_y = 10
- end
- @tone_mingan = tone
- @tone_zhenshu = zhenshu*2
- if @tone_zhenshu == 0
- case @tone_mingan
- when 0
- $Back.opacity = 0
- when 1
- $Back.opacity = 255
- end
- end
- end
- #淡入
- def tonein(zhenshu,pic = nil)
- start_tone(0, zhenshu,pic)
- $game_system.map_interpreter.wait_count = zhenshu * 2
- end
- #淡出
- def toneout(zhenshu,pic = nil)
- start_tone(1, zhenshu,pic)
- $game_system.map_interpreter.wait_count = zhenshu * 2
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias update_fox update
- def update
- update_fox
- #淡入淡出
- if @tone_zhenshu >= 1
- d = @tone_zhenshu
- if @tone_mingan == 0
- $Back.opacity = ($Back.opacity * (d - 1) + 255) / d
- elsif @tone_mingan == 1
- $Back.opacity = ($Back.opacity * (d - 1)) / d
- end
- @tone_zhenshu -= 1
- end
- #画面震动
- if @shake_duration_fox >= 1
- Graphics.update
- case @fangxiang
- when 0
- zhendongx
- when 1
- zhendongy
- else
- zhendongxy
- end
- end
- end
- end
- #==============================================================================
- # ■ Interpreter
- #------------------------------------------------------------------------------
- # 执行事件命令的解释器。本类在 Game_System 类
- # 与 Game_Event 类的内部使用。
- #=============================================
- class Interpreter
- attr_accessor :wait_count # 窗口计数
- end
- #==============================================================================
- # ■ Spriteset_Map
- #------------------------------------------------------------------------------
- # 处理地图画面活动块和元件的类。本类在
- # Scene_Map 类的内部使用。
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias update_fox update
- def update
- update_fox
- @viewport1.ox = $game_map.screen.shake_x
- @viewport1.oy = $game_map.screen.shake_y
- # Eienshinken
- @viewport2.ox = $game_map.screen.shake_x
- @viewport2.oy = $game_map.screen.shake_y
- @viewport3.ox = $game_map.screen.shake_x
- @viewport3.oy = $game_map.screen.shake_y
- @viewport4.ox = $game_map.screen.shake_x
- @viewport4.oy = $game_map.screen.shake_y
- @viewport5.ox = $game_map.screen.shake_x
- @viewport5.oy = $game_map.screen.shake_y
- @viewport6.ox = $game_map.screen.shake_x
- @viewport6.oy = $game_map.screen.shake_y
- end
- end
复制代码
这是报错内容 |
|