强化标题界面[增加选项]+[特效]+[基本解说字幕]+[难度模式]
简介:该脚本整合了 66RPG 原有的一个标题“流星雨”特效,另外增加了一个难度模式选项,以及随着光标切换到不同选项,底部的字幕会随之改变。特别注意,难度模式选项可选,需要游戏目录下的 HARDMARK.HMF(可以自行更改名称)文件校验。如此,便可以让游戏实现二周目功能。需要生成的文件详见第二个脚本。
额外提示:二周目可以用开关设置。进入难度模式时额外打开两个开关(详见 311 行 与 312 行)。其中,闪光属性的设置可以为,数据库的状态增加一个闪光状态,BUFF 状态大家都会设置了吧?攻击力、防御力 150% 啥的就靠 DIY 了。然后在队伍设置事件页,条件分歧当闪光开关打开时敌人全体增加闪光 BUFF 即可。
使用方法:复制脚本,放到 Main 脚本的前面;如果有把握的话也可以直接替换掉 Scene_Title 那个渣脚本。
①标题脚本:#==============================================================================# ■ Scene_Title#------------------------------------------------------------------------------# 处理标题画面的类。#===============================================================================begin更改内容:· 增加天气效果,可以自由设定,目前为雨效果 by 66RPG· 增加难度模式选项,该选项由文件 HARDMODE.HMF 指定。该文件存在时则开启难度模式, 若文件不存在则选项不可用 by Ryusa· 取消了切换场景时 BGM 停止的指令 by 66RPG修改/Ryusa 参考/66RPG、宇文隳、SmilP 日期/2011 年 7 月 29 日=endclass Scene_TitleWEATHER = 1 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)MAXNUMBER = 18# 天气图片数量WEATHER_FILE = "Graphics/Pictures/TESTMODE.png"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 # 出现时候的屏幕YWIDTH = 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 = (i750 or y < -1000 or y > 500 sprite.x = rand(RAND_X) + WIDTH + @ox sprite.y = rand(RAND_Y) + HEIGHT + @oy sprite.opacity = START_OPACITY end endend#--------------------------------------------------------------------------# ● 刷新画面#--------------------------------------------------------------------------def update # 刷新命令窗口 @command_window.update # 按下 C 键的情况下 if Input.trigger?(Input::C) # 命令窗口的光标位置的分支 case @command_window.index when 0# 新游戏 command_new_game when 1# 继续 command_continue when 2# 难度模式 hardmode when 3# 退出 command_shutdown end end weather_updateend#--------------------------------------------------------------------------# ● 命令 : 新游戏#--------------------------------------------------------------------------def command_new_game # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 停止 BGM #Audio.bgm_stop # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 设置初期同伴位置 $game_party.setup_starting_members # 设置初期位置的地图 $game_map.setup($data_system.start_map_id) # 主角向初期位置移动 $game_player.moveto($data_system.start_x, $data_system.start_y) # 刷新主角 $game_player.refresh # 执行地图设置的 BGM 与 BGS 的自动切换 $game_map.autoplay # 刷新地图 (执行并行事件) $game_map.update # 切换地图画面 $scene = Scene_Map.newend#--------------------------------------------------------------------------# ● 命令 : 继续#--------------------------------------------------------------------------def command_continue # 继续无效的情况下 unless @continue_enabled # 演奏无效 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到读档画面 $scene = Scene_Load.newend#--------------------------------------------------------------------------# ● 命令 :难度模式#--------------------------------------------------------------------------def hardmode # 判定卡片是否存在,不存在则选项为灰色。已经在 125 行设定条件 # 卡片不存在的情况下 unless @hardmode_enabled # 演奏无效 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 停止 BGM #Audio.bgm_stop # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new # 打开指定开关,如果下面两行脚本放到前面则会被清空 $game_switches = true # 难度模式开关,会在窗口左上角显示 HARDMODE 字符 $game_switches = true # 闪光开关,敌人开启闪光状态,实力增强 $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $game_actors = Game_Actors.new # 设置初期同伴位置 $game_party.setup_starting_members # 设置初期位置的地图 $game_map.setup($data_system.start_map_id) # 主角向初期位置移动 $game_player.moveto($data_system.start_x, $data_system.start_y) # 刷新主角 $game_player.refresh # 执行地图设置的 BGM 与 BGS 的自动切换 $game_map.autoplay # 刷新地图 (执行并行事件) $game_map.update # 切换地图画面 $scene = Scene_Map.newend#--------------------------------------------------------------------------# ● 命令 : 退出#--------------------------------------------------------------------------def command_shutdown # 演奏确定 SE $game_system.se_play($data_system.decision_se) # BGM、BGS、ME 的淡入淡出 Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # 退出 $scene = nilend#--------------------------------------------------------------------------# ● 窗口:状态解说#--------------------------------------------------------------------------#--------------------------------------------------------------------------# ● 战斗测试#--------------------------------------------------------------------------def battle_test # 载入数据库 (战斗测试用) $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 设置战斗测试用同伴 $game_party.setup_battle_test_members # 设置队伍 ID、可以逃走标志、战斗背景 $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # 演奏战斗开始 BGM $game_system.se_play($data_system.battle_start_se) # 演奏战斗 BGM $game_system.bgm_play($game_system.battle_bgm) # 切换到战斗画面 $scene = Scene_Battle.newendend复制代码然后这份脚本是难度模式生成器。
该脚本需要在事件中调用,调用的参数为下面两行。
$Scene = Scene_HMark.new
$Scene.Writein()
②难度模式生成器#————————————————————#——————————————————————————————————————# Scene_HardModeWritein 难度模式文件生成器#————————————————————#——————————————————————————————————————# 制作 / Ryusa # 参考 / 尽头 宇文隳 絶倫少女class Scene_HMarkdef Writein() # 判断最终 BOSS 是否被消灭,(120 是消灭后打开的开关,可以自己改)如果没有,强行调用也没辙 if $game_switches == true ryusa = 1 # 将二进制字符“1”写入难度模式标记 HARDMARK.HMF save_data(ryusa , "HARDMARK.HMF") # 弹出窗口提示 print "已经生成难度模式标记" print "在标题界面可以选择难度模式" endendend复制代码③ 选项增加基本解说字幕(这份脚本是从“标题增加版权信息”改编的)
使用方法:复制代码在 Main 前面插入,放进去#————————————————————#——————————————————————————————————————# Scene_TitleEX 标题强化:选项增加基本解说字幕#————————————————————#——————————————————————————————————————# 改编 / 宇文隳module PLAN_COPYRIGHT# 标题选项解说COPYRIGHT_STR_ARY = ["★☆;开始新的游戏;☆★", "★☆;读取已存进度;☆★", "★☆;功能正在调试;☆★", "重置正式版"]FONT_NAME = ["华文细黑" , "华文楷体" , "黑体"] # フォントFONT_SIZE =20 # フォントサイズFONT_BOLD = false # 太字FONT_ITALIC = false # 斜体STR_COLOR = Color.new(200, 200, 200) # 文字の色DRAW_FRAME = true # 縁取りするFRAME_COLOR = Color.new(0, 0, 0) # 縁の色DRAW_X =-250 # X 座標修正値DRAW_Y =-0 # Y 座標修正値end#==============================================================================# ■ Scene_Title#==============================================================================class Scene_Title#--------------------------------------------------------------------------# ● メイン処理#--------------------------------------------------------------------------alias plan_copyrcight_main maindef main # 戦闘テストの場合 if $BTEST battle_test return end # スプライトの作成 @copyrcight_sprite = Sprite.new @copyrcight_sprite.z = 100 bitmap = Bitmap.new(32, 32) bitmap.font.name = PLAN_COPYRIGHT::FONT_NAME bitmap.font.size = PLAN_COPYRIGHT::FONT_SIZE bitmap.font.bold = PLAN_COPYRIGHT::FONT_BOLD #rect = bitmap.text_size(PLAN_COPYRIGHT::COPYRIGHT_STR) rect = bitmap.text_size(PLAN_COPYRIGHT::COPYRIGHT_STR_ARY) bitmap.dispose bitmap = nil @copyrcight_sprite.bitmap = Bitmap.new(rect.width, rect.height) @copyrcight_sprite.bitmap.font.name = PLAN_COPYRIGHT::FONT_NAME @copyrcight_sprite.bitmap.font.size = PLAN_COPYRIGHT::FONT_SIZE @copyrcight_sprite.bitmap.font.bold = PLAN_COPYRIGHT::FONT_BOLD @copyrcight_sprite.bitmap.font.italic = PLAN_COPYRIGHT::FONT_ITALIC str = PLAN_COPYRIGHT::COPYRIGHT_STR_ARY if PLAN_COPYRIGHT::DRAW_FRAME @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::FRAME_COLOR if defined?(@copyrcight_sprite.bitmap.draw_text_plan_frame) @copyrcight_sprite.bitmap.draw_text_plan_frame(0, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text_plan_frame(2, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text_plan_frame(0, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text_plan_frame(2, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::STR_COLOR @copyrcight_sprite.bitmap.draw_text_plan_frame(1, 1, rect.width, rect.height, str) else @copyrcight_sprite.bitmap.draw_text(0, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text(2, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text(0, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text(2, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::STR_COLOR @copyrcight_sprite.bitmap.draw_text(1, 1, rect.width, rect.height, str) end else @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::STR_COLOR @copyrcight_sprite.bitmap.draw_text(rect, str) end @copyrcight_sprite.x = 640 - rect.width + PLAN_COPYRIGHT::DRAW_X @copyrcight_sprite.y = 480 - rect.height + PLAN_COPYRIGHT::DRAW_Y # 元のメソッドに戻す plan_copyrcight_main # スプライトの解放 @copyrcight_sprite.bitmap.dispose @copyrcight_sprite.disposeend#--------------------------------------------------------------------------# ● フレーム更新#--------------------------------------------------------------------------alias plan_copyrcight_update updatedef update updateExtra # スプライトの更新 @copyrcight_sprite.update # 元のメソッドに戻す plan_copyrcight_updateend #--------------------------------------------------------------------------# ● 付くフレーム更新#--------------------------------------------------------------------------def updateExtra bitmap = Bitmap.new(32, 32) bitmap.font.name = PLAN_COPYRIGHT::FONT_NAME bitmap.font.size = PLAN_COPYRIGHT::FONT_SIZE bitmap.font.bold = PLAN_COPYRIGHT::FONT_BOLD str = PLAN_COPYRIGHT::COPYRIGHT_STR_ARY[@command_window.index] rect = bitmap.text_size(PLAN_COPYRIGHT::COPYRIGHT_STR_ARY[@command_window.index]) if PLAN_COPYRIGHT::DRAW_FRAME @copyrcight_sprite.bitmap.clear @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::FRAME_COLOR if defined?(@copyrcight_sprite.bitmap.draw_text_plan_frame) @copyrcight_sprite.bitmap.draw_text_plan_frame(0, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text_plan_frame(2, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text_plan_frame(0, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text_plan_frame(2, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::STR_COLOR @copyrcight_sprite.bitmap.draw_text_plan_frame(1, 1, rect.width, rect.height, str) else @copyrcight_sprite.bitmap.draw_text(0, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text(2, 0, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text(0, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.draw_text(2, 2, rect.width, rect.height, str) @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::STR_COLOR @copyrcight_sprite.bitmap.draw_text(1, 1, rect.width, rect.height, str) end else @copyrcight_sprite.bitmap.font.color = PLAN_COPYRIGHT::STR_COLOR @copyrcight_sprite.bitmap.draw_text(rect, str) endendend复制代码
本帖来自P1论坛作者YamazakiRyusa,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=201031若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]