赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 4122 |
最后登录 | 2015-4-19 |
在线时间 | 90 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 90 小时
- 注册时间
- 2012-11-6
- 帖子
- 36
|
2楼
楼主 |
发表于 2014-1-19 18:21:30
|
只看该作者
- #==============================================================================
- # ■ 灯光脚本 for VX 版本1.1.1
- # 5.21.2008
- #------------------------------------------------------------------------------
- # 脚本制作: Kylock (For XP 版本 by Near Fantastica)
- #==============================================================================
- # 如果您想要启用脚本,请在需要灯光效果的事件添加一个注释.
- # 打开开关将禁用灯光效果,启用效果前会检查开关,如果已经添加注释但是开关开启,那么将会停止效果.
- # 译者的话:因为发现脚本有一些问题,所以是有改动过的,如果改的不对,请M我QQ或者留言.谢谢
- #
- #==============================================================================
- # ● 更新日志
- #------------------------------------------------------------------------------
- # 1.0 - 建立最初版本
- # 1.1 - 添加了新的效果: LIGHT2, TORCH, TORCH2
- # - 更改了混合模式(使其看起来更好)
- # - 对FIRE效果增加了红色
- # 1.1.1 -非官方更新
- # -解决了效果FIRE 与 TORCH 效果当开关打开时没有消失的问题
- # -简便了开关判断
- #==============================================================================
- # ● 支持的效果(您可以添加的注释)
- #------------------------------------------------------------------------------
- # GROUND - 中等稳定的白光.
- # FIRE - 伴有轻微的闪烁的红色.
- # LIGHT - 小型稳定的白光.
- # LIGHT2 -大型稳定的白光.
- # TORCH - 伴有强烈闪烁的大型稳定的红光.
- # TORCH2 - 伴有中等烁的大型稳定的红光.
- #==============================================================================
-
- $lsig = 10 #开关号
-
-
- class Spriteset_Map
- alias les_spriteset_map_initalize initialize
- alias les_spriteset_map_dispose dispose
- alias les_spriteset_map_update update
- def initialize
- @light_effects = []
- setup_lights
- les_spriteset_map_initalize
- update
- end
- def dispose
- les_spriteset_map_dispose
- for effect in @light_effects
- effect.light.dispose
- end
- @light_effects = []
- end
- def update
- les_spriteset_map_update
- update_light_effects
- end
- def setup_lights
- for event in $game_map.events.values
- next if event.list == nil
- for i in 0...event.list.size
- if event.list[i].code == 108 and event.list[i].parameters == ["GROUND"]
- type = "GROUND"
- light_effects = Light_Effect.new(event,type)
- light_effects.light.zoom_x = 2
- light_effects.light.zoom_y = 2
- light_effects.light.opacity = 100
- @light_effects.push(light_effects)
- end
- if event.list[i].code == 108 and event.list[i].parameters == ["FIRE"]
- type = "FIRE"
- light_effects = Light_Effect.new(event,type)
- light_effects.light.zoom_x = 300 / 100.0
- light_effects.light.zoom_y = 300 / 100.0
- light_effects.light.opacity = 100
- @light_effects.push(light_effects)
- end
- if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT"]
- type = "LIGHT"
- light_effects = Light_Effect.new(event,type)
- light_effects.light.zoom_x = 1
- light_effects.light.zoom_y = 1
- light_effects.light.opacity = 150
- @light_effects.push(light_effects)
- end
- if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT2"]
- type = "LIGHT2"
- light_effects = Light_Effect.new(event,type)
- light_effects.light.zoom_x = 6
- light_effects.light.zoom_y = 6
- light_effects.light.opacity = 150
- @light_effects.push(light_effects)
- end
- if event.list[i].code == 108 and event.list[i].parameters == ["TORCH"]
- type = "TORCH"
- light_effects = Light_Effect.new(event,type)
- light_effects.light.zoom_x = 6
- light_effects.light.zoom_y = 6
- light_effects.light.opacity = 150
- @light_effects.push(light_effects)
- end
- if event.list[i].code == 108 and event.list[i].parameters == ["TORCH2"]
- type = "TORCH2"
- light_effects = Light_Effect.new(event,type)
- light_effects.light.zoom_x = 6
- light_effects.light.zoom_y = 6
- light_effects.light.opacity = 150
- @light_effects.push(light_effects)
- end
- end
- end
- for effect in @light_effects
- case effect.type
- when "GROUND"
- effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
- effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
- effect.light.blend_type = 1
- when "FIRE"
- effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
- effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
- effect.light.tone = Tone.new(255,-100,-255, 0)
- effect.light.blend_type = 1
- when "LIGHT"
- effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
- effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
- effect.light.blend_type = 1
- when "LIGHT2"
- effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
- effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
- effect.light.blend_type = 1
- when "TORCH"
- effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
- effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
- effect.light.tone = Tone.new(255,-100,-255, 0)
- effect.light.blend_type = 1
- when "TORCH2"
- effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
- effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
- effect.light.tone = Tone.new(255,-100,-255, 0)
- effect.light.blend_type = 1
- end
- end
- end
- def update_light_effects
- if $game_switches[$lsig]
- for effect in @light_effects
- effect.light.visible = false
- end
- else
- for effect in @light_effects
- effect.light.visible = true
- end
- end
- for effect in @light_effects
- case effect.type
- when "GROUND"
- effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
- effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
- when "FIRE"
- effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
- effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
- effect.light.opacity = rand(10) + 90
- when "LIGHT"
- effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
- effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
- when "LIGHT2"
- effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
- effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
- when "TORCH"
- effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
- effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 + rand(20) - 10
- effect.light.opacity = rand(30) + 70
- when "TORCH2"
- effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
- effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
- effect.light.opacity = rand(10) + 90
- end
- end
- end
- end
- class Light_Effect
- attr_accessor :light
- attr_accessor :event
- attr_accessor :type
- def initialize(event, type)
- [url=home.php?mod=space&uid=22469]@light[/url] = Sprite.new
- @light.bitmap = Cache.picture("le.png")
- @light.visible = true
- @light.z = 1000
- @event = event
- @type = type
- end
- end
复制代码 !!!注意如果要用灯光脚 前把图插入Pictures中
|
评分
-
查看全部评分
|