Project1

标题: 低调发布>. [打印本页]

作者: ★_茄孓    时间: 2008-7-29 05:19
标题: 低调发布>.
放个脚本,贴几张图给大家看看!
不过我在写时不知道影子到底是从
那边发射来的{/bz}{/bz}{/bz}
所以弄了3种类型的影子
请自行在脚本中修改样式

P $影子类型 = 1 # 可写1与2.3更换影子类型
{/hx}
根据大家的建议,我也弄了第三种影子类型。
应该与现实比较符合了。大家可以使用看看。
另:
很不要脸的借用别人的图片来使用下~

叫这张shadow图片放在picture下,做为一般影子图!
在水中则有倒影图!切记需要改地形标志为1才有倒影
更新内容:
新增类型3-在地形标志为1的元件图内有倒影,其他则为普通影子
且影子随水流有点荡漾的感觉(伪造的不太形象)
更新脚本:
  1. #==============================================================================
  2. # ■ Sprite_Character_Shadow
  3. # ■ By 茄子 联系QQ 9244579
  4. # ■ 要地图元件有倒影出现请将
  5. # ■ 地形标志改为1
  6. #==============================================================================
  7. $影子类型 = 3
  8. # $影子类型可以选为1.2.3来测试效果
  9. # 类型3是比较完善真实的类型
  10. #==============================================================================
  11. #==============================================================================
  12. class Sprite_Character_False < RPG::Sprite
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化对像
  15.   #--------------------------------------------------------------------------
  16.   def initialize(viewport, character = nil)
  17.     super(viewport)
  18.     @character = character
  19.     @direction = 2
  20.     update
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 更新画面
  24.   #--------------------------------------------------------------------------
  25.   def update
  26.     super
  27.     if @tile_id != @character.tile_id or
  28.        @character_name != @character.character_name or
  29.        @character_hue != @character.character_hue
  30.       @tile_id = @character.tile_id
  31.       @character_name = @character.character_name
  32.       @character_hue = @character.character_hue
  33.       if @tile_id >= 384
  34.         self.bitmap = RPG::Cache.tile($game_map.tileset_name,
  35.           @tile_id, @character.character_hue)
  36.         self.src_rect.set(0, 0, 32, 32)
  37.         self.ox = 16
  38.         self.oy = 32
  39.       else
  40.         self.bitmap = RPG::Cache.character(@character.character_name,
  41.           @character.character_hue)
  42.         @cw = bitmap.width / 4
  43.         @ch = bitmap.height / 4
  44.         self.ox = @cw / 2
  45.         self.oy = @ch
  46.       end
  47.     end
  48.     self.opacity = 102
  49.     self.blend_type = @character.blend_type
  50.     self.bush_depth = @character.bush_depth
  51.     if $影子类型 == 1  # ★
  52.     if @tile_id == 0
  53.     sx = @character.pattern * @cw
  54.     sy = (@direction - 2) / 2 * @ch
  55.     self.src_rect.set(sx, sy, @cw, @ch)
  56.     end
  57.     self.mirror = false
  58.     if @character.direction == 2
  59.     self.x = @character.screen_x
  60.     self.y = @character.screen_y
  61.     self.z = @character.screen_z(@ch)
  62.     self.angle = 180
  63.     elsif @character.direction == 4
  64.     self.x = @character.screen_x-10
  65.     self.y = @character.screen_y-10
  66.     self.z = @character.screen_z(@ch)
  67.     self.angle = 90
  68.     elsif @character.direction == 6
  69.     self.x = @character.screen_x+10
  70.     self.y = @character.screen_y-10
  71.     self.z = @character.screen_z(@ch)
  72.     self.angle = 270
  73.     elsif @character.direction == 8
  74.     self.x = @character.screen_x
  75.     self.y = @character.screen_y-15
  76.     self.z = @character.screen_z(@ch)
  77.     self.angle = 0
  78.     end   
  79.     elsif $影子类型 == 2  # ★
  80.     if @tile_id == 0
  81.     sx = @character.pattern * @cw
  82.     sy = (@character.direction - 2) / 2 * @ch
  83.     self.src_rect.set(sx, sy, @cw, @ch)
  84.     end
  85.     self.mirror = true
  86.     if @character.direction == 2
  87.     if @tile_id == 0
  88.     sx = @character.pattern * @cw
  89.     sy = (@direction - 2) / 2 * @ch
  90.     self.src_rect.set(sx, sy, @cw, @ch)
  91.     end
  92.     self.x = @character.screen_x
  93.     self.y = @character.screen_y
  94.     self.z = @character.screen_z(@ch)
  95.     self.angle = 180
  96.     elsif @character.direction == 4
  97.     self.x = @character.screen_x
  98.     self.y = @character.screen_y
  99.     self.z = @character.screen_z(@ch)
  100.     elsif @character.direction == 6
  101.     self.x = @character.screen_x
  102.     self.y = @character.screen_y
  103.     self.z = @character.screen_z(@ch)
  104.     elsif @character.direction == 8
  105.     self.x = @character.screen_x
  106.     self.y = @character.screen_y-15
  107.     self.z = @character.screen_z(@ch)
  108.     self.angle = 0
  109.     end   
  110.   elsif $影子类型 == 3  # ★
  111.     @x = @character.x
  112.     @y = @character.y
  113.     if @tile_id == 0
  114.     sx = @character.pattern * @cw
  115.     sy = (@character.direction - 2) / 2 * @ch
  116.     self.src_rect.set(sx, sy, @cw, @ch)
  117.     end
  118.   if $game_map.terrain_tag(@x, @y+1) == 1
  119.     self.mirror = true
  120.     self.angle = 180
  121.     if @character.direction == 2
  122.     self.visible = true
  123.     self.x = @character.screen_x
  124.     self.y = @character.screen_y
  125.     self.z = @character.screen_z(@ch)
  126.     elsif @character.direction == 4
  127.     self.visible = true
  128.     self.x = @character.screen_x
  129.     self.y = @character.screen_y
  130.     self.z = @character.screen_z(@ch)
  131.     elsif @character.direction == 6
  132.     self.visible = true
  133.     self.x = @character.screen_x
  134.     self.y = @character.screen_y
  135.     self.z = @character.screen_z(@ch)
  136.     end
  137.   elsif $game_map.terrain_tag(@x, @y-1) == 1  # …
  138.     self.mirror = false
  139.     if @tile_id == 0
  140.     sx = @character.pattern * @cw
  141.     sy = (@direction - 2) / 2 * @ch
  142.     self.src_rect.set(sx, sy, @cw, @ch)
  143.     end
  144.     if @character.direction == 8 # …
  145.     self.visible = true
  146.     @direction = 2
  147.     self.x = @character.screen_x
  148.     self.y = @character.screen_y-35
  149.     self.z = @character.screen_z(@ch)
  150.     self.angle = 0
  151.     elsif @character.direction == 4
  152.     self.visible = true
  153.     @direction = 4
  154.     self.x = @character.screen_x
  155.     self.y = @character.screen_y-35
  156.     self.z = @character.screen_z(@ch)
  157.     self.angle = 0
  158.     elsif @character.direction == 6
  159.     self.visible = true
  160.     @direction = 6
  161.     self.x = @character.screen_x
  162.     self.y = @character.screen_y-35
  163.     self.z = @character.screen_z(@ch)
  164.     self.angle = 0
  165.     end  # …
  166.   elsif $game_map.terrain_tag(@x+1, @y) == 1
  167.     if @tile_id == 0
  168.     sx = @character.pattern * @cw
  169.     sy = (@direction - 2) / 2 * @ch
  170.     self.src_rect.set(sx, sy, @cw, @ch)
  171.     end
  172.     self.angle = 270
  173.     self.visible = true
  174.     if @character.direction == 8
  175.     @direction = 6
  176.     self.x = @character.screen_x+20
  177.     self.y = @character.screen_y-20
  178.     self.z = @character.screen_z(@ch)
  179.     elsif @character.direction == 2
  180.     @direction = 4
  181.     self.x = @character.screen_x+20
  182.     self.y = @character.screen_y-20
  183.     self.z = @character.screen_z(@ch)
  184.     elsif @character.direction == 6
  185.     @direction = 2
  186.     self.x = @character.screen_x+20
  187.     self.y = @character.screen_y-20
  188.     self.z = @character.screen_z(@ch)
  189.     end  
  190.   elsif $game_map.terrain_tag(@x-1, @y) == 1
  191.     if @tile_id == 0
  192.     sx = @character.pattern * @cw
  193.     sy = (@direction - 2) / 2 * @ch
  194.     self.src_rect.set(sx, sy, @cw, @ch)
  195.     end
  196.     self.visible = true
  197.     self.angle = 90
  198.     if @character.direction == 8
  199.     @direction = 4
  200.     self.x = @character.screen_x-20
  201.     self.y = @character.screen_y-20
  202.     self.z = @character.screen_z(@ch)
  203.     elsif @character.direction == 2
  204.     @direction = 6
  205.     self.x = @character.screen_x-20
  206.     self.y = @character.screen_y-20
  207.     self.z = @character.screen_z(@ch)
  208.     elsif @character.direction == 4
  209.     @direction = 2
  210.     self.x = @character.screen_x-20
  211.     self.y = @character.screen_y-20
  212.     self.z = @character.screen_z(@ch)
  213.     end
  214.   elsif
  215.   self.visible = false
  216.   end  # …
  217. end
  218.   self.opacity = rand(25)+100
  219.   self.bush_depth = rand(25)+100
  220.     if @character.animation_id != 0
  221.       animation = $data_animations[@character.animation_id]
  222.       animation(animation, true)
  223.       @character.animation_id = 0
  224.     end
  225.   end
  226. end
  227. class Sprite_Character_Shadow < RPG::Sprite
  228.   #--------------------------------------------------------------------------
  229.   # ● 初始化对像
  230.   #--------------------------------------------------------------------------
  231.   def initialize(viewport, character = nil)
  232.     super(viewport)
  233.     @character = character
  234.     self.bitmap = RPG::Cache.picture("shadow")
  235.     update
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● 更新画面
  239.   #--------------------------------------------------------------------------
  240.   def update
  241.     super
  242.     if $影子类型 == 3
  243.     if @character.character_name == ""
  244.     self.x = @character.screen_x-5000
  245.     self.y = @character.screen_y-5000
  246.     else
  247.     self.x = @character.screen_x-16
  248.     self.y = @character.screen_y-20
  249.     self.z = 10
  250.     self.opacity = 255
  251.     self.blend_type = @character.blend_type
  252.     self.bush_depth = @character.bush_depth
  253.     end
  254.     if @character.animation_id != 0
  255.       animation = $data_animations[@character.animation_id]
  256.       animation(animation, true)
  257.       @character.animation_id = 0
  258.     end
  259.     end
  260.   end
  261. end
  262. #==============================================================================
  263. # ■ Spriteset_Map
  264. #==============================================================================
  265. class Spriteset_Map
  266.   #--------------------------------------------------------------------------
  267.   # ● 初始化对像
  268.   #--------------------------------------------------------------------------
  269. def initialize
  270.     @viewport1 = Viewport.new(0, 0, 640, 480)
  271.     @viewport2 = Viewport.new(0, 0, 640, 480)
  272.     @viewport3 = Viewport.new(0, 0, 640, 480)
  273.     @viewport2.z = 200
  274.     @viewport3.z = 5000
  275.     @tilemap = Tilemap.new(@viewport1)
  276.     @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
  277.     for i in 0..6
  278.       autotile_name = $game_map.autotile_names[i]
  279.       @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
  280.     end
  281.     @tilemap.map_data = $game_map.data
  282.     @tilemap.priorities = $game_map.priorities
  283.     @panorama = Plane.new(@viewport1)
  284.     @panorama.z = -1000
  285.     @fog = Plane.new(@viewport1)
  286.     @fog.z = 3000
  287.     @character_sprites = []
  288.     for i in $game_map.events.keys.sort
  289.       s = Sprite_Character.new(@viewport1, $game_map.events[i])
  290.       @character_sprites.push(s)
  291.       s = Sprite_Character_Shadow.new(@viewport1, $game_map.events[i])
  292.       @character_sprites.push(s)
  293.       s = Sprite_Character_False.new(@viewport1, $game_map.events[i])
  294.       @character_sprites.push(s)
  295.     end
  296.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  297.     @character_sprites.push(Sprite_Character_False.new(@viewport1, $game_player))
  298.     @character_sprites.push(Sprite_Character_Shadow.new(@viewport1, $game_player))
  299.     @weather = RPG::Weather.new(@viewport1)
  300.     @picture_sprites = []
  301.     for i in 1..50
  302.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  303.         $game_screen.pictures[i]))
  304.     end
  305.     @timer_sprite = Sprite_Timer.new
  306.     update
  307.   end
  308. end
复制代码


{/bz}{/bz}
请不要被下列图片所迷惑。因为是旧版的{/hx}





作者: 越前リョーマ    时间: 2008-7-29 05:20
话说这个叫倒影吧……
地球村有外国的。
作者: ★_茄孓    时间: 2008-7-29 05:21
以下引用越前リョーマ于2008-7-28 21:20:46的发言:

话说这个叫倒影吧……
地球村有外国的。

不好意思{/hx}表达能力不好
作者: 灯笼菜刀王    时间: 2008-7-29 05:26
效果不错~~

不过,想请问个问题....看截图

就是在平地上也有倒影?= =那就太古怪了些...
作者: ★_茄孓    时间: 2008-7-29 05:27
以下引用灯笼菜刀王于2008-7-28 21:26:34的发言:

效果不错~~

不过,想请问个问题....看截图

就是在平地上也有倒影?= =那就太古怪了些...


{/bz}{/bz}{/bz}{/bz}
{/se}{/se}{/se}{/se}
因为有太阳光嘛
如果要解决此问题可以是可以的

作者: 灯笼菜刀王    时间: 2008-7-29 05:33
那就解决嘛,在水边才会有倒影,可以考虑铺事件方法或者用地形标志,个人感觉铺事件法比较合适,因为地形标志有可能在奇怪的地方出倒影.....

不过,楼主到是让我想到了一个好系统(真实影子显示)
作者: ★_茄孓    时间: 2008-7-29 06:06
好的,我明天就进行修正!
作者: 司马睿风    时间: 2008-7-29 06:46
日本早就有这个脚本了,汗个
作者: ★_茄孓    时间: 2008-7-29 06:50
{/bz}{/bz}{/bz}
以下引用司马睿风于2008-7-28 22:46:06的发言:

日本早就有这个脚本了,汗个

我不知道耶```{/hx}
不过依赖性别太强哦``{/dy}
作者: Sora    时间: 2008-7-29 17:19
提示: 作者被禁止或删除 内容自动屏蔽
作者: hide秀    时间: 2008-7-29 17:49
希望可以更加完善一些 在帮你发布
没办法 现在普通比较简单的脚本不会发布
顶多奖励积分或者感谢共享
毕竟RM出来好几年了 技术应该要提高 高质量一点的脚本才会发布主站
给些提议 利用透明度做出来的影子 在水中表现出来还是效果不错的
平时在地面上显示影子的话 最好就用个什么通用的图片代替一下
简单的表示比如椭圆形的影子 踩在脚底下就可以了
作者: 劍之飛龍☆    时间: 2008-7-29 18:41
在水里的影子,随着水波晃动的感觉,
不知道LZ做出来没……

还有,地上的那个影子应该是黑的{/hx}
作者: ★_茄孓    时间: 2008-7-29 20:04
{/hx}
根据大家的建议,我也弄了第三种影子类型。
应该与现实比较符合了。大家可以使用看看。
更新脚本:
  1. #==============================================================================
  2. # ■ Sprite_Character_Shadow
  3. # ■ By 茄子 联系QQ 9244579
  4. # ■ 要地图元件有倒影出现请将
  5. # ■ 地形标志改为1
  6. #==============================================================================
  7. $影子类型 = 3
  8. # $影子类型可以选为1.2.3来测试效果
  9. # 类型3是比较完善真实的类型
  10. #==============================================================================
  11. #==============================================================================
  12. class Sprite_Character_False < RPG::Sprite
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化对像
  15.   #--------------------------------------------------------------------------
  16.   def initialize(viewport, character = nil)
  17.     super(viewport)
  18.     @character = character
  19.     @direction = 2
  20.     update
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 更新画面
  24.   #--------------------------------------------------------------------------
  25.   def update
  26.     super
  27.     if @tile_id != @character.tile_id or
  28.        @character_name != @character.character_name or
  29.        @character_hue != @character.character_hue
  30.       @tile_id = @character.tile_id
  31.       @character_name = @character.character_name
  32.       @character_hue = @character.character_hue
  33.       if @tile_id >= 384
  34.         self.bitmap = RPG::Cache.tile($game_map.tileset_name,
  35.           @tile_id, @character.character_hue)
  36.         self.src_rect.set(0, 0, 32, 32)
  37.         self.ox = 16
  38.         self.oy = 32
  39.       else
  40.         self.bitmap = RPG::Cache.character(@character.character_name,
  41.           @character.character_hue)
  42.         @cw = bitmap.width / 4
  43.         @ch = bitmap.height / 4
  44.         self.ox = @cw / 2
  45.         self.oy = @ch
  46.       end
  47.     end
  48.     self.opacity = 102
  49.     self.blend_type = @character.blend_type
  50.     self.bush_depth = @character.bush_depth
  51.     if $影子类型 == 1  # ★
  52.     if @tile_id == 0
  53.     sx = @character.pattern * @cw
  54.     sy = (@direction - 2) / 2 * @ch
  55.     self.src_rect.set(sx, sy, @cw, @ch)
  56.     end
  57.     self.mirror = false
  58.     if @character.direction == 2
  59.     self.x = @character.screen_x
  60.     self.y = @character.screen_y
  61.     self.z = @character.screen_z(@ch)
  62.     self.angle = 180
  63.     elsif @character.direction == 4
  64.     self.x = @character.screen_x-10
  65.     self.y = @character.screen_y-10
  66.     self.z = @character.screen_z(@ch)
  67.     self.angle = 90
  68.     elsif @character.direction == 6
  69.     self.x = @character.screen_x+10
  70.     self.y = @character.screen_y-10
  71.     self.z = @character.screen_z(@ch)
  72.     self.angle = 270
  73.     elsif @character.direction == 8
  74.     self.x = @character.screen_x
  75.     self.y = @character.screen_y-15
  76.     self.z = @character.screen_z(@ch)
  77.     self.angle = 0
  78.     end   
  79.     elsif $影子类型 == 2  # ★
  80.     if @tile_id == 0
  81.     sx = @character.pattern * @cw
  82.     sy = (@character.direction - 2) / 2 * @ch
  83.     self.src_rect.set(sx, sy, @cw, @ch)
  84.     end
  85.     self.mirror = true
  86.     if @character.direction == 2
  87.     if @tile_id == 0
  88.     sx = @character.pattern * @cw
  89.     sy = (@direction - 2) / 2 * @ch
  90.     self.src_rect.set(sx, sy, @cw, @ch)
  91.     end
  92.     self.x = @character.screen_x
  93.     self.y = @character.screen_y
  94.     self.z = @character.screen_z(@ch)
  95.     self.angle = 180
  96.     elsif @character.direction == 4
  97.     self.x = @character.screen_x
  98.     self.y = @character.screen_y
  99.     self.z = @character.screen_z(@ch)
  100.     elsif @character.direction == 6
  101.     self.x = @character.screen_x
  102.     self.y = @character.screen_y
  103.     self.z = @character.screen_z(@ch)
  104.     elsif @character.direction == 8
  105.     self.x = @character.screen_x
  106.     self.y = @character.screen_y-15
  107.     self.z = @character.screen_z(@ch)
  108.     self.angle = 0
  109.     end   
  110.   elsif $影子类型 == 3  # ★
  111.     @x = @character.x
  112.     @y = @character.y
  113.     if @tile_id == 0
  114.     sx = @character.pattern * @cw
  115.     sy = (@character.direction - 2) / 2 * @ch
  116.     self.src_rect.set(sx, sy, @cw, @ch)
  117.     end
  118.   if $game_map.terrain_tag(@x, @y+1) == 1
  119.     self.mirror = true
  120.     self.angle = 180
  121.     if @character.direction == 2
  122.     self.visible = true
  123.     self.x = @character.screen_x
  124.     self.y = @character.screen_y
  125.     self.z = @character.screen_z(@ch)
  126.     elsif @character.direction == 4
  127.     self.visible = true
  128.     self.x = @character.screen_x
  129.     self.y = @character.screen_y
  130.     self.z = @character.screen_z(@ch)
  131.     elsif @character.direction == 6
  132.     self.visible = true
  133.     self.x = @character.screen_x
  134.     self.y = @character.screen_y
  135.     self.z = @character.screen_z(@ch)
  136.     end
  137.   elsif $game_map.terrain_tag(@x, @y-1) == 1  # …
  138.     self.mirror = false
  139.     if @tile_id == 0
  140.     sx = @character.pattern * @cw
  141.     sy = (@direction - 2) / 2 * @ch
  142.     self.src_rect.set(sx, sy, @cw, @ch)
  143.     end
  144.     if @character.direction == 8 # …
  145.     self.visible = true
  146.     @direction = 2
  147.     self.x = @character.screen_x
  148.     self.y = @character.screen_y-35
  149.     self.z = @character.screen_z(@ch)
  150.     self.angle = 0
  151.     elsif @character.direction == 4
  152.     self.visible = true
  153.     @direction = 4
  154.     self.x = @character.screen_x
  155.     self.y = @character.screen_y-35
  156.     self.z = @character.screen_z(@ch)
  157.     self.angle = 0
  158.     elsif @character.direction == 6
  159.     self.visible = true
  160.     @direction = 6
  161.     self.x = @character.screen_x
  162.     self.y = @character.screen_y-35
  163.     self.z = @character.screen_z(@ch)
  164.     self.angle = 0
  165.     end  # …
  166.   elsif $game_map.terrain_tag(@x+1, @y) == 1
  167.     if @tile_id == 0
  168.     sx = @character.pattern * @cw
  169.     sy = (@direction - 2) / 2 * @ch
  170.     self.src_rect.set(sx, sy, @cw, @ch)
  171.     end
  172.     self.angle = 270
  173.     self.visible = true
  174.     if @character.direction == 8
  175.     @direction = 6
  176.     self.x = @character.screen_x+20
  177.     self.y = @character.screen_y-20
  178.     self.z = @character.screen_z(@ch)
  179.     elsif @character.direction == 2
  180.     @direction = 4
  181.     self.x = @character.screen_x+20
  182.     self.y = @character.screen_y-20
  183.     self.z = @character.screen_z(@ch)
  184.     elsif @character.direction == 6
  185.     @direction = 2
  186.     self.x = @character.screen_x+20
  187.     self.y = @character.screen_y-20
  188.     self.z = @character.screen_z(@ch)
  189.     end  
  190.   elsif $game_map.terrain_tag(@x-1, @y) == 1
  191.     if @tile_id == 0
  192.     sx = @character.pattern * @cw
  193.     sy = (@direction - 2) / 2 * @ch
  194.     self.src_rect.set(sx, sy, @cw, @ch)
  195.     end
  196.     self.visible = true
  197.     self.angle = 90
  198.     if @character.direction == 8
  199.     @direction = 4
  200.     self.x = @character.screen_x-20
  201.     self.y = @character.screen_y-20
  202.     self.z = @character.screen_z(@ch)
  203.     elsif @character.direction == 2
  204.     @direction = 6
  205.     self.x = @character.screen_x-20
  206.     self.y = @character.screen_y-20
  207.     self.z = @character.screen_z(@ch)
  208.     elsif @character.direction == 4
  209.     @direction = 2
  210.     self.x = @character.screen_x-20
  211.     self.y = @character.screen_y-20
  212.     self.z = @character.screen_z(@ch)
  213.     end
  214.   elsif
  215.   self.visible = false
  216.   end  # …
  217. end
  218.   self.opacity = rand(25)+100
  219.   self.bush_depth = rand(25)+100
  220.     if @character.animation_id != 0
  221.       animation = $data_animations[@character.animation_id]
  222.       animation(animation, true)
  223.       @character.animation_id = 0
  224.     end
  225.   end
  226. end
  227. class Sprite_Character_Shadow < RPG::Sprite
  228.   #--------------------------------------------------------------------------
  229.   # ● 初始化对像
  230.   #--------------------------------------------------------------------------
  231.   def initialize(viewport, character = nil)
  232.     super(viewport)
  233.     @character = character
  234.     self.bitmap = RPG::Cache.picture("shadow")
  235.     update
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● 更新画面
  239.   #--------------------------------------------------------------------------
  240.   def update
  241.     super
  242.     if $影子类型 == 3
  243.     if @character.character_name == ""
  244.     self.x = @character.screen_x-5000
  245.     self.y = @character.screen_y-5000
  246.     else
  247.     self.x = @character.screen_x-16
  248.     self.y = @character.screen_y-20
  249.     self.z = 10
  250.     self.opacity = 255
  251.     self.blend_type = @character.blend_type
  252.     self.bush_depth = @character.bush_depth
  253.     end
  254.     if @character.animation_id != 0
  255.       animation = $data_animations[@character.animation_id]
  256.       animation(animation, true)
  257.       @character.animation_id = 0
  258.     end
  259.     end
  260.   end
  261. end
  262. #==============================================================================
  263. # ■ Spriteset_Map
  264. #==============================================================================
  265. class Spriteset_Map
  266.   #--------------------------------------------------------------------------
  267.   # ● 初始化对像
  268.   #--------------------------------------------------------------------------
  269. def initialize
  270.     @viewport1 = Viewport.new(0, 0, 640, 480)
  271.     @viewport2 = Viewport.new(0, 0, 640, 480)
  272.     @viewport3 = Viewport.new(0, 0, 640, 480)
  273.     @viewport2.z = 200
  274.     @viewport3.z = 5000
  275.     @tilemap = Tilemap.new(@viewport1)
  276.     @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
  277.     for i in 0..6
  278.       autotile_name = $game_map.autotile_names[i]
  279.       @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
  280.     end
  281.     @tilemap.map_data = $game_map.data
  282.     @tilemap.priorities = $game_map.priorities
  283.     @panorama = Plane.new(@viewport1)
  284.     @panorama.z = -1000
  285.     @fog = Plane.new(@viewport1)
  286.     @fog.z = 3000
  287.     @character_sprites = []
  288.     for i in $game_map.events.keys.sort
  289.       s = Sprite_Character.new(@viewport1, $game_map.events[i])
  290.       @character_sprites.push(s)
  291.       s = Sprite_Character_Shadow.new(@viewport1, $game_map.events[i])
  292.       @character_sprites.push(s)
  293.       s = Sprite_Character_False.new(@viewport1, $game_map.events[i])
  294.       @character_sprites.push(s)
  295.     end
  296.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  297.     @character_sprites.push(Sprite_Character_False.new(@viewport1, $game_player))
  298.     @character_sprites.push(Sprite_Character_Shadow.new(@viewport1, $game_player))
  299.     @weather = RPG::Weather.new(@viewport1)
  300.     @picture_sprites = []
  301.     for i in 1..50
  302.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  303.         $game_screen.pictures[i]))
  304.     end
  305.     @timer_sprite = Sprite_Timer.new
  306.     update
  307.   end
  308. end
复制代码

另:
很不要脸的借用别人的图片来使用下~

叫这张shadow图片放在picture下,做为一般影子图!
在水中则有倒影图!切记需要改地形标志为1才有倒影
作者: 司马睿风    时间: 2008-7-30 07:53
以下引用★_茄孓于2008-7-29 12:04:35的发言:
引用下
[本贴由作者于 2008-7-29 12:05:26 最后编辑]

http://rpg.blue/viewthread.php?tid=95988
自己看下
作者: ★_茄孓    时间: 2008-7-30 18:01
不明白你什么意思,倒影只能在中出现了
上面的图我是没换{/bz}{/bz}
作者: 越前リョーマ    时间: 2008-7-30 21:27
以下引用★_茄孓于2008-7-30 10:01:02的发言:

不明白你什么意思,倒影只能在中出现了
上面的图我是没换

他的意思是你的和他的一样……
作者: 司马睿风    时间: 2008-7-30 22:29
话说前几天我在玩英雄传说4朱红的泪,里面的倒影就不错,站在高点(类似悬崖)的地方的边缘,底下的地上会有一半的影子
作者: 灯笼菜刀王    时间: 2008-8-1 03:47
以下引用司马睿风于2008-7-30 14:29:34的发言:

话说前几天我在玩英雄传说4朱红的泪,里面的倒影就不错,站在高点(类似悬崖)的地方的边缘,底下的地上会有一半的影子


那又要加个影子类型4了-。-
作者: 越前リョーマ    时间: 2008-8-1 03:55
以下引用灯笼菜刀王于2008-7-31 19:47:46的发言:


以下引用司马睿风于2008-7-30 14:29:34的发言:

话说前几天我在玩英雄传说4朱红的泪,里面的倒影就不错,站在高点(类似悬崖)的地方的边缘,底下的地上会有一半的影子



那又要加个影子类型4了-。-

ms很高难度……
作者: hide秀    时间: 2008-8-2 01:15
http://rpg.blue/viewthread.php?tid=95988

这个是讯雷进发过的
有借用脚本吗?
如果有 到底是谁借用谁的 请在脚本里说明一下
因为有2个影子脚本 说明清楚才能发布
作者: nerbird    时间: 2008-8-2 01:30
阳光的倒影应该是黑色的,水中倒影才是带色的
作者: ★_茄孓    时间: 2008-8-2 21:34
以下引用hide秀于2008-8-1 17:15:43的发言:


http://rpg.blue/viewthread.php?tid=95988

这个是讯雷进发过的
有借用脚本吗?
如果有 到底是谁借用谁的 请在脚本里说明一下
因为有2个影子脚本 说明清楚才能发布

回老大,我不是借用他的脚本。。
只是借用他的图片{/hx}{/hx}
以下引用nerbird于2008-8-1 17:30:03的发言:

阳光的倒影应该是黑色的,水中倒影才是带色的

的确是这样!!
但是脚本里有3种类型可选择
第三种则是比较真实点的!

作者: 青椒    时间: 2008-8-3 22:21
的确是有点怪怪的
作者: 风雪优游    时间: 2008-8-4 00:18
LULU修真帅,支持此脚本
作者: ONEWateR    时间: 2008-8-4 03:13


这图能说明一切问题
作者: ★_茄孓    时间: 2008-8-4 03:28
以下引用ONEWateR于2008-8-3 19:13:41的发言:



这图能说明一切问题

方向颠倒,难道是我RP了?{/bz}{/bz}
作者: 莉可    时间: 2008-8-5 22:49
提示: 作者被禁止或删除 内容自动屏蔽
作者: 灯笼菜刀王    时间: 2008-8-5 23:29
以下引用ONEWateR于2008-8-3 19:13:41的发言:

这图能说明一切问题


-。-这个就是使用地形标志判断出现的奇怪现象了,之前说过最好用铺事件的方式嘛~
作者: ONEWateR    时间: 2008-8-6 04:17
其实国外就有个倒影脚本,可以拿来学习学习 ^^




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1