- UID
- 104
- 帖子
- 8465
- 主题
- 169
- 精华
- 3
- 积分
- 13212
- 历练
- 7
- 声望
- 24
- 人气
- 2454
- 经验
- 12327
- 金钱
- 1203
- 注册时间
- 2009-8-27
- 最后登录
- 2024-11-24
- 在线时间
- 923 小时
- 阅读权限
- 100
TA的每日心情 | 开心 22 小时前 |
---|
签到天数: 891 天 [LV.10]以坛为家III - 精华
- 3
- 积分
- 13212
- 历练
- 7
- 声望
- 24
- 人气
- 2454
|
- #==============================================================================
- # ■ Scene_Title
- #------------------------------------------------------------------------------
- # 处理标题画面的类。
- #==============================================================================
- class Scene_Title
- WEATHER = 4 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
- MAXNUMBER = 18 # 天气图片数量
-
- WEATHER_FILE = "Graphics/Pictures/Title_starlong.png"
- # 自定义图片路径,这个文件可以从黑暗圣剑DEMO获得,是流星雨
-
- BLEND_TYPE = 1 # 合成方式(0:普通,1:加法,2:减法)
- WEATHER_X = 5 # X方向每回合减少象素
- WEATHER_Y = 5 # Y方向每回合减少象素
- WEATHER_OPACITY = 2 #每回合减低透明度
- START_OPACITY = 200 #出现时的透明度
- RAND_X = 1200 # 随机X范围
- RAND_Y = 600 # 随机Y范围
- HEIGHT = -600 # 出现时候的屏幕Y
- WIDTH = 100 # 出现时候的屏幕X
- #--------------------------------------------------------------------------
- # ● 住处理
- #--------------------------------------------------------------------------
- def main
- # 战斗测试的情况下
- if $BTEST
- battle_test
- return
- end
- # 载入数据库
- $data_actors = load_data("Data/Actors.rxdata")
- $data_classes = load_data("Data/Classes.rxdata")
- $data_skills = load_data("Data/Skills.rxdata")
- $data_items = load_data("Data/Items.rxdata")
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- $data_enemies = load_data("Data/Enemies.rxdata")
- $data_troops = load_data("Data/Troops.rxdata")
- $data_states = load_data("Data/States.rxdata")
- $data_animations = load_data("Data/Animations.rxdata")
- $data_tilesets = load_data("Data/Tilesets.rxdata")
- $data_common_events = load_data("Data/CommonEvents.rxdata")
- $data_system = load_data("Data/System.rxdata")
- # 生成系统对像
- $game_system = Game_System.new
- # 生成标题图形
- @sprite = Sprite.new
- @sprite.bitmap = RPG::Cache.title($data_system.title_name)
- @ox = 0
- @oy = 0
- color1 = Color.new(255, 255, 255, 255)
- color2 = Color.new(255, 255, 255, 128)
- @rain_bitmap = Bitmap.new(7, 56)
- for i in 0..6
- @rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
- end
- @storm_bitmap = Bitmap.new(34, 64)
- for i in 0..31
- @storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
- @storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
- @storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
- end
- @snow_bitmap = Bitmap.new(6, 6)
- @snow_bitmap.fill_rect(0, 1, 6, 4, color2)
- @snow_bitmap.fill_rect(1, 0, 4, 6, color2)
- @snow_bitmap.fill_rect(1, 2, 4, 2, color1)
- @snow_bitmap.fill_rect(2, 1, 2, 4, color1)
- @sprites = []
- for i in 1..40
- sprite = Sprite.new
- case WEATHER
- when 1
- sprite.bitmap = @rain_bitmap
- when 2
- sprite.bitmap = @storm_bitmap
- when 3
- sprite.bitmap = @snow_bitmap
- when 4
- sprite.bitmap = Bitmap.new(WEATHER_FILE)
- end
- sprite.z = 1000
- sprite.x = -1000
- sprite.y = -1000
- sprite.visible = (i <= MAXNUMBER)
- sprite.blend_type = BLEND_TYPE
- sprite.opacity = START_OPACITY
- @sprites.push(sprite)
- end
- weather_update
- # 生成命令窗口
- s1 = "新游戏"
- s2 = "继续"
- s3 = "退出"
- @command_window = Window_Command.new(192, [s1, s2, s3])
- @command_window.back_opacity = 160
- @command_window.x = 320 - @command_window.width / 2
- @command_window.y = 288
- @command_window.z = 1001
- # 判定继续的有效性
- # 存档文件一个也不存在的时候也调查
- # 有効为 @continue_enabled 为 true、无効为 false
- @continue_enabled = false
- for i in 0..3
- if FileTest.exist?("Save#{i+1}.rxdata")
- @continue_enabled = true
- end
- end
- # 继续为有效的情况下、光标停止在继续上
- # 无效的情况下、继续的文字显示为灰色
- if @continue_enabled
- @command_window.index = 1
- else
- @command_window.disable_item(1)
- end
- # 演奏标题 BGM
- $game_system.bgm_play($data_system.title_bgm)
- # 停止演奏 ME、BGS
- Audio.me_stop
- Audio.bgs_stop
- # 执行过渡
- Graphics.transition(25, "Graphics/Transitions/" +$data_system.battle_transition)
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面被切换就中断循环
- if $scene != self
- break
- end
- end
- # 装备过渡
- Graphics.freeze
- # 释放命令窗口
- @command_window.dispose
- # 释放标题图形
- @sprite.bitmap.dispose
- @sprite.dispose
- for sprite in @sprites
- sprite.dispose
- end
- @rain_bitmap.dispose
- @storm_bitmap.dispose
- @snow_bitmap.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新天气
- #--------------------------------------------------------------------------
- def weather_update
- return if WEATHER == 0
- for i in 1..MAXNUMBER
- sprite = @sprites[i]
- if sprite == nil
- break
- end
复制代码 |
|