设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1981|回复: 0
打印 上一主题 下一主题

[已经解决] 有没人能把此系统改为ACE可用的?

[复制链接]

Lv2.观梦者

梦石
0
星屑
783
在线时间
924 小时
注册时间
2006-6-26
帖子
1530
跳转到指定楼层
1
发表于 2012-8-29 17:15:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 1243852 于 2012-8-29 17:17 编辑

  1. # 设置烛光种类数
  2. CANDLE_NUMBER = 2

  3. # 设置控制开关,不用的话设0
  4. CANDLE_SWITCH = 4

  5. #--------------------------------------------------------------------------
  6. # ● 开启或关闭烛光
  7. #--------------------------------------------------------------------------
  8. def candlelight(on=true)
  9.   $candlelight_on = $game_switches[CANDLE_SWITCH] = on
  10.   if on
  11.     # 生成黑色画面
  12.     $black_rect = Sprite.new
  13.     $black_rect.bitmap = Bitmap.new(544, 416)
  14.     $black_rect.bitmap.fill_rect(0, 0, 544, 416, Color.new(200, 200, 200))
  15.     $black_rect.blend_type = 2
  16.    
  17.     # 黑色透明度,决定黑暗的程度
  18.     $black_rect.opacity = 180
  19.    
  20.     # 生成烛光
  21.     $candle_rect = Array.new(CANDLE_NUMBER+1).map{|sprite| sprite=Sprite.new}
  22. #===============================================================================]
  23. #                               烛光在此设置
  24. #===============================================================================
  25.     # 指定第一种烛光
  26.     $candle_rect[1].bitmap = Cache.picture("write1")
  27.    
  28.     # 指定第二种烛光
  29.     $candle_rect[2].bitmap = Cache.picture("write2")
  30. #===============================================================================
  31. #===============================================================================
  32.     $candle_rect.each {|sprite|
  33.         if sprite.bitmap
  34.           sprite.visible = false
  35.           sprite.ox, sprite.oy = sprite.bitmap.width/2, sprite.bitmap.height/2
  36.         end}
  37.   else
  38.     # 释放黑色画面和所有烛光
  39.     $black_rect.dispose
  40.     $candle_rect.each {|sprite| sprite.dispose}
  41.     $game_lighterlist.clear
  42.   end
  43. end
  44. #--------------------------------------------------------------------------
  45. # ● 设置有烛光的角色
  46. #     candle_index : 烛光编号
  47. #     object       : 角色编号,可以为数字或是数字数组
  48. #--------------------------------------------------------------------------
  49. def candles(candle_index, object)
  50.   $game_lighterlist ||= []
  51.   $game_lighterlist[candle_index] ||= []
  52.   if object.is_a?(Integer)
  53.     $game_lighterlist[candle_index] << object
  54.   elsif object.is_a?(Array)
  55.     $game_lighterlist[candle_index] += object
  56.   end
  57.   # 移除重复的角色
  58.   $game_lighterlist[candle_index].uniq!
  59.   # 开启烛光功能
  60.   candlelight unless $candlelight_on
  61. end
  62. #--------------------------------------------------------------------------
  63. # ● 初始化烛光
  64. #--------------------------------------------------------------------------
  65. def initialize_candle
  66.   for k in 1...$candle_rect.size
  67.     next unless $game_lighterlist[k]
  68.     for j in $game_lighterlist[k]
  69.       ch = j == 0 ? $game_player : $game_map.events[j]
  70.       $candle_rect[k].x = ch.screen_x
  71.       $candle_rect[k].y = ch.screen_y - 16
  72.       lsx = $candle_rect[k].x - $candle_rect[k].bitmap.width / 2
  73.       lsy = $candle_rect[k].y - $candle_rect[k].bitmap.height / 2
  74.       $black_rect.bitmap.blt(lsx, lsy, $candle_rect[k].bitmap, $black_rect.bitmap.rect)
  75.     end
  76.   end
  77. end
  78. #--------------------------------------------------------------------------
  79. # ● 更新烛光
  80. #--------------------------------------------------------------------------
  81. def update_candle
  82.   if $game_lighterlist != []
  83.     light = []
  84.     $game_lighterlist.each{|i| light+=i if i}
  85.     light.each do |i|
  86.       ch = i == 0 ? $game_player : $game_map.events[i]
  87.       unless ch.moving_judge?
  88.         $black_rect.bitmap.fill_rect(0, 0, 544, 416, Color.new(200, 200, 200))
  89.         initialize_candle
  90.       end
  91.       break
  92.     end
  93.   end
  94. end

  95. class Game_Character
  96.   #--------------------------------------------------------------------------
  97.   # ● 判断移动
  98.   #--------------------------------------------------------------------------
  99.   def moving_judge?
  100.     return (!stopping? or (@pattern != @original_pattern))
  101.   end
  102. end
  103. class Game_Map
  104.   #--------------------------------------------------------------------------
  105.   # ● 刷新烛光
  106.   #--------------------------------------------------------------------------
  107.   alias update_candle_system update
  108.   def update
  109.     if $candlelight_on
  110.       update_candle
  111.       $candlelight_on = false unless $game_switches[CANDLE_SWITCH]
  112.       candlelight(false) unless $candlelight_on
  113.     end
  114.     update_candle_system
  115.   end
  116. end   
  117. class Scene_Map < Scene_Base
  118.   #--------------------------------------------------------------------------
  119.   # ● 生成烛光
  120.   #--------------------------------------------------------------------------
  121.   alias candle_system_start start
  122.   def start
  123.     candle_system_start
  124.     candlelight if $candlelight_on
  125.     initialize_candle if $candlelight_on
  126.   end
  127. end
复制代码
这是VX的烛光系统,我试过用事件,放一张烛光图片进去,来做烛光系统,但效果超级不好。。亮度并不像真正的光亮,我想,还是要用脚本来合成的光,要好些吧。





VA烛光系统已经找到,不好意思,请版主删帖。
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-10 07:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表