赞 | 2 |
VIP | 2 |
好人卡 | 4 |
积分 | 1 |
经验 | 96076 |
最后登录 | 2015-12-27 |
在线时间 | 93 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 93 小时
- 注册时间
- 2008-5-16
- 帖子
- 745
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
放个脚本,贴几张图给大家看看!
不过我在写时不知道影子到底是从
那边发射来的{/bz}{/bz}{/bz}
所以弄了3种类型的影子
请自行在脚本中修改样式
P $影子类型 = 1 # 可写1与2.3更换影子类型
{/hx}
根据大家的建议,我也弄了第三种影子类型。
应该与现实比较符合了。大家可以使用看看。
另:
很不要脸的借用别人的图片来使用下~
叫这张shadow图片放在picture下,做为一般影子图!
在水中则有倒影图!切记需要改地形标志为1才有倒影
更新内容:
新增类型3-在地形标志为1的元件图内有倒影,其他则为普通影子
且影子随水流有点荡漾的感觉(伪造的不太形象)
更新脚本:
- #==============================================================================
- # ■ Sprite_Character_Shadow
- # ■ By 茄子 联系QQ 9244579
- # ■ 要地图元件有倒影出现请将
- # ■ 地形标志改为1
- #==============================================================================
- $影子类型 = 3
- # $影子类型可以选为1.2.3来测试效果
- # 类型3是比较完善真实的类型
- #==============================================================================
- #==============================================================================
- class Sprite_Character_False < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize(viewport, character = nil)
- super(viewport)
- @character = character
- @direction = 2
- update
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- if @tile_id != @character.tile_id or
- @character_name != @character.character_name or
- @character_hue != @character.character_hue
- @tile_id = @character.tile_id
- @character_name = @character.character_name
- @character_hue = @character.character_hue
- if @tile_id >= 384
- self.bitmap = RPG::Cache.tile($game_map.tileset_name,
- @tile_id, @character.character_hue)
- self.src_rect.set(0, 0, 32, 32)
- self.ox = 16
- self.oy = 32
- else
- self.bitmap = RPG::Cache.character(@character.character_name,
- @character.character_hue)
- @cw = bitmap.width / 4
- @ch = bitmap.height / 4
- self.ox = @cw / 2
- self.oy = @ch
- end
- end
- self.opacity = 102
- self.blend_type = @character.blend_type
- self.bush_depth = @character.bush_depth
- if $影子类型 == 1 # ★
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- self.mirror = false
- if @character.direction == 2
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- self.angle = 180
- elsif @character.direction == 4
- self.x = @character.screen_x-10
- self.y = @character.screen_y-10
- self.z = @character.screen_z(@ch)
- self.angle = 90
- elsif @character.direction == 6
- self.x = @character.screen_x+10
- self.y = @character.screen_y-10
- self.z = @character.screen_z(@ch)
- self.angle = 270
- elsif @character.direction == 8
- self.x = @character.screen_x
- self.y = @character.screen_y-15
- self.z = @character.screen_z(@ch)
- self.angle = 0
- end
- elsif $影子类型 == 2 # ★
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@character.direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- self.mirror = true
- if @character.direction == 2
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- self.angle = 180
- elsif @character.direction == 4
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 6
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 8
- self.x = @character.screen_x
- self.y = @character.screen_y-15
- self.z = @character.screen_z(@ch)
- self.angle = 0
- end
- elsif $影子类型 == 3 # ★
- @x = @character.x
- @y = @character.y
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@character.direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- if $game_map.terrain_tag(@x, @y+1) == 1
- self.mirror = true
- self.angle = 180
- if @character.direction == 2
- self.visible = true
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 4
- self.visible = true
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 6
- self.visible = true
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- end
- elsif $game_map.terrain_tag(@x, @y-1) == 1 # …
- self.mirror = false
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- if @character.direction == 8 # …
- self.visible = true
- @direction = 2
- self.x = @character.screen_x
- self.y = @character.screen_y-35
- self.z = @character.screen_z(@ch)
- self.angle = 0
- elsif @character.direction == 4
- self.visible = true
- @direction = 4
- self.x = @character.screen_x
- self.y = @character.screen_y-35
- self.z = @character.screen_z(@ch)
- self.angle = 0
- elsif @character.direction == 6
- self.visible = true
- @direction = 6
- self.x = @character.screen_x
- self.y = @character.screen_y-35
- self.z = @character.screen_z(@ch)
- self.angle = 0
- end # …
- elsif $game_map.terrain_tag(@x+1, @y) == 1
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- self.angle = 270
- self.visible = true
- if @character.direction == 8
- @direction = 6
- self.x = @character.screen_x+20
- self.y = @character.screen_y-20
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 2
- @direction = 4
- self.x = @character.screen_x+20
- self.y = @character.screen_y-20
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 6
- @direction = 2
- self.x = @character.screen_x+20
- self.y = @character.screen_y-20
- self.z = @character.screen_z(@ch)
- end
- elsif $game_map.terrain_tag(@x-1, @y) == 1
- if @tile_id == 0
- sx = @character.pattern * @cw
- sy = (@direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- self.visible = true
- self.angle = 90
- if @character.direction == 8
- @direction = 4
- self.x = @character.screen_x-20
- self.y = @character.screen_y-20
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 2
- @direction = 6
- self.x = @character.screen_x-20
- self.y = @character.screen_y-20
- self.z = @character.screen_z(@ch)
- elsif @character.direction == 4
- @direction = 2
- self.x = @character.screen_x-20
- self.y = @character.screen_y-20
- self.z = @character.screen_z(@ch)
- end
- elsif
- self.visible = false
- end # …
- end
- self.opacity = rand(25)+100
- self.bush_depth = rand(25)+100
- if @character.animation_id != 0
- animation = $data_animations[@character.animation_id]
- animation(animation, true)
- @character.animation_id = 0
- end
- end
- end
- class Sprite_Character_Shadow < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize(viewport, character = nil)
- super(viewport)
- @character = character
- self.bitmap = RPG::Cache.picture("shadow")
- update
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- if $影子类型 == 3
- if @character.character_name == ""
- self.x = @character.screen_x-5000
- self.y = @character.screen_y-5000
- else
- self.x = @character.screen_x-16
- self.y = @character.screen_y-20
- self.z = 10
- self.opacity = 255
- self.blend_type = @character.blend_type
- self.bush_depth = @character.bush_depth
- end
- if @character.animation_id != 0
- animation = $data_animations[@character.animation_id]
- animation(animation, true)
- @character.animation_id = 0
- end
- end
- end
- end
- #==============================================================================
- # ■ Spriteset_Map
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- @viewport1 = Viewport.new(0, 0, 640, 480)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 200
- @viewport3.z = 5000
- @tilemap = Tilemap.new(@viewport1)
- @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
- for i in 0..6
- autotile_name = $game_map.autotile_names[i]
- @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
- end
- @tilemap.map_data = $game_map.data
- @tilemap.priorities = $game_map.priorities
- @panorama = Plane.new(@viewport1)
- @panorama.z = -1000
- @fog = Plane.new(@viewport1)
- @fog.z = 3000
- @character_sprites = []
- for i in $game_map.events.keys.sort
- s = Sprite_Character.new(@viewport1, $game_map.events[i])
- @character_sprites.push(s)
- s = Sprite_Character_Shadow.new(@viewport1, $game_map.events[i])
- @character_sprites.push(s)
- s = Sprite_Character_False.new(@viewport1, $game_map.events[i])
- @character_sprites.push(s)
- end
- @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
- @character_sprites.push(Sprite_Character_False.new(@viewport1, $game_player))
- @character_sprites.push(Sprite_Character_Shadow.new(@viewport1, $game_player))
- @weather = RPG::Weather.new(@viewport1)
- @picture_sprites = []
- for i in 1..50
- @picture_sprites.push(Sprite_Picture.new(@viewport2,
- $game_screen.pictures[i]))
- end
- @timer_sprite = Sprite_Timer.new
- update
- end
- end
复制代码
{/bz}{/bz}
请不要被下列图片所迷惑。因为是旧版的{/hx}
|
|