├── .gitattributes ├── .gitignore ├── README.md └── scripts ├── VIPArcher基础设置.rb ├── 事件全地图自主移动.rb ├── 修正卷动事件1像素偏移.rb ├── 全局变量开关.rb ├── 八方向移动.rb ├── 判断当前位置信息.rb ├── 剧情中的黑色边框.rb ├── 区域限定道具使用.rb ├── 固定远景图.rb ├── 地图卷动扩展.rb ├── 战斗中被动效果.rb ├── 控制暗色对话框.rb ├── 控制符颜色扩展.rb ├── 描绘物品品质颜色.rb ├── 敌人掉落物扩展.rb ├── 椅子.rb ├── 游戏版本检查.rb ├── 窗口滑动美化.rb ├── 自定义物品分类.rb ├── 装备栏风格扩展.rb ├── 设置队员没死就无敌的角色或敌人.rb ├── 识别行走图帧数.rb ├── 详细帮助窗口加强.rb ├── 足音.rb ├── 跳过标题.rb ├── 选项窗口光标.rb ├── 镜像.rb ├── 队伍掉落率金钱获得率扩展.rb ├── 队伍负重系统.rb ├── 限时显示选项.rb ├── 隐藏房间黑块遮罩.rb └── 面向事件显示心情.rb /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | <<<<<<< HEAD 4 | 5 | # Custom for Visual Studio 6 | *.cs diff=csharp 7 | *.sln merge=union 8 | ======= 9 | # Custom for Visual Studio 10 | *.cs diff=csharp 11 | *.sln merge=union 12 | >>>>>>> 4916f4df2f263652eae5a4dc3e6450831bd1eaff 13 | *.csproj merge=union 14 | *.vbproj merge=union 15 | *.fsproj merge=union 16 | *.dbproj merge=union 17 | <<<<<<< HEAD 18 | 19 | # Standard to msysgit 20 | *.doc diff=astextplain 21 | *.DOC diff=astextplain 22 | *.docx diff=astextplain 23 | *.DOCX diff=astextplain 24 | *.dot diff=astextplain 25 | *.DOT diff=astextplain 26 | *.pdf diff=astextplain 27 | *.PDF diff=astextplain 28 | *.rtf diff=astextplain 29 | *.RTF diff=astextplain 30 | ======= 31 | # Standard to msysgit 32 | *.doc diff=astextplain 33 | *.DOC diff=astextplain 34 | *.docx diff=astextplain 35 | *.DOCX diff=astextplain 36 | *.dot diff=astextplain 37 | *.DOT diff=astextplain 38 | *.pdf diff=astextplain 39 | *.PDF diff=astextplain 40 | *.rtf diff=astextplain 41 | *.RTF diff=astextplain 42 | >>>>>>> 4916f4df2f263652eae5a4dc3e6450831bd1eaff 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | *.lnk 4 | /.config 5 | /coverage/ 6 | /InstalledFiles 7 | /pkg/ 8 | /spec/reports/ 9 | /test/tmp/ 10 | /test/version_tmp/ 11 | /tmp/ 12 | <<<<<<< HEAD 13 | 14 | ======= 15 | >>>>>>> 4916f4df2f263652eae5a4dc3e6450831bd1eaff 16 | ## Documentation cache and generated files: 17 | /.yardoc/ 18 | /_yardoc/ 19 | /doc/ 20 | /rdoc/ 21 | <<<<<<< HEAD 22 | 23 | ## Environment normalisation: 24 | /.bundle/ 25 | /lib/bundler/man/ 26 | 27 | ======= 28 | ## Environment normalisation: 29 | /.bundle/ 30 | /lib/bundler/man/ 31 | >>>>>>> 4916f4df2f263652eae5a4dc3e6450831bd1eaff 32 | # for a library or gem, you might want to ignore these files since the code is 33 | # intended to run in multiple environments; otherwise, check them in: 34 | # Gemfile.lock 35 | # .ruby-version 36 | # .ruby-gemset 37 | <<<<<<< HEAD 38 | 39 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 40 | .rvmrc 41 | ======= 42 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 43 | .rvmrc 44 | >>>>>>> 4916f4df2f263652eae5a4dc3e6450831bd1eaff 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | VIPArcher 的 RGSS 脚本仓库。 2 | === 3 | 4 | 5 | **脚本使用规约(点击文字显示详细内容):** 6 | 7 | ------ 8 | 9 | > * [基本规则](http://rmtemp.lofter.com/post/3e26fe_156e50a) 10 | > * [需要署名](http://rmtemp.lofter.com/post/3e26fe_156e50f) 11 | > * [不需要报告](http://rmtemp.lofter.com/post/3e26fe_156f16f) 12 | > * [自由地用于任何游戏中](http://rmtemp.lofter.com/post/3e26fe_156f11b) 13 | > * [允许加工](http://rmtemp.lofter.com/post/3e26fe_156f131) 14 | > * [禁止转载·二次配布(只发一个链接是可以的)](http://rmtemp.lofter.com/post/3e26fe_167cd92) 15 | 16 | ------ 17 | 18 | > [![RPG制作大师授权素材推广计划](http://ww3.sinaimg.cn/large/c5e47d21gw1eh6kvhzoy2j20b402sdg5.jpg)](http://rmproject.lofter.com/hello) 19 | > * [顺便安利一下RPG制作大师授权素材推广计划](http://rmproject.lofter.com/hello) 20 | 21 | ------ 22 | -------------------------------------------------------------------------------- /scripts/VIPArcher基础设置.rb: -------------------------------------------------------------------------------- 1 | module VIPArcher 2 | #-------------------------------------------------------------------------- 3 | # ● 需要的 Windows API 函数 4 | #-------------------------------------------------------------------------- 5 | GetWindowThreadProcessId = Win32API.new('user32', 'GetWindowThreadProcessId', 'lp', 'l') 6 | GetWindow = Win32API.new('user32', 'GetWindow', 'll', 'l') 7 | GetClassName = Win32API.new('user32', 'GetClassName', 'lpl', 'l') 8 | GetWindowText = Win32API.new('user32', 'GetWindowText', 'lpl', 'l') 9 | GetCurrentThreadId = Win32API.new('kernel32', 'GetCurrentThreadId', 'V', 'l') 10 | GetForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', 'V', 'l') 11 | ShellExecuteA = Win32API.new('shell32', 'ShellExecuteA', 'pppppi', 'i') 12 | #-------------------------------------------------------------------------- 13 | # ● 获取窗口句柄 by: 紫苏 14 | #-------------------------------------------------------------------------- 15 | def self.get_window_handle 16 | threadID = GetCurrentThreadId.call 17 | hWnd = GetWindow.call(GetForegroundWindow.call, 0) 18 | while hWnd != 0 19 | if threadID == GetWindowThreadProcessId.call(hWnd, 0) 20 | className = " " * 11 21 | GetClassName.call(hWnd, className, 12) 22 | break if className == "RGSS Player" 23 | end 24 | hWnd = GetWindow.call(hWnd, 2) 25 | end 26 | return hWnd 27 | end 28 | #-------------------------------------------------------------------------- 29 | # ● 打开地址 30 | # VIPArcher.open_url(addr) 31 | #-------------------------------------------------------------------------- 32 | def self.open_url(addr) 33 | ShellExecuteA.call(0,'open',addr,0, 0, 1) 34 | end 35 | end 36 | class Game_Interpreter 37 | #-------------------------------------------------------------------------- 38 | # ● 获取事件显示的图片的 Bitmap 对象 不存在则返回 nil 39 | #-------------------------------------------------------------------------- 40 | def get_bitmap(id = 0) 41 | spriteset = SceneManager.scene.instance_variable_get(:@spriteset) 42 | sprite = spriteset.instance_variable_get(:@picture_sprites)[id] 43 | sprite ? sprite.bitmap : nil 44 | end 45 | end 46 | #============================================================================== 47 | # Game.ini 配置文件读取及设置 48 | #============================================================================== 49 | class IniFile 50 | #-------------------------------------------------------------------------- 51 | # ● 定义实例变量 52 | #-------------------------------------------------------------------------- 53 | attr_reader :filename 54 | #-------------------------------------------------------------------------- 55 | # ● Win32API 56 | #-------------------------------------------------------------------------- 57 | GetPrivateProfileString = Win32API.new('kernel32','GetPrivateProfileString' , 'ppppip', 'i') 58 | WritePrivateProfileString = Win32API.new('kernel32','WritePrivateProfileString', 'pppp' , 'i') 59 | #-------------------------------------------------------------------------- 60 | # ● 初始化对象 61 | #-------------------------------------------------------------------------- 62 | def initialize(filename = './Game.ini') 63 | @filename = filename 64 | end 65 | #-------------------------------------------------------------------------- 66 | # ● 获取配置 67 | #-------------------------------------------------------------------------- 68 | def [](section, key, default_value = '') 69 | l = GetPrivateProfileString.call(section, key, default_value, 70 | buffer = [].pack('x256'), buffer.size, @filename); buffer[0, l] 71 | end 72 | #-------------------------------------------------------------------------- 73 | # ● 设置配置 74 | #-------------------------------------------------------------------------- 75 | def []=(section, key, value) 76 | WritePrivateProfileString.call(section, key, value.to_s, @filename) 77 | end 78 | end 79 | class String 80 | #-------------------------------------------------------------------------- 81 | # ● 常量定义 82 | #-------------------------------------------------------------------------- 83 | MultiByteToWideChar = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i') 84 | WideCharToMultiByte = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i') 85 | Codepages = { 86 | :System => 0, :UTF7 => 65000, :UTF8 => 65001, 87 | :S_JIS => 932, :GB2312 => 936, :BIG5 => 950, 88 | } 89 | #-------------------------------------------------------------------------- 90 | # ● 伪 iconv 编码转换 91 | #-------------------------------------------------------------------------- 92 | # s : 原始编码,可使用 Codepages 中的符号或者直接使用代码页值。 93 | # d : 目标编码,同上。 94 | #-------------------------------------------------------------------------- 95 | def iconv s, d 96 | src = s.is_a?(Symbol)? Codepages[s] : s 97 | dest = d.is_a?(Symbol)? Codepages[d] : d 98 | len = MultiByteToWideChar.call src, 0, self, -1, nil, 0 99 | buf = "\0" * (len * 2) 100 | MultiByteToWideChar.call src, 0, self, -1, buf, buf.size / 2 101 | len = WideCharToMultiByte.call dest, 0, buf, -1, nil, 0, nil, nil 102 | ret = "\0" * len 103 | WideCharToMultiByte.call dest, 0, buf, -1, ret, ret.size, nil, nil 104 | self.respond_to?(:force_encoding) ? 105 | ret.force_encoding("ASCII-8BIT").delete("\000") : ret.delete("\000") 106 | end 107 | #-------------------------------------------------------------------------- 108 | # ● 快捷方式:从 ANSI 转为 UTF-8 编码 109 | #-------------------------------------------------------------------------- 110 | def s2u 111 | self.respond_to?(:force_encoding) ? 112 | iconv(:System, :UTF8).force_encoding("utf-8") : iconv(:System, :UTF8) 113 | end 114 | #-------------------------------------------------------------------------- 115 | # ● 快捷方式:从 UTF-8 转为 ANSI 编码 116 | #-------------------------------------------------------------------------- 117 | def u2s 118 | iconv(:UTF8, :System) 119 | end 120 | end 121 | #-------------------------------------------------------------------------- 122 | # ● 备注的读取 123 | #-------------------------------------------------------------------------- 124 | class RPG::BaseItem 125 | #-------------------------------------------------------------------------- 126 | # ● 读取备注的基本方法 127 | # note : 备注文字 128 | # default : 缺省值 129 | #-------------------------------------------------------------------------- 130 | def renote(note,default = nil) 131 | result = /<#{note}\s+(\S+)\s*>/ =~ @note ? $1 : default 132 | result 133 | end 134 | end 135 | class Bitmap 136 | #-------------------------------------------------------------------------- 137 | # ● 由白色渐变到实际的字体颜色的渐变字 138 | # level : 渐变等级,值越高效果越差。效率越好。不可为 0 139 | #-------------------------------------------------------------------------- 140 | def draw_gradient_text(x, y, w, h, str, align = 0, level = 1) 141 | if font.color == Color.new(255, 255, 255) 142 | draw_text(x, y, w, h, str, align); return self 143 | end; buffer, buffer.font = Bitmap.new(w, h), font.dup 144 | delta = (alpha = font.color.alpha) / h * level 145 | buffer.font.out_color, buffer.font.shadow = Color.new, false 146 | rect, buffer.font.color = Rect.new(0, 0, w, level), Color.new(255, 255, 255) 147 | draw_text(x, y, w, h, str, align); buffer.draw_text(0, 0, w, h, str, align) 148 | y.upto(y + h) { |n| next unless n % level == 0 149 | blt(x, n, buffer, rect, alpha -= delta); rect.y += level 150 | }; buffer.dispose; self 151 | end 152 | end 153 | -------------------------------------------------------------------------------- /scripts/事件全地图自主移动.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 事件全地图自主移动 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 说明: 7 | # 事件内容里注释有 的事件可以全地图自主移动,不会因为不在视 8 | # 野范(画面)围内而停下,(默认事件是不在视野范围内就停止自主移动的。 9 | #============================================================================== 10 | $VIPArcherScript ||= {};$VIPArcherScript[:map_self_movem] = 20150118 11 | #------------------------------------------------------------------------------- 12 | class Game_Event 13 | #-------------------------------------------------------------------------- 14 | # ● 自动移动的更新 15 | #-------------------------------------------------------------------------- 16 | alias self_movement update_self_movement 17 | def update_self_movement 18 | return self_movement if note_move? 19 | if @stop_count > stop_count_threshold 20 | case @move_type 21 | when 1 then move_type_random 22 | when 2 then move_type_toward_player 23 | when 3 then move_type_custom 24 | end 25 | end 26 | end 27 | #-------------------------------------------------------------------------- 28 | # ● 判定是否注释有全地图自主移动 29 | #-------------------------------------------------------------------------- 30 | def note_move? 31 | return true if @list.nil? 32 | @list.each do |command| 33 | if command.code == 108 or command.code == 408 34 | command.parameters.each do |line| 35 | return false if line.include?("") 36 | end 37 | end 38 | end 39 | end 40 | end -------------------------------------------------------------------------------- /scripts/修正卷动事件1像素偏移.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # ■ 修正卷动地图时,事件位置偏移1像素的bug 3 | # by :VIPArcher [email: VIPArcher@sina.com] 4 | # -- Project1 论坛:https://rpg.blue/ 使用或转载请保留以上信息。 5 | #============================================================================== 6 | class Game_Map 7 | def display_x;(@display_x * 32).floor.to_f / 32 end # 显示 X 坐标 8 | def display_y;(@display_y * 32).floor.to_f / 32 end # 显示 Y 坐标 9 | #-------------------------------------------------------------------------- 10 | # ● 计算显示坐标的剩余 X 坐标 11 | #-------------------------------------------------------------------------- 12 | alias fix_adjust_x adjust_x 13 | def adjust_x(x) @display_x = display_x; fix_adjust_x(x) end 14 | #-------------------------------------------------------------------------- 15 | # ● 计算显示坐标的剩余 Y 坐标 16 | #-------------------------------------------------------------------------- 17 | alias fix_adjust_y adjust_y 18 | def adjust_y(y) @display_y = display_y; fix_adjust_y(y) end 19 | end 20 | -------------------------------------------------------------------------------- /scripts/全局变量开关.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # 全局变量开关 3 | # By:VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #=============================================================================== 6 | # 说明: 7 | # 把所有开关变量储存到一个文件中,开始新游戏时或者读档时自动载入该文件中设定好的 8 | # 某些开关变量,应该也可以用于制作多结局多周目之类的功能。通关一个结局时事件脚本 9 | # 调用 save_vs_data 一下就可以把当前的开关变量储存到一个文件中。 10 | #=============================================================================== 11 | $VIPArcherScript ||= {};$VIPArcherScript[:save_varsw] = 20150121 12 | #------------------------------------------------------------------------------- 13 | module VIPArcher end 14 | #============================================================================== 15 | # ☆ 设定部分 ☆ 16 | #============================================================================== 17 | module VIPArcher::GLOBAL 18 | FILEURL = "Saves" #储存数据的文件夹 19 | NAME = "System_Save.rvdata2" #储存数据的文件名 20 | VAR = [1,2,3] # 新游戏/读档时载入的变量 21 | SW = [1,2,3] # 新游戏/读档时载入的开关 22 | end 23 | #============================================================================== 24 | # ★ 设定结束 ★ 25 | #============================================================================== 26 | module VIPArcher::GLOBAL 27 | FILENAME = FILEURL + "/" + NAME 28 | #-------------------------------------------------------------------------- 29 | # ● 储存开关变量数据 30 | #-------------------------------------------------------------------------- 31 | def self.save_data 32 | Dir.mkdir(FILEURL) unless FileTest.exist?(FILEURL) 33 | File.open(FILENAME , "wb") do |file| 34 | Marshal.dump(make_contents, file) 35 | end 36 | end 37 | #-------------------------------------------------------------------------- 38 | # ● 获取开关变量数据 39 | #-------------------------------------------------------------------------- 40 | def self.make_contents 41 | contents = {} 42 | contents[:switches] = $game_switches 43 | contents[:variable] = $game_variables 44 | contents 45 | end 46 | #-------------------------------------------------------------------------- 47 | # ● 读取变量数据 48 | #-------------------------------------------------------------------------- 49 | def self.load_var(id) 50 | File.open(FILENAME , "rb") do |file| 51 | game_variables = Marshal.load(file)[:variable] 52 | $game_variables[id] = game_variables[id] 53 | end ; rescue 54 | end 55 | #-------------------------------------------------------------------------- 56 | # ● 读取开关数据 57 | #-------------------------------------------------------------------------- 58 | def self.load_sw(id) 59 | File.open(FILENAME , "rb") do |file| 60 | game_switches = Marshal.load(file)[:switches] 61 | $game_switches[id] = game_switches[id] 62 | end ; rescue 63 | end 64 | #-------------------------------------------------------------------------- 65 | # ● 载入 VAR 和 SW 的开关和变量 66 | #-------------------------------------------------------------------------- 67 | def self.load_game_versw 68 | VAR.each { |id| load_var(id) } ; SW.each { |id| load_sw(id) } 69 | end 70 | end 71 | #------------------------------------------------------------------------------- 72 | class << DataManager 73 | #-------------------------------------------------------------------------- 74 | # ● 设置新游戏 75 | #-------------------------------------------------------------------------- 76 | alias_method :new_game_data , :setup_new_game 77 | def setup_new_game 78 | new_game_data ; VIPArcher::GLOBAL.load_game_versw 79 | end 80 | end 81 | #------------------------------------------------------------------------------- 82 | class Game_System 83 | #-------------------------------------------------------------------------- 84 | # ● 读档后的处理 85 | #-------------------------------------------------------------------------- 86 | alias_method :after_load_data , :on_after_load 87 | def on_after_load 88 | after_load_data ; VIPArcher::GLOBAL.load_game_versw 89 | end 90 | end 91 | #------------------------------------------------------------------------------- 92 | class Game_Interpreter 93 | #-------------------------------------------------------------------------- 94 | # ● 储存开关变量数据 95 | #-------------------------------------------------------------------------- 96 | def save_vs_data ; VIPArcher::GLOBAL.save_data end 97 | #-------------------------------------------------------------------------- 98 | # ● 读取变量数据 99 | #-------------------------------------------------------------------------- 100 | def load_var(*args) 101 | args.each { |id| VIPArcher::GLOBAL.load_var(id) } 102 | end 103 | #-------------------------------------------------------------------------- 104 | # ● 读取开关数据 105 | #-------------------------------------------------------------------------- 106 | def load_sw(*args) 107 | args.each { |id| VIPArcher::GLOBAL.load_sw(id) } 108 | end 109 | end -------------------------------------------------------------------------------- /scripts/八方向移动.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # ■ 八向移动待机行走图动画扩展 3 | # by :VIPArcher [email: VIPArcher@sina.com] 4 | # -- Project1 论坛:https://rpg.blue/ 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # ■ 使用说明: 7 | # 行走图素材文件名最前面添加 '@' 符号视为该角色/事件使用八方向行走图 8 | # 需为其配置对应的其他形态的行走图文件,文件名后缀规则请看设定部分 9 | # 例如 $@Actor1.png / @Actor1.png 10 | # 文件名中带上 [f帧数#默认帧] 来控制行走图动画的帧数和停下时使用的帧 11 | # 例如 $@Actor[f8#4].png / @Actor1[f8#4].png 12 | # 事件也要使用待机动画需要在事件页(当前页)中备注上 13 | # 事件的移动速度超过 5 则使用奔跑行走图 14 | #============================================================================== 15 | $VIPArcherScript ||= {};$VIPArcherScript[:dir8_anime] = 20181212 16 | #============================================================================== 17 | # ★ 设定部分 ★ 18 | #============================================================================== 19 | module VIPArcher end 20 | module VIPArcher::DIR8_ANIME 21 | # 配置开始 22 | DIR8_OFF_SW = 0 # 控制关闭八方向行走的开关 23 | IDLE_ANIME_SW = 0 # 控制关闭待机动画的开关 24 | DASH_ANIME_SW = 0 # 控制关闭奔跑动画的开关 25 | IDLE_TIME = 120 # 静止后进入待机动画的时间(帧) 26 | RIDLE_TIME = 120 # 待机等待时间浮动值(上下浮动该值一半)默认即 60 - 180 帧 27 | ANIME_TIME = 1 # 待机动画循环次数 28 | GAP_TIME = 120 # 两次待机动画之间的时间间隔 29 | IDLE_NOTE = '' # 事件使用待机动画的备注 30 | DASH4_AFFIX = '_DASH' # 奔跑普通行走图后缀 31 | IDLE4_AFFIX = '_IDLE' # 待机普通行走图后缀 32 | DIRE8_AFFIX = '_8D' # 普通斜向行走图后缀 33 | DASH8_AFFIX = '_DASH_8D' # 奔跑斜向行走图后缀(此条仅参考命名,没有实际作用) 34 | IDLE8_AFFIX = '_IDLE_8D' # 待机斜向行走图后缀(此条仅参考命名,没有实际作用) 35 | # 配置结束 36 | #-------------------------------------------------------------------------- 37 | # ● 判断是否多帧 38 | #-------------------------------------------------------------------------- 39 | def is_multi_frames? 40 | character_name =~ /\[f\d+#?\d*\]/i 41 | end 42 | #-------------------------------------------------------------------------- 43 | # ● 获取帧数 44 | #-------------------------------------------------------------------------- 45 | def get_frame(character_name) 46 | character_name =~ /\[f(\d+)#?\d*\]/i ? $1.to_i : 4 47 | end 48 | #-------------------------------------------------------------------------- 49 | # ● 获取原图案(静止时矫正帧) 50 | #-------------------------------------------------------------------------- 51 | def get_halt_name(character_name) 52 | character_name =~ /\[f\d+#(\d+)\]/i ? $1.to_i : 1 53 | end 54 | end 55 | #============================================================================== 56 | # ■ Game_Player 57 | #============================================================================== 58 | class Game_Player 59 | include VIPArcher::DIR8_ANIME 60 | #-------------------------------------------------------------------------- 61 | # ● 由方向键移动 62 | #-------------------------------------------------------------------------- 63 | def move_by_input 64 | return if !movable? || $game_map.interpreter.running? 65 | if [1, 3, 7, 9].include?(Input.dir8) 66 | case Input.dir8 67 | when 1 then move_diagonal(4, 2) 68 | when 3 then move_diagonal(6, 2) 69 | when 7 then move_diagonal(4, 8) 70 | when 9 then move_diagonal(6, 8) 71 | end; return if @move_succeed 72 | end unless $game_switches[DIR8_OFF_SW] 73 | move_straight(Input.dir4) if Input.dir4 > 0 74 | end 75 | #-------------------------------------------------------------------------- 76 | # ● 是否奔跑中 77 | #-------------------------------------------------------------------------- 78 | def is_dash? 79 | dash? && @stop_count.zero? 80 | end 81 | #-------------------------------------------------------------------------- 82 | # ● 刷新 83 | #-------------------------------------------------------------------------- 84 | alias set_frame_refresh refresh 85 | def refresh 86 | set_frame_refresh 87 | @frame = get_frame(@character_name) 88 | @original_pattern = get_halt_name(@character_name) 89 | end 90 | end 91 | class Game_Follower 92 | #-------------------------------------------------------------------------- 93 | # ● 是否奔跑中 94 | #-------------------------------------------------------------------------- 95 | def is_dash? 96 | $game_player.is_dash? 97 | end 98 | #-------------------------------------------------------------------------- 99 | # ● 刷新 100 | #-------------------------------------------------------------------------- 101 | alias set_frame_refresh refresh 102 | def refresh 103 | set_frame_refresh 104 | @frame = get_frame(@character_name) 105 | @original_pattern = get_halt_name(@character_name) 106 | end 107 | #-------------------------------------------------------------------------- 108 | # ● 更新画面 109 | # * 使队员待机动画不同步,没用alias,如有冲突,请把该脚本放置被冲突脚本上面 110 | #-------------------------------------------------------------------------- 111 | def update 112 | @move_speed = $game_player.real_move_speed 113 | @transparent = $game_player.transparent 114 | @walk_anime = $game_player.walk_anime 115 | @step_anime = @step_anime #踏步属性不继承队伍 116 | @direction_fix = $game_player.direction_fix 117 | @opacity = $game_player.opacity 118 | @blend_type = $game_player.blend_type 119 | super 120 | end 121 | end 122 | class Game_Event 123 | #-------------------------------------------------------------------------- 124 | # ● 是否奔跑中 125 | #-------------------------------------------------------------------------- 126 | def is_dash? 127 | !@locked && @move_speed >= 5 && @stop_count.zero? 128 | end 129 | #-------------------------------------------------------------------------- 130 | # ● 是否待机动画 131 | #-------------------------------------------------------------------------- 132 | def idle_anime? 133 | @idle_note && @idle_anime 134 | end 135 | #-------------------------------------------------------------------------- 136 | # ● 刷新 137 | #-------------------------------------------------------------------------- 138 | alias set_frame_refresh refresh 139 | def refresh 140 | set_frame_refresh 141 | @frame = get_frame(@character_name) 142 | @original_pattern = get_halt_name(@character_name) 143 | @list.each do |command| 144 | if [108, 408].include?(command.code) 145 | return @idle_note = true if command.parameters.any? do |line| 146 | line =~ /#{IDLE_NOTE}/i 147 | end 148 | end 149 | end if @list 150 | end 151 | end 152 | #============================================================================== 153 | # ■ Game_CharacterBase 154 | #============================================================================== 155 | class Game_CharacterBase 156 | include VIPArcher::DIR8_ANIME 157 | attr_reader :frame 158 | attr_reader :static_anime 159 | attr_accessor :idle_anime 160 | #-------------------------------------------------------------------------- 161 | # ● 更新画面 162 | #-------------------------------------------------------------------------- 163 | alias dir8_update update 164 | def update 165 | dir8_update 166 | return if $game_switches[IDLE_ANIME_SW] 167 | return unless idle_anime? 168 | @step_anime = update_static_anime 169 | end 170 | #-------------------------------------------------------------------------- 171 | # ● 更新待机动画 172 | #-------------------------------------------------------------------------- 173 | def update_static_anime 174 | case @stop_count 175 | when static_anime_idle_time...(static_anime_idle_time + idle_anime_time) 176 | @static_anime = true 177 | when static_anime_idle_time + idle_anime_time 178 | @stop_count = static_anime_idle_time - GAP_TIME 179 | @pattern = @original_pattern 180 | @static_anime = false 181 | else @static_anime = false end 182 | end 183 | #-------------------------------------------------------------------------- 184 | # ● 进入待机前等待时间获取 185 | #-------------------------------------------------------------------------- 186 | def static_anime_idle_time 187 | @anime_idle_time ||= (IDLE_TIME - RIDLE_TIME / 2 + rand(RIDLE_TIME)).to_i 188 | end 189 | #-------------------------------------------------------------------------- 190 | # ● 待机总帧数获取 191 | #-------------------------------------------------------------------------- 192 | def idle_anime_time 193 | ANIME_TIME * @frame * animation_wait 194 | end 195 | #-------------------------------------------------------------------------- 196 | # ● 是否待机动画 197 | #-------------------------------------------------------------------------- 198 | def idle_anime?; @idle_anime end 199 | #-------------------------------------------------------------------------- 200 | # ● 是否奔跑 201 | #-------------------------------------------------------------------------- 202 | def is_dash?; false end 203 | #-------------------------------------------------------------------------- 204 | # ● 初始化私有成员变量 205 | #-------------------------------------------------------------------------- 206 | alias set_frame_init_private_members init_private_members 207 | def init_private_members 208 | set_frame_init_private_members 209 | @frame = 4 210 | end 211 | #-------------------------------------------------------------------------- 212 | # ● 更新步行/踏步动画 213 | #-------------------------------------------------------------------------- 214 | def update_animation 215 | update_anime_count 216 | if @anime_count > animation_wait 217 | update_anime_pattern 218 | @anime_count = 0 219 | end 220 | end 221 | #-------------------------------------------------------------------------- 222 | # ● 移动时两帧之间等待时间 223 | #-------------------------------------------------------------------------- 224 | def animation_wait 225 | [(9 - real_move_speed) * 3, 2].max 226 | end 227 | #-------------------------------------------------------------------------- 228 | # ● 矫正姿势 229 | #-------------------------------------------------------------------------- 230 | def straighten 231 | @pattern = @original_pattern if @walk_anime || @step_anime 232 | @anime_count = 0 233 | end 234 | #-------------------------------------------------------------------------- 235 | # ● 更新动画图案 236 | #-------------------------------------------------------------------------- 237 | def update_anime_pattern 238 | if !@step_anime && @stop_count > 0 239 | @pattern = @original_pattern 240 | else 241 | @pattern = (@pattern + 1) % @frame 242 | end 243 | end 244 | #-------------------------------------------------------------------------- 245 | # ● 更改图像 246 | #-------------------------------------------------------------------------- 247 | alias set_frame_set_graphic set_graphic 248 | def set_graphic(character_name, character_index) 249 | set_frame_set_graphic(character_name, character_index) 250 | @frame = get_frame(character_name) 251 | @original_pattern = get_halt_name(character_name) 252 | end 253 | #-------------------------------------------------------------------------- 254 | # ● 斜向移动 255 | #-------------------------------------------------------------------------- 256 | alias dir8_move_diagonal move_diagonal 257 | def move_diagonal(horz, vert) 258 | return @move_succeed = false if !passable?(@x, @y, horz) && !passable?(@x, @y, vert) 259 | return move_straight(horz) if passable?(@x, @y, horz) && !passable?(@x, @y, vert) 260 | return move_straight(vert) if passable?(@x, @y, vert) && !passable?(@x, @y, horz) 261 | dir8_move_diagonal(horz, vert) 262 | case [horz,vert] 263 | when [4,2] then set_direction(1) 264 | when [4,8] then set_direction(7) 265 | when [6,2] then set_direction(3) 266 | when [6,8] then set_direction(9) 267 | end 268 | end 269 | end 270 | #============================================================================== 271 | # ■ Sprite_Character 272 | #============================================================================== 273 | class Sprite_Character < Sprite_Base 274 | include VIPArcher::DIR8_ANIME 275 | #-------------------------------------------------------------------------- 276 | # ● 是否是八方向素材 277 | #-------------------------------------------------------------------------- 278 | def is_dir8? 279 | return false if @character_name =~ /#{DIRE8_AFFIX}/ 280 | return @character_name =~ /^(\@|\!\@|\$@|\!\$\@).+/ 281 | end 282 | #-------------------------------------------------------------------------- 283 | # ● 设置角色的位图 284 | #-------------------------------------------------------------------------- 285 | alias dir8_move_set_character_bitmap set_character_bitmap 286 | def set_character_bitmap 287 | dir8_move_set_character_bitmap 288 | return unless is_dir8? 289 | @character_dir8 = {} 290 | set_character_dir8("", "") 291 | set_character_dir8(DASH4_AFFIX, DASH4_AFFIX) 292 | set_character_dir8(IDLE4_AFFIX, IDLE4_AFFIX) 293 | set_character_dir8(DIRE8_AFFIX, DIRE8_AFFIX) 294 | set_character_dir8(DASH8_AFFIX, DASH8_AFFIX, DIRE8_AFFIX) 295 | set_character_dir8(IDLE8_AFFIX, IDLE8_AFFIX, DIRE8_AFFIX) 296 | frame = @character.is_multi_frames? ? @character.frame : 3 297 | sign = @character_name[/^[\@\!\$]../] 298 | @cw = bitmap.width / frame 299 | @cw /= 4 unless sign && sign.include?('$') 300 | self.ox = @cw / 2 301 | end 302 | #-------------------------------------------------------------------------- 303 | # ● 设置角色的各状态图 304 | #-------------------------------------------------------------------------- 305 | def set_character_dir8(string, affix, default = "") 306 | begin 307 | @character_dir8[string.to_sym] = Cache.character(@character_name + affix) 308 | @character.idle_anime = true if string.include?(IDLE4_AFFIX) 309 | rescue 310 | @character_dir8[string.to_sym] = @character_dir8[default.to_sym] 311 | @character.idle_anime = false if string.include?(IDLE4_AFFIX) 312 | end 313 | end 314 | #-------------------------------------------------------------------------- 315 | # ● 更新源矩形 316 | #-------------------------------------------------------------------------- 317 | def update_src_rect 318 | return if @tile_id != 0 319 | index = @character.character_index 320 | frame = @character.is_multi_frames? ? @character.frame : 3 321 | first = @character.is_multi_frames? ? 0 : 1 322 | pattern = @character.pattern < frame ? @character.pattern : first 323 | if (anime_symbol = "#{ 324 | @character.is_dash? && !$game_switches[DASH_ANIME_SW] ? 325 | DASH4_AFFIX : @character.static_anime ? IDLE4_AFFIX : '' 326 | }#{@character.direction.odd? ? DIRE8_AFFIX : ''}".to_sym) != @anime_symbol 327 | @anime_symbol = anime_symbol 328 | self.bitmap = @character_dir8[anime_symbol] 329 | end if is_dir8? 330 | sx = (index % 4 * frame + pattern) * @cw 331 | if (dir = @character.direction).odd? 332 | dir = [3, 7].include?(dir) && !is_dir8? ? 10 - dir : dir 333 | sy = (index / 4 * 4 + (dir + 1) / 3) * @ch 334 | else 335 | sy = (index / 4 * 4 + (dir - 2) / 2) * @ch 336 | end 337 | self.src_rect.set(sx, sy, @cw, @ch) 338 | end 339 | #-------------------------------------------------------------------------- 340 | # ● 释放 341 | #-------------------------------------------------------------------------- 342 | alias dir8_dispose dispose 343 | def dispose 344 | dir8_dispose 345 | @character_dir8.each_value do |v| 346 | v.dispose unless v.disposed? 347 | end if @character_dir8 348 | end 349 | end -------------------------------------------------------------------------------- /scripts/判断当前位置信息.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # 判断当前位置信息 By:VIPArcher [email: VIPArcher@sina.com] 3 | #=============================================================================== 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | # 说明:偷懒用,纯事件完全可以轻松做出相同效果,该脚本只是为了更加偷懒 6 | # 用法是:分歧条件-脚本- 7 | # 判断玩家位置(返回布尔值true/false) 8 | # player_pos?(x, y, m) 其中 m 为地图ID可省略,省略时 m 默认为当前地图ID 9 | # 判断事件位置(返回布尔值true/false) 10 | # event_pos?(x, y, id) 其中 id 为事件ID可省略,省略时 id 默认为当前事件ID 11 | # 获取地形标志(返回地形标志) 12 | # terrain_tag(id) 其中 id 为事件ID可省略,省略时 id 默认为玩家,否则 13 | # 为对应事件,为负数则为对应位置的队员 14 | # 获取区域ID(返回区域ID) 15 | # region_id(id) 其中 id 为事件ID可省略,省略时 id 默认为玩家,否则 16 | # 为对应事件,为负数则为对应位置的队员 17 | #=============================================================================== 18 | $VIPArcherScript ||= {};$VIPArcherScript[:location] = 20141203 19 | #-------------------------------------------------------------------------------- 20 | class Game_Interpreter 21 | #-------------------------------------------------------------------------- 22 | # ● 判断玩家当前坐标位置是否为(x, y, m) 23 | #-------------------------------------------------------------------------- 24 | def player_pos?(x, y, m = @map_id) 25 | $game_map.map_id == m && $game_player.pos?(x, y) 26 | end 27 | #-------------------------------------------------------------------------- 28 | # ● 判断当前坐标位置是否为(x,y,id) 29 | #-------------------------------------------------------------------------- 30 | def event_pos?(x, y, id = @event_id) 31 | $game_map.events[id].pos?(x, y) 32 | end 33 | #-------------------------------------------------------------------------- 34 | # ● 获取地形标志 35 | # id 小于 0 时为对应队友, 等于 0 时为当前事件,大于 0 为对应事件 36 | #-------------------------------------------------------------------------- 37 | def terrain_tag(id = $game_player) 38 | case id 39 | when $game_player then id.terrain_tag 40 | when -$game_party.max_battle_members + 1..-1 41 | $game_player.followers[id.abs - 1].terrain_tag 42 | else 43 | get_character(id).terrain_tag 44 | end 45 | end 46 | #-------------------------------------------------------------------------- 47 | # ● 获取区域ID 48 | # id 小于 0 时为对应队友, 等于 0 时为当前事件,大于 0 为对应事件 49 | #-------------------------------------------------------------------------- 50 | def region_id(id = $game_player) 51 | case id 52 | when $game_player then id.region_id 53 | when -$game_party.max_battle_members + 1..-1 54 | $game_player.followers[id.abs - 1].region_id 55 | else 56 | get_character(id).region_id 57 | end 58 | end 59 | end -------------------------------------------------------------------------------- /scripts/剧情中的黑色边框.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 剧情中黑色边框 3 | # by:VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 使用说明: 7 | # · 剧情开始时打开开关,淡入黑边框,执行剧情。剧情结束时关闭开关,无需素材。 8 | #============================================================================== 9 | $VIPArcherScript ||= {};$VIPArcherScript[:black_message] = 20150225 10 | #------------------------------------------------------------------------------- 11 | module VIPArcher end 12 | #============================================================================== 13 | # ★ 设定部分 ★ 14 | #============================================================================== 15 | module VIPArcher::Black_Message_Layer 16 | Z = 1 # Z值 17 | SW = 1 # 控制淡入/淡出的开关ID 18 | Edge = 24 # 边距渐变的高度 19 | Width = 544 # 宽度 20 | Height = 40 # 彻底填充的高度 21 | Black_Color = Color.new(0,0,0) # 填充的颜色 22 | Oy_Speed = 4 # y 轴方向淡出淡入速度 23 | Opacity_Speed = 16 # 透明度变化的速度 24 | end 25 | #============================================================================== 26 | # ☆ 设定结束 ☆ 27 | #============================================================================== 28 | class Sprite_Message_Layer < Sprite 29 | include VIPArcher::Black_Message_Layer 30 | H = Height + Edge 31 | #-------------------------------------------------------------------------- 32 | # ● 初始化对象 33 | #-------------------------------------------------------------------------- 34 | def initialize(pos = false,viewport = nil) 35 | super(viewport) 36 | @pos = pos 37 | self.opacity, self.z = 0 , Z 38 | self.oy = @pos ? H : -H 39 | set_bitmap 40 | end 41 | #-------------------------------------------------------------------------- 42 | # ● 设置位图 43 | #-------------------------------------------------------------------------- 44 | def set_bitmap 45 | rect1 = Rect.new(0,@pos ? 0 : Edge,Width,Height) 46 | rect2 = Rect.new(0,@pos ? Height : 0,Width,Edge) 47 | self.bitmap = Bitmap.new(544,H) 48 | self.y = Graphics.height - bitmap.height unless @pos 49 | color1,color2 = Black_Color,Color.new 50 | self.bitmap.fill_rect(rect1, color1) 51 | self.bitmap.gradient_fill_rect(rect2, 52 | @pos ? color1 : color2, @pos ? color2 : color1,true) 53 | end 54 | #-------------------------------------------------------------------------- 55 | # ● 更新画面 56 | #-------------------------------------------------------------------------- 57 | def update 58 | update_fadeout unless $game_switches[SW] 59 | update_fadein if $game_switches[SW] 60 | end 61 | #-------------------------------------------------------------------------- 62 | # ● 淡出淡入刷新 63 | #-------------------------------------------------------------------------- 64 | def update_fadein 65 | if oy.abs > 0 66 | self.oy += @pos ? -Oy_Speed : Oy_Speed 67 | self.opacity += Opacity_Speed 68 | end 69 | end 70 | #-------------------------------------------------------------------------- 71 | # ● 淡出淡出刷新 72 | #-------------------------------------------------------------------------- 73 | def update_fadeout 74 | if oy.abs < H 75 | self.oy += @pos ? Oy_Speed : -Oy_Speed 76 | self.opacity -= Opacity_Speed 77 | end 78 | end 79 | #-------------------------------------------------------------------------- 80 | # ● 释放 81 | #-------------------------------------------------------------------------- 82 | def dispose 83 | super 84 | self.bitmap.dispose 85 | end 86 | end 87 | class Spriteset_Map 88 | #-------------------------------------------------------------------------- 89 | # ● 创建剧情黑框层 90 | #-------------------------------------------------------------------------- 91 | alias message_layer_sprite_create_timer create_timer 92 | def create_timer 93 | message_layer_sprite_create_timer 94 | @down_message_layer = Sprite_Message_Layer.new(false,@viewport2) 95 | @up_message_layer = Sprite_Message_Layer.new(true,@viewport2) 96 | end 97 | #-------------------------------------------------------------------------- 98 | # ● 释放 99 | #-------------------------------------------------------------------------- 100 | alias message_layer_sprite_dispose dispose 101 | def dispose 102 | message_layer_sprite_dispose 103 | @up_message_layer.dispose 104 | @down_message_layer.dispose 105 | end 106 | #-------------------------------------------------------------------------- 107 | # ● 更新画面 108 | #-------------------------------------------------------------------------- 109 | alias message_layer_sprite_update update 110 | def update 111 | message_layer_sprite_update 112 | @up_message_layer.update 113 | @down_message_layer.update 114 | end 115 | end -------------------------------------------------------------------------------- /scripts/区域限定道具使用.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # +++ 区域限定物品是否可以使用 +++ 3 | # 作者 By:VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 备注的道具只能站在区域ID为X的位置才可使用(对技能同样有效) 7 | # 可以备注多个区域例如 区域ID之间隔开就可以了 8 | #============================================================================== 9 | $VIPArcherScript ||= {};$VIPArcherScript[:use_area] = 20141101 10 | #-------------------------------------------------------------------------------- 11 | class Game_BattlerBase 12 | #-------------------------------------------------------------------------- 13 | # ● 检查是否可以使用技能/物品 14 | #-------------------------------------------------------------------------- 15 | alias area_occasion? occasion_ok? 16 | def occasion_ok?(item) 17 | area_occasion?(item) && area_usable?(item) 18 | end 19 | #-------------------------------------------------------------------------- 20 | # ● 有备注的道具只能站在区域ID为X的位置才可使用 21 | #-------------------------------------------------------------------------- 22 | def area_usable?(item) 23 | item.note =~ //i 24 | return true if $1.nil? 25 | $1.scan(/\d+/).include?($game_player.region_id.to_s) 26 | end 27 | end -------------------------------------------------------------------------------- /scripts/固定远景图.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 固定远景图 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 使用说明: 7 | # 如果文件名以 ! 开头,则该远景会跟随地图卷动,也就是相当于固定在地图上了。 8 | #============================================================================== 9 | $VIPArcherScript ||= {};$VIPArcherScript[:fix_parallax] = 20150119 10 | #------------------------------------------------------------------------------ 11 | class Spriteset_Map 12 | #-------------------------------------------------------------------------- 13 | # ● 更新远景图 14 | #-------------------------------------------------------------------------- 15 | alias fix_update_parallax update_parallax 16 | def update_parallax 17 | fix_update_parallax 18 | return unless @parallax_name[0,1] == '!' 19 | @parallax.ox, @parallax.oy = @tilemap.ox, @tilemap.oy 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /scripts/地图卷动扩展.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 地图卷动扩展 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 说明: 7 | # 事件脚本里调用 start_scroll(direction, distance, speed)来进行画面卷动 8 | # direction: 7 8 9 distance:卷动距离 9 | # ↖↑↗ speed:卷动速度 1 - 6 10 | # 4← →6 1: 1/8倍速度; 2: 1/4倍速度 11 | # ↙↓↘ 3: 1/2倍速度; 4: 正常速度 12 | # 1 2 3 5: 2倍速度; 6: 4倍速度 13 | # 如果斜向移动到边界时则会变成水平方向卷动 14 | #============================================================================== 15 | $VIPArcherScript ||= {};$VIPArcherScript[:map_scroll] = 20150503 16 | #============================================================================== 17 | class Game_Interpreter 18 | #-------------------------------------------------------------------------- 19 | # ● 执行地图卷动 start_scroll(direction, distance, speed) 20 | # direction 卷动方向(1-9) 21 | # distance 卷动距离(格数) 22 | # speed 卷动速度(1-6) 23 | #-------------------------------------------------------------------------- 24 | def start_scroll(direction, distance, speed) 25 | Fiber.yield while $game_map.scrolling? 26 | $game_map.start_scroll(direction, distance, speed) 27 | end 28 | end 29 | #============================================================================== 30 | class Game_Map 31 | #-------------------------------------------------------------------------- 32 | # ● 执行卷动 33 | #-------------------------------------------------------------------------- 34 | alias do_scroll_dir8_extra do_scroll 35 | def do_scroll(direction, distance) 36 | do_scroll_dir8_extra(direction, distance) 37 | case direction 38 | when 1; scroll_down (distance);scroll_left (distance) 39 | when 3; scroll_down (distance);scroll_right(distance) 40 | when 7; scroll_up (distance);scroll_left (distance) 41 | when 9; scroll_up (distance);scroll_right(distance) 42 | else end 43 | end 44 | end -------------------------------------------------------------------------------- /scripts/战斗中被动效果.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # ■ 战斗中自动附加被动状态 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # ■ 在战斗开始时自动为每一位战斗者附加上设置好的状态,战斗结束时移除 7 | # 使用说明: 8 | # 在角色|职业|装备|敌人的备注栏备注<被动状态:状态ID> 例如 <被动状态:18> 9 | # 同时备注多个被动状态亦可叠加,都会为其附加上对应的状态。只有战斗开始时附加一次状态 10 | # 的备注栏应该也可以用,只要战斗开始前有某状态亦可附加上该状态备注栏里指定对的状态 11 | #============================================================================== 12 | $VIPArcherScript ||= {};$VIPArcherScript[:battle_state] = 20141102 13 | #-------------------------------------------------------------------------------- 14 | class Game_Battler < Game_BattlerBase 15 | #-------------------------------------------------------------------------- 16 | # ● 战斗开始处理 17 | #-------------------------------------------------------------------------- 18 | alias state_battle_start on_battle_start 19 | def on_battle_start 20 | state_battle_start 21 | self.feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each{ |line| 22 | self.add_state($1.to_i) if line =~ /<被动状态:\s*(\d+)>/}} 23 | end 24 | #-------------------------------------------------------------------------- 25 | # ● 战斗结束处理 26 | #-------------------------------------------------------------------------- 27 | alias state_on_battle_end on_battle_end 28 | def on_battle_end 29 | state_on_battle_end 30 | self.feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each{ |line| 31 | self.remove_state($1.to_i) if line =~ /<被动状态:\s*(\d+)>/}} 32 | end 33 | end -------------------------------------------------------------------------------- /scripts/控制暗色对话框.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # 暗色对话框控制 By:VIPArcher [email: VIPArcher@sina.com] 3 | #=============================================================================== 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | # 说明:对话中使用暗色对话框,并对设定的变量赋值可以控制对话所使用的背景图, 6 | # 文件名规格是"Message_"+ 变量1的值 7 | # 例如"Message_0.png" 或者"Message_VIPArcher.png" 8 | #=============================================================================== 9 | $VIPArcherScript ||= {};$VIPArcherScript[:message_back] = 20141117 10 | #------------------------------------------------------------------------------- 11 | module VIPArcher end 12 | #============================================================================== 13 | # ● 设定区 14 | #============================================================================== 15 | module VIPArcher::MESSAGE 16 | AFFIX_VER = 1 #控制文件后缀名的变量ID 17 | BACK_NAME = "Message"#背景图片名字的前缀 18 | end 19 | #------------------------------------------------------------------------------- 20 | class Window_Message < Window_Base 21 | include VIPArcher::MESSAGE 22 | #-------------------------------------------------------------------------- 23 | # ● 生成背景位图 24 | #-------------------------------------------------------------------------- 25 | alias vip_20141117_create_back_bitmap create_back_bitmap 26 | def create_back_bitmap 27 | back_bitmap_name = BACK_NAME + "_" + $game_variables[AFFIX_VER].to_s 28 | begin 29 | @back_bitmap = Cache.system(back_bitmap_name)# rescue Cache.system(BACK_NAME) 30 | rescue 31 | vip_20141117_create_back_bitmap 32 | end 33 | @game_variables = $game_variables[AFFIX_VER] 34 | end 35 | #-------------------------------------------------------------------------- 36 | # ● 更新背景精灵 37 | #-------------------------------------------------------------------------- 38 | alias vip_20141117_update_back_sprite update_back_sprite 39 | def update_back_sprite 40 | vip_20141117_update_back_sprite 41 | @back_sprite.y = Graphics.height - @back_bitmap.height 42 | end 43 | #-------------------------------------------------------------------------- 44 | # ● 更新窗口背景 45 | #-------------------------------------------------------------------------- 46 | alias vip_20141117_update_background update_background 47 | def update_background 48 | dispose_back_bitmap 49 | dispose_back_sprite 50 | create_back_bitmap 51 | create_back_sprite 52 | vip_20141117_update_background 53 | end 54 | #-------------------------------------------------------------------------- 55 | # ● 更新画面 56 | #-------------------------------------------------------------------------- 57 | alias vip_20141117_update update 58 | def update 59 | vip_20141117_update 60 | update_background if @game_variables != $game_variables[AFFIX_VER] 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /scripts/控制符颜色扩展.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 控制符颜色扩展 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | $VIPArcherScript ||= {};$VIPArcherScript[:textcolor] = 20141012 7 | #-------------------------------------------------------------------------------- 8 | module VIPArcher 9 | Text_Color = { #<-这行不能删除 10 | #颜色编号 #颜色(R , G , B [,A ]), 11 | 32 => Color.new(0 , 0 , 255,255), 12 | 33 => Color.new(0 , 255, 0 ), 13 | 34 => Color.new(255, 0 , 0 ), 14 | 35 => Color.new(233, 233, 233 ) 15 | #在这里继续追加。 16 | };Text_Color.default = Color.new #<-这行不能删除 17 | end 18 | #-------------------------------------------------------------------------------- 19 | class Window_Base < Window 20 | #-------------------------------------------------------------------------- 21 | # ● 获取文字颜色 22 | # n : 文字颜色编号(0..31) 23 | #-------------------------------------------------------------------------- 24 | alias vip_ex_text_color text_color 25 | def text_color(n) 26 | return VIPArcher::Text_Color[n] if n > 31 27 | vip_ex_text_color(n) 28 | end 29 | end -------------------------------------------------------------------------------- /scripts/描绘物品品质颜色.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 物品颜色描绘 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | $VIPArcherScript ||= {};$VIPArcherScript[:itemcolor] = __FILE__ #20141007 7 | #------------------------------------------------------------------------------- 8 | module VIPArcher end 9 | #============================================================================== 10 | # ★ 设定部分 ★ 11 | #============================================================================== 12 | module VIPArcher::ItemColor 13 | RIM = true #是否描绘边框 14 | FILL = true #是否填充边框 15 | #为了方便设置品质等级, 16 | Color_Lv = { 17 | # 品质 => 控制符颜色编号, 18 | 0 => 0, 19 | 1 => 24, 20 | 2 => 1, 21 | 3 => 30, 22 | 4 => 27, 23 | 5 => 18, 24 | 6 => 14 25 | # 继续添加 26 | };Color_Lv.default = 0 #这行不能删 27 | end 28 | #============================================================================== 29 | # ☆ 设定结束 ☆ 30 | #============================================================================== 31 | class RPG::BaseItem 32 | include VIPArcher::ItemColor 33 | #-------------------------------------------------------------------------- 34 | # ● 获取道具的品质 35 | #-------------------------------------------------------------------------- 36 | def color 37 | @note =~ /\<(?:color|品质|颜色)\s*(\d+)\>/i 38 | [[$1.to_i,Color_Lv.size - 1].min,0].max 39 | end 40 | end 41 | #------------------------------------------------------------------------------- 42 | class Window_Base < Window 43 | include VIPArcher::ItemColor 44 | #-------------------------------------------------------------------------- 45 | # ● 描绘物品 46 | #-------------------------------------------------------------------------- 47 | def draw_item_name(item, x, y, enabled = true, width = 172) 48 | return unless item 49 | item_color = text_color(Color_Lv[item.color]) 50 | change_color(item_color, enabled) 51 | self.color_fill_rect(x,y,item_color) if RIM 52 | draw_icon(item.icon_index, x, y, enabled) 53 | draw_text(x + 24, y, width, line_height, item.name) 54 | end 55 | #-------------------------------------------------------------------------- 56 | # ● 绘制图标边框 57 | #-------------------------------------------------------------------------- 58 | def color_fill_rect(x,y,item_color) 59 | item_alpha = item_color.clone 60 | item_alpha.alpha = 160 61 | contents.fill_rect(x+1 ,y+1 ,22, 22 ,item_alpha) if FILL 62 | contents.fill_rect(x+1 ,y+1 ,22, 1 ,item_color) 63 | contents.fill_rect(x ,y+2 ,1 , 20 ,item_color) 64 | contents.fill_rect(x+1 ,y+22,22, 1 ,item_color) 65 | contents.fill_rect(x+23,y+2 ,1 , 20 ,item_color) 66 | end 67 | end -------------------------------------------------------------------------------- /scripts/敌人掉落物扩展.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 敌人追加掉落物 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 使用说明: 7 | # 在敌人的备注栏里备注 8 | # 其中 kind: i => 道具 9 | # w => 武器 10 | # a => 防具 11 | # ID: 物品编号索引 12 | # X:概率(例如为5的话 就是 5%) 13 | # 例如 就是55%的概率获得5号武器 14 | # 注:备注多个掉落物品请记得换行,备注信息中的空格不要忘记了。 15 | #============================================================================== 16 | $VIPArcherScript ||= {};$VIPArcherScript[:expand_drop] = 20141101 17 | #-------------------------------------------------------------------------------- 18 | class RPG::Enemy < RPG::BaseItem 19 | #-------------------------------------------------------------------------- 20 | # ● 获取备注扩展掉落信息 21 | #-------------------------------------------------------------------------- 22 | def get_extra_drop_item 23 | expand_drop_item = [] 24 | self.note.split(/[\r\n]+/).each{ |line| 25 | if line =~ // 26 | expand_item = $1.lstrip.split(/\s+/) 27 | expand_drop_item.push(expand_item) 28 | end} 29 | return expand_drop_item 30 | end 31 | #-------------------------------------------------------------------------- 32 | # ● 生成扩展掉落物品实例 33 | #-------------------------------------------------------------------------- 34 | def make_drop_item(drop_item) 35 | return nil if drop_item == [] 36 | di = RPG::Enemy::DropItem.new 37 | di.kind = ["","i","w","a"].index(drop_item[0]) 38 | di.data_id = drop_item[1].to_i 39 | di.denominator = 100 / drop_item[2].to_f 40 | return di 41 | end 42 | #-------------------------------------------------------------------------- 43 | # ● 生成掉落物品信息数组 44 | #-------------------------------------------------------------------------- 45 | alias extra_drop_items drop_items 46 | def drop_items 47 | items = extra_drop_items.clone 48 | get_extra_drop_item.each{|item| items.push(make_drop_item(item)) if item} 49 | return items 50 | end 51 | end -------------------------------------------------------------------------------- /scripts/椅子.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 站在椅子上 3 | # by :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #------------------------------------------------------------------------------ 6 | # ■ 使用说明: 7 | # 通过对【椅子】图块设定特定的地形标志而让角色的 screen_y 坐标 8 | # 微调以达到模拟出角色站在椅子上的感觉。 9 | # 如果事件名称里带有EV(默认事件名)则不会调整其 screen_y 坐标 10 | #============================================================================== 11 | $VIPArcherScript ||= {};$VIPArcherScript[:chair_y] = 20140920 12 | #-------------------------------------------------------------------------------- 13 | module VIPArcher end 14 | #============================================================================== 15 | # ★ 设定部分 ★ 16 | #============================================================================== 17 | module VIPArcher::CHAIR 18 | TERRAIN_Y = { 19 | 5 => 4, # 小椅子 20 | 6 => 8, # 大椅子 21 | 7 => 10 # 床铺 22 | };TERRAIN_Y.default = 0 #这行不能删 23 | end 24 | #============================================================================== 25 | # ☆ 设定结束 ☆ 26 | #============================================================================== 27 | class Game_CharacterBase 28 | include VIPArcher::CHAIR 29 | #-------------------------------------------------------------------------- 30 | # ● 设置站在椅子上的y调整 31 | #-------------------------------------------------------------------------- 32 | def chair_y 33 | if self.is_a?(Game_Event) # 判定是否地图事件 34 | return 0 if self.instance_variable_get("@event").name.include?("EV") 35 | return 0 if move_frequency == 5 36 | end 37 | @stop_count == 0 ? 0 : TERRAIN_Y[self.terrain_tag] 38 | end 39 | #-------------------------------------------------------------------------- 40 | # ● 获取画面 Y 坐标(加上椅子高度) 41 | #-------------------------------------------------------------------------- 42 | alias vip20140919_screen_y screen_y 43 | def screen_y 44 | vip20140919_screen_y - chair_y 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /scripts/游戏版本检查.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 游戏版本检查 V2.0 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # ● 配置: 配置好下面的链接和版本信息,并把云端版本文件更新成和本脚本的版本一致 7 | # 使用:脚本调用: Game_Version.check 进行版本检查 8 | # 另外:脚本调用: VIPArcher.open_url("url") 可以打开链接为 url 的网页 9 | #============================================================================== 10 | $VIPArcherScript ||= {};$VIPArcherScript[:version_check] = 20161125 11 | module VIPArcher 12 | The_Current_Version = "1.1.1" # 当前游戏版本 13 | #-------------------------------------------------------------------------- 14 | # ● 链接的设置 15 | #-------------------------------------------------------------------------- 16 | # 官网主页 17 | Home_Url = "http://house-of-lies.lofter.com/index" 18 | # 游戏下载链接 19 | Download_Url = "http://house-of-lies.lofter.com/download" 20 | # 云端版本号文件链接 21 | Version_Url = "http://git.oschina.net/VIPArcher/Game/raw/master/version" 22 | # 云端版本更新内容文件链接 23 | Features_Url = "http://git.oschina.net/VIPArcher/Game/raw/master/features" 24 | #-------------------------------------------------------------------------- 25 | # ● 用语的设置 26 | #-------------------------------------------------------------------------- 27 | # 显示当前版本并询问是否更新的提示内容 (需要改动的话请只改动中间三行) 28 | # %s 版本信息占位符 EOF 为创建多行字符串用的,头尾两个都尽量别动 29 | Current_Version_Hint = < :error 32 -> :question 48 -> :warning 64 -> :information 64 | # button 0 -> 确定 1 -> 确定 取消 2 中止 重试 忽略 65 | # 3 -> 是 否 取消 4 -> 是 否 66 | # return 确定(1) 取消(2) 中止(3) 重试(4) 忽略(5) 是(6) 否(7) 67 | #-------------------------------------------------------------------------- 68 | def self.callMessageBoxW(hint, title, icon, button,hWnd = 0) 69 | MessageBoxW.call(hWnd, hint.u2w, title.u2w, icon | button) 70 | end 71 | end 72 | #============================================================================== 73 | # String类 74 | #============================================================================== 75 | class String 76 | #-------------------------------------------------------------------------- 77 | # ● 快捷方式:从 宽字符 转为 UTF-8 78 | #-------------------------------------------------------------------------- 79 | def w2u 80 | self.unpack("S*").pack("U*").sub(/\0+$/, '') 81 | end 82 | #-------------------------------------------------------------------------- 83 | # ● 快捷方式:从 UTF-8 转为 宽字符 84 | #-------------------------------------------------------------------------- 85 | def u2w 86 | self.unpack("U*").pack("S*") + "\0\0" 87 | end 88 | #-------------------------------------------------------------------------- 89 | # ● 强制编码 90 | #-------------------------------------------------------------------------- 91 | def f_e 92 | self.force_encoding(__ENCODING__) 93 | end 94 | end 95 | module Game_Version 96 | class << self 97 | include VIPArcher 98 | #-------------------------------------------------------------------------- 99 | # ● 获取版本 Game_Version.check 100 | #-------------------------------------------------------------------------- 101 | def check 102 | hint = sprintf(Current_Version_Hint, The_Current_Version) 103 | return unless VIPArcher.callMessageBoxW(hint,"检查游戏版本更新",32,1) == 1 104 | return unless get_version 105 | if The_Current_Version == @version 106 | return VIPArcher.callMessageBoxW(No_New_Version_Hint,"已是最新版", 64,0) 107 | end 108 | features_title = sprintf(New_Version_Title, @version) 109 | hint = get_features ? @version_features : New_Version_Hint 110 | if VIPArcher.callMessageBoxW(hint, features_title, 64 , 1) == 1 111 | VIPArcher.open_url(Download_Url) 112 | end 113 | end 114 | #-------------------------------------------------------------------------- 115 | # ● 获取版本 116 | #-------------------------------------------------------------------------- 117 | def get_version 118 | begin 119 | URLDownloadToCacheFile.call(0, "#{Version_Url}?#{rand(10)}", 120 | buf = "\0" * 1024, 1024, 0, 0) 121 | if file = open(buf.sub(/\0+$/,''), 'rb'){ |p| p.read } 122 | @version = file.to_s 123 | else 124 | hint = "#{Check_Failure_Hint}\n地址:#{Home_Url}" 125 | if VIPArcher.callMessageBoxW(hint, "获取版本信息失败!", 64 , 4) == 6 126 | VIPArcher.open_url(Home_Url); return false 127 | end 128 | end 129 | rescue 130 | hint = "#{Could_Not_Connect}\n地址:#{Home_Url}" 131 | VIPArcher.callMessageBoxW(hint, "检查新版本失败!", 64 , 1) 132 | return false 133 | end 134 | end 135 | #-------------------------------------------------------------------------- 136 | # ● 获取新版本更新内容 137 | #-------------------------------------------------------------------------- 138 | def get_features 139 | begin 140 | URLDownloadToCacheFile.call(0, "#{Features_Url}?#{rand(10)}", 141 | buf = "\0" * 1024, 1024, 0, 0) 142 | if file = open(buf.sub(/\0+$/,''), 'rb'){ |p| p.read } 143 | @version_features = file.f_e 144 | end 145 | rescue 146 | return false 147 | end 148 | end 149 | end 150 | end 151 | -------------------------------------------------------------------------------- /scripts/窗口滑动美化.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ VA菜单滑动 3 | # 创意:百页书香,铅笔描绘的思念 4 | # By :VIPArcher [email: VIPArcher@sina.com] 5 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 6 | #============================================================================== 7 | # 这里只有默认的主菜单和物品栏,其他窗口也是同样的方法。 8 | # 具体请自己设置。一点难度都没有,依葫芦画瓢就可以了。 9 | #============================================================================== 10 | $VIPArcherScript ||= {};$VIPArcherScript[:menu_slide] = 20141215 11 | #============================================================================== 12 | # ■ 下面Scene_Base部分最好不要动,新场景写在最下方 13 | #============================================================================== 14 | class Scene_Base 15 | #-------------------------------------------------------------------------- 16 | # ● 开始后处理 17 | #-------------------------------------------------------------------------- 18 | alias vip_slide_post_start post_start 19 | def post_start 20 | init_slide 21 | vip_slide_post_start 22 | slide_start 23 | end 24 | #-------------------------------------------------------------------------- 25 | # ● 滑动前的准备 26 | #-------------------------------------------------------------------------- 27 | def init_slide ; end 28 | #-------------------------------------------------------------------------- 29 | # ● 窗口滑动处理 30 | #-------------------------------------------------------------------------- 31 | def slide_start ; end 32 | end 33 | #------------------------------------------------------------------------------- 34 | # ■ 上面部分最好不要改 35 | #============================================================================== 36 | #  菜单画面 37 | #============================================================================== 38 | class Scene_Menu < Scene_MenuBase 39 | #-------------------------------------------------------------------------- 40 | # ● 滑动前的准备 41 | # 重定义开始时各个窗口的位置(基本会设置到屏幕外), 42 | # 具体有哪些窗口去各个场景里面自己找。 43 | #-------------------------------------------------------------------------- 44 | def init_slide 45 | @command_window.y -= 150 46 | @gold_window.x -= 100 47 | @status_window.x = 260 48 | end 49 | #-------------------------------------------------------------------------- 50 | # ● 窗口滑动处理 51 | #-------------------------------------------------------------------------- 52 | def slide_start 53 | 10.times do 54 | @command_window.y += 15 55 | @gold_window.x += 10 56 | @status_window.x -= 10 57 | # 每帧移动的坐标量 58 | Graphics.update # 刷新窗口 59 | end 60 | 10.times{|i| 61 | @gold_window.x += 5 * Math.cos(i) 62 | @command_window.y += 5 * Math.cos(i) 63 | Graphics.update} # 弹动 64 | end 65 | end 66 | #============================================================================== 67 | #  物品画面 68 | #============================================================================== 69 | class Scene_Item < Scene_ItemBase 70 | #-------------------------------------------------------------------------- 71 | # ● 滑动前的准备 72 | #-------------------------------------------------------------------------- 73 | def init_slide 74 | @category_window.x -= 100 75 | @item_window.y += 100 76 | @help_window.y -= 60 77 | end 78 | #-------------------------------------------------------------------------- 79 | # ● 窗口滑动处理 80 | #-------------------------------------------------------------------------- 81 | def slide_start 82 | 10.times do 83 | @category_window.x += 10 84 | @item_window.y -= 10 85 | @help_window.y += 6 86 | # 每帧移动的坐标量 87 | Graphics.update # 刷新窗口 88 | end 89 | end 90 | end 91 | #============================================================================== 92 | #  其他画面 泥萌自己写啦 93 | #============================================================================== -------------------------------------------------------------------------------- /scripts/自定义物品分类.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 物品分类扩展 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 使用说明: 7 | # 在设定区设定好分类后在道具/武器/防具备注栏备注 8 | # <分类:分类名称> 9 | # 即可把对应物品归到对应分类下,备注未填写分类的物品按默认分类归类 10 | #============================================================================== 11 | $VIPArcherScript ||= {};$VIPArcherScript[:item_category] = 20141017 12 | #============================================================================== 13 | # ● 设定区 14 | #============================================================================== 15 | module VIPArcher end 16 | module VIPArcher::ITEM 17 | MAX_COL = 4 # 一页显示的分类列数 18 | CATEGORY = { # <- 别删 19 | #格式:分类标识符号 => "分类名称", 注:标识尽量独特不重复即可 20 | :item => "道具", #默认分类 21 | :weapon => "武器", #默认分类 22 | :armor => "护甲", #默认分类 23 | :key_item => "贵重", #默认分类 24 | :viparcher => "VIP", 25 | #在这里继续添加... 26 | } # <- 别删 27 | end 28 | #-------------------------------------------------------------------------------- 29 | class Window_ItemList < Window_Selectable 30 | include VIPArcher::ITEM 31 | #-------------------------------------------------------------------------- 32 | # ● 查询列表中是否含有此物品 33 | #-------------------------------------------------------------------------- 34 | alias vip_include? include? 35 | def include?(item) 36 | if item && item.note =~ /<(?:category|分类)[: ].*>/i 37 | note_include?(item) 38 | else 39 | vip_include?(item) 40 | end 41 | end 42 | #-------------------------------------------------------------------------- 43 | # ● 检查备注分类 44 | #-------------------------------------------------------------------------- 45 | def note_include?(item) 46 | item.note =~ /<(?:category|分类)[:]\s*#{CATEGORY[@category]}>/i 47 | end 48 | end 49 | #-------------------------------------------------------------------------------- 50 | class Window_ItemCategory < Window_HorzCommand 51 | include VIPArcher::ITEM 52 | #-------------------------------------------------------------------------- 53 | # ● 生成指令列表 54 | #-------------------------------------------------------------------------- 55 | def make_command_list 56 | CATEGORY.each{|key, value| add_command(value,key)} 57 | end 58 | #-------------------------------------------------------------------------- 59 | # ● 获取列数 60 | #-------------------------------------------------------------------------- 61 | def col_max; MAX_COL end 62 | end 63 | -------------------------------------------------------------------------------- /scripts/装备栏风格扩展.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # +++ 装备栏风格扩展 +++ 3 | # by:VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | #  ■ 新增装备风格 7 | # 使用说明:在角色备注栏/职业备注栏里备注 则角色变为x号装备风格, 8 | # 一个角色有多个风格同时存在时,最终返回风格编号x最大的那个风格。 9 | # 在防具上备注则把该防具设置为第x种类型,默认占用了0-4,追加的由5开始 10 | # 在任何有备注框的地方备注 固定该位置的装备,固定多个则换行再写 11 | # 在任何有备注框的地方备注 禁用该位置的装备,禁用多个则换行再写 12 | # 在角色备注栏备注 初始化初始装备(此备注将使数据库的初 13 | # 始装备设置失效,并且请把装备对应好位置和确认装备该位置可以装备该装备。) 14 | # 在角色备注栏备注 追加初始装备(和上面是一样的意思, 15 | # 但是这种不会让数据库的设置无效,只会在后面追加上初始装备。)具体请自己摸索吧 16 | #============================================================================== 17 | $VIPArcherScript ||= {};$VIPArcherScript[:slot_type] = __FILE__ #20150915 18 | #============================================================================== 19 | # ★ 设定部分 ★ 20 | #============================================================================== 21 | module VIPArcher 22 | 23 | ETYPE_ADD_NAME = ["腰带", "鞋子"] #设置要增加的装备位置的名字 24 | 25 | SLOT_TYPE = { 26 | 0 => [0,1,2,3,4], # 普通 27 | 1 => [0,0,2,3,4], # 双持武器 (这两个是默认的风格) 28 | # 从这里开始添加装备风格 29 | 2 => [0,0,0,1,2,3,4], # 看我索爷三刀流 30 | 3 => [4], # 窝只是个需要保护的NPC装备只要首饰就够了吧。 31 | 4 => [0,2,3,3], # 233 32 | 5 => [0,1,2,3,4,5,6], # 这里的5,6对应的类型就是上面追加的类型 33 | # 在这里继续添加类型。编号越大,优先级越高。 34 | 35 | } # <= 这个大括号不能删 36 | #-------------------------------------------------------------------------- 37 | # ● 追加装备位置用语 38 | #-------------------------------------------------------------------------- 39 | def Vocab.etype(etype_id) 40 | etype_name = $data_system.terms.etypes + ETYPE_ADD_NAME 41 | etype_name[etype_id] 42 | end 43 | end 44 | #============================================================================== 45 | # ☆ 设定结束 ☆ 46 | #============================================================================== 47 | class RPG::Actor < RPG::BaseItem 48 | #-------------------------------------------------------------------------- 49 | # ● 初始装备数组 50 | #-------------------------------------------------------------------------- 51 | alias vip_20141119_equips equips 52 | def equips 53 | add_equips = [] 54 | if @note =~ /<(?:ini_equips|初始装备)[:]\[(.+?)\]>/i 55 | $1.split(",").each {|item|add_equips.push item.to_i} 56 | return add_equips 57 | elsif @note =~ /<(?:ini_equips|初始装备)[:]\[(.+?)\]>/i 58 | $1.split(",").each {|item|add_equips.push item.to_i} 59 | end 60 | vip_20141119_equips.clone + add_equips 61 | end 62 | end 63 | #------------------------------------------------------------------------------- 64 | class RPG::Armor < RPG::EquipItem 65 | #-------------------------------------------------------------------------- 66 | # ● 装备类型 67 | #-------------------------------------------------------------------------- 68 | def etype_id 69 | @note =~ /<(?:etype_id|装备类型)[:]\s*(.*)>/i ? $1.to_i : @etype_id 70 | end 71 | end 72 | #------------------------------------------------------------------------------- 73 | class Game_BattlerBase 74 | #-------------------------------------------------------------------------- 75 | # ● 获取装备风格 76 | #-------------------------------------------------------------------------- 77 | def slot_type 78 | slot =[] 79 | feature_objects.each {|obj| slot.push $1.to_i if 80 | obj.note =~ /<(?:slot_type|装备风格)[:]\s*(.*)>/i } 81 | return slot.max || 0 82 | end 83 | #-------------------------------------------------------------------------- 84 | # ● 判定是否固定装备 85 | #-------------------------------------------------------------------------- 86 | alias vip_20141119_equip_type_fixed? equip_type_fixed? 87 | def equip_type_fixed?(etype_id) 88 | fixed_type = [] 89 | feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line| 90 | fixed_type.push $1.to_i if line =~ /<(?:fix_equips|固定装备)[:]\s*(.*)>/i}} 91 | fixed_type.include?(etype_id) || vip_20141119_equip_type_fixed?(etype_id) 92 | end 93 | #-------------------------------------------------------------------------- 94 | # ● 判定装备是否被禁用 95 | #-------------------------------------------------------------------------- 96 | alias vip_20141119_equip_type_sealed? equip_type_sealed? 97 | def equip_type_sealed?(etype_id) 98 | sealed_type = [] 99 | feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line| 100 | sealed_type.push $1.to_i if line =~ /<(?:seal_equips|禁用装备)[:]\s*(.*)>/i}} 101 | sealed_type.include?(etype_id) || vip_20141119_equip_type_sealed?(etype_id) 102 | end 103 | end 104 | #------------------------------------------------------------------------------- 105 | class Game_Actor < Game_Battler 106 | include VIPArcher 107 | #-------------------------------------------------------------------------- 108 | # ● 初始化装备 109 | # # 方法覆盖,可能引起冲突 110 | #-------------------------------------------------------------------------- 111 | def init_equips(equips) 112 | type_size = SLOT_TYPE.values.max_by{|type|type.size}.size 113 | @equips = Array.new(type_size) { Game_BaseItem.new } 114 | equips.each_with_index do |item_id, i| 115 | etype_id = equip_slots[i] 116 | slot_id = empty_slot(etype_id) 117 | @equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id 118 | end 119 | refresh 120 | end 121 | #-------------------------------------------------------------------------- 122 | # ● 获取装备栏的数组 123 | #-------------------------------------------------------------------------- 124 | alias vip_20140803_es equip_slots 125 | def equip_slots 126 | return SLOT_TYPE[slot_type] unless SLOT_TYPE[slot_type].nil? 127 | vip_20140803_es 128 | end 129 | end 130 | #------------------------------------------------------------------------------- 131 | class Window_EquipSlot; def refresh; create_contents; super end end -------------------------------------------------------------------------------- /scripts/设置队员没死就无敌的角色或敌人.rb: -------------------------------------------------------------------------------- 1 | # VIPArcher [email: VIPArcher@sina.com] 2 | #该脚本写得相当随意,如果冲突或者无效请放弃使用 3 | class Game_Battler 4 | 5 | def damage_valid? 6 | !(actor? ? actor : enemy).note.include?('<我不是杂鱼>') || 7 | friends_unit.alive_members == [self] 8 | end 9 | 10 | alias assign_hp_20140817 hp= 11 | def hp=(hp) 12 | assign_hp_20140817(hp) if hp >= @hp || damage_valid? 13 | end 14 | 15 | alias mdv_20140817 make_damage_value 16 | def make_damage_value(user, item) 17 | mdv_20140817(user, item) if damage_valid? 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /scripts/识别行走图帧数.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 自动识别行走图帧数 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | # 说明: 6 | # 使用这个脚本可以自动识别行走图的帧数,并且设置角色使用该行走图时的默认动作,使用 7 | # 方法是在行走图文件名里加上@帧数#默认动作的帧。事件的默认帧可以在事件里直接设置 8 | # 例如XP的素材就命名为: "喵喵喵_@4#0.png" 或者 "$妙妙妙_@4#0.png" 9 | #============================================================================== 10 | $VIPArcherScript ||= {};$VIPArcherScript[:characters_frame] = 20150122 11 | #------------------------------------------------------------------------------- 12 | class Game_Player < Game_Character 13 | #-------------------------------------------------------------------------- 14 | # ● 矫正姿势 15 | #-------------------------------------------------------------------------- 16 | def straighten 17 | return super unless @fix 18 | @pattern = @fix if @walk_anime || @step_anime 19 | @anime_count = 0 20 | end 21 | #-------------------------------------------------------------------------- 22 | # ● 刷新 23 | #-------------------------------------------------------------------------- 24 | alias characters_frame_refresh refresh 25 | def refresh 26 | characters_frame_refresh 27 | @original_pattern = @fix = $1.to_i if @character_name =~ /#(\d+)/ 28 | @frame = $1.to_i if @character_name =~ /@(\d+)/ 29 | end 30 | #-------------------------------------------------------------------------- 31 | # ● 更新动画图案 32 | #-------------------------------------------------------------------------- 33 | def update_anime_pattern 34 | return super unless @frame 35 | if !@step_anime && @stop_count > 0 36 | @pattern = @original_pattern 37 | else 38 | @pattern = (@pattern + 1) % @frame 39 | end 40 | end 41 | end 42 | #------------------------------------------------------------------------------- 43 | class Sprite_Character < Sprite_Base 44 | #-------------------------------------------------------------------------- 45 | # ● 设置角色的位图 46 | #-------------------------------------------------------------------------- 47 | alias characters_frame_set_character_bitmap set_character_bitmap 48 | def set_character_bitmap 49 | if @character_name =~ /@(\d+)/ 50 | @frame = $1.to_i 51 | self.bitmap = Cache.character(@character_name) 52 | sign = @character_name[/^[\!\$]./] 53 | if sign && sign.include?('$') 54 | @cw = bitmap.width / @frame 55 | @ch = bitmap.height / 4 56 | else 57 | @cw = bitmap.width / @frame * 4 58 | @ch = bitmap.height / 8 59 | end 60 | self.ox = @cw / 2 61 | self.oy = @ch 62 | else 63 | characters_frame_set_character_bitmap 64 | end 65 | end 66 | #-------------------------------------------------------------------------- 67 | # ● 更新源矩形 68 | #-------------------------------------------------------------------------- 69 | alias characters_frame_update_src_rect update_src_rect 70 | def update_src_rect 71 | return characters_frame_update_src_rect unless @frame 72 | if @tile_id == 0 73 | index = @character.character_index 74 | pattern = @character.pattern < @frame ? @character.pattern : 1 75 | sx = (index % 4 * 3 + pattern) * @cw 76 | sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch 77 | self.src_rect.set(sx, sy, @cw, @ch) 78 | end 79 | end 80 | end -------------------------------------------------------------------------------- /scripts/详细帮助窗口加强.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 技能物品说明增强 蓝本:wyongcan 3 | # 修改 :VIPArcher [email: VIPArcher@sina.com] 4 | # 5 | # 改动说明: 6 | # 改用新的帮助窗口和新定义draw_text_vip方法来增强兼容性 7 | # 更改初始化数据时机以支持跳过标题 8 | # 追加对普通物品和技能的说明内容 9 | # 修改了对帮助窗口行数的计算以支持控制符 10 | # 加上了各种颜色的设置,具体更高级的玩法自己领悟吧 11 | # 改成光标不动一段时间后才会出现帮助窗口 12 | # 2015.01.25 : 无聊的的修改(重写)[划掉]可以无视[划掉] 13 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 14 | #============================================================================== 15 | $VIPArcherScript ||= {};$VIPArcherScript[:help_ex] = __FILE__ #20141007 16 | $VIPArcherScript[:equip_limit] = false #是否使用了后知后觉的装备能力限制 17 | module VIPArcher end 18 | #------------------------------------------------------------------------------- 19 | class << DataManager 20 | alias_method :vip_load_database, :load_database 21 | #-------------------------------------------------------------------------- 22 | # ● 读取数据库 23 | #-------------------------------------------------------------------------- 24 | def load_database 25 | vip_load_database ; VIPArcher::Help_Ex.init_ready 26 | end 27 | end 28 | #============================================================================== 29 | # ★ 设定项目 - BEGIN Setting ★ 30 | #============================================================================== 31 | module VIPArcher::Help_Ex 32 | #-------------------------------------------------------------------------- 33 | # ● 常量设置 34 | #-------------------------------------------------------------------------- 35 | TIME = 60 #帮助窗口自动出现的时间(单位帧 36 | Font_Name = Font.default_name # 推荐"微软雅黑" 37 | Font_Size = 14 # "微软雅黑"的话就20号字体 38 | UP = 24 #能力值提升颜色编号 39 | DOWN = 25 #能力值下降颜色编号 40 | VIP = 14 #特殊能力颜色编号 41 | MP = 23 #消耗MP的颜色编号 42 | TP = 29 #消耗TP的颜色编号 43 | #-------------------------------------------------------------------------- 44 | # ● 用语设置 45 | #-------------------------------------------------------------------------- 46 | CODE ={ 47 | 11 => "属性抗性", 48 | 12 => "弱化抗性", 49 | 13 => "状态抗性", 50 | 14 => "状态免疫", 51 | 21 => "普通能力", 52 | 22 => "添加能力", 53 | 23 => "特殊能力", 54 | 31 => "附带属性", 55 | 32 => "附带状态", 56 | 33 => "攻击速度", 57 | 34 => "添加攻击次数", 58 | 41 => "添加技能类型", 59 | 42 => "禁用技能类型", 60 | 43 => "添加技能", 61 | 44 => "禁用技能", 62 | 51 => "可装备武器类型", 63 | 52 => "可装备护甲类型", 64 | 53 => "固定装备", 65 | 54 => "禁用装备", 66 | 55 => "装备风格", 67 | 61 => "添加行动次数", 68 | 62 => "特殊标志", 69 | 63 => "消失效果", 70 | 64 => "队伍能力" 71 | } 72 | #特殊标志 73 | FLAG ={ 74 | 0 => "自动战斗", 75 | 1 => "擅长防御", 76 | 2 => "保护弱者", 77 | 3 => "特技专注" 78 | } 79 | #技能效果范围 80 | SCOPE ={ 81 | 0 => "无", 82 | 1 => "单个敌人", 83 | 2 => "全体敌人", 84 | 3 => "一个随机敌人", 85 | 4 => "两个随机敌人", 86 | 5 => "三个随机敌人", 87 | 6 => "四个随机敌人", 88 | 7 => "单个队友", 89 | 8 => "全体队友", 90 | 9 => "单个队友(战斗不能)", 91 | 10 => "全体队友(战斗不能)", 92 | 11 => "使用者" 93 | } 94 | #技能命中类型 95 | HIT ={ 96 | 0 => "必定命中", 97 | 1 => "物理攻击", 98 | 2 => "魔法攻击" 99 | } 100 | #使用限制 101 | OCCASION ={ 102 | 0 => "随时可用", 103 | 1 => "仅战斗中", 104 | 2 => "仅菜单中", 105 | 3 => "不能使用" 106 | } 107 | #添加能力 108 | XPARAM ={ 109 | 0 => "物理命中几率:", 110 | 1 => "物理闪避几率:", 111 | 2 => "必杀几率:", 112 | 3 => "必杀闪避几率:", 113 | 4 => "魔法闪避几率:", 114 | 5 => "魔法反射几率:", 115 | 6 => "物理反击几率:", 116 | 7 => "体力值再生速度:", 117 | 8 => "魔力值再生速度:", 118 | 9 => "特技值再生速度:" 119 | } 120 | #特殊能力 121 | SPARAM ={ 122 | 0 => "受到攻击的几率", 123 | 1 => "防御效果比率", 124 | 2 => "恢复效果比率", 125 | 3 => "药理知识", 126 | 4 => "MP消费率", 127 | 5 => "TP消耗率", 128 | 6 => "物理伤害加成", 129 | 7 => "魔法伤害加成", 130 | 8 => "地形伤害加成", 131 | 9 => "经验获得加成" 132 | } 133 | #装备风格 require 装备风格扩展脚本 by:VIPArcher 134 | SLOT_TYPE ={ 135 | 0 => "普通", 136 | 1 => "双持武器", 137 | 2 => "索爷三刀流", 138 | 3 => "NPC", 139 | 4 => "233", 140 | 5 => "论坛@的BUG好烦啊" 141 | } 142 | #队伍能力 143 | PARTY_ABILITY ={ 144 | 0 => "遇敌几率减半", 145 | 1 => "随机遇敌无效", 146 | 2 => "敌人偷袭无效", 147 | 3 => "先制攻击几率上升", 148 | 4 => "获得金钱数量双倍", 149 | 5 => "物品掉落几率双倍" 150 | } 151 | #伤害类型 152 | DAMAGE_TYPE = { 153 | 0 => "无", 154 | 1 => "体力值伤害", 155 | 2 => "魔力值伤害", 156 | 3 => "体力值恢复", 157 | 4 => "魔力值恢复", 158 | 5 => "体力值吸收", 159 | 6 => "魔力值吸收" 160 | } 161 | #普通能力 162 | #这只是个示范,你也可以依照个人喜好对这些用语添加颜色控制符 163 | @params ={ 164 | 0 => "\\c[17]最大HP", 165 | 1 => "\\c[16]最大MP", 166 | 2 => "\\c[20]物攻", 167 | 3 => "\\c[21]物防", 168 | 4 => "\\c[30]魔攻", 169 | 5 => "\\c[31]魔防", 170 | 6 => "\\c[14]敏捷", 171 | 7 => "\\c[17]幸运" 172 | } 173 | #我举例技能类型的原因就是因为它 短 174 | @skill_types = { # 这个和下面equiphelpready里注释掉的做的是一样的事 175 | # 只是下面是读取数据库添加用语,这里是手动枚举 176 | 1 => "\\c[1]特技", 177 | 2 => "\\c[2]魔法", 178 | 3 => "\\c[3]必杀", 179 | 4 => "\\c[5]卖萌" 180 | } 181 | end 182 | #============================================================================== 183 | # ☆ 设定完成 - END Setting ☆ 184 | #============================================================================== 185 | module VIPArcher::Help_Ex 186 | #-------------------------------------------------------------------------- 187 | # ● 读取数据库 188 | # 初始化数据,当然如果你要用上面那样的控制符改变颜色的话 189 | # 欢迎枚举,格式就是上面这样用Hash,用ID做键把用语对应起来 190 | #-------------------------------------------------------------------------- 191 | def self.init_ready 192 | init_variable 193 | init_states 194 | init_params 195 | init_elements 196 | init_weapon_types 197 | init_armor_types 198 | init_skill_types 199 | init_etypes 200 | end 201 | #-------------------------------------------------------------------------- 202 | # ● 初始化用语的实例变量 203 | #-------------------------------------------------------------------------- 204 | def self.init_variable 205 | @states ||= {} 206 | @params ||= {} 207 | @weapon_types ||= {} 208 | @armor_types ||= {} 209 | @etypes ||= {} 210 | @skill_types ||= {} 211 | @elements ||= {} 212 | end 213 | #-------------------------------------------------------------------------- 214 | # ● 读取状态名称 215 | #-------------------------------------------------------------------------- 216 | def self.init_states 217 | return unless @states.empty? 218 | $data_states.each_with_index do |state,i| 219 | @states[i] = state.name unless state.nil? 220 | end 221 | end 222 | #-------------------------------------------------------------------------- 223 | # ● 读取能力用语 224 | #-------------------------------------------------------------------------- 225 | def self.init_params 226 | return unless @params.empty? 227 | $data_system.terms.params.each_with_index do |param,i| 228 | @params[i] = param 229 | end 230 | end 231 | #-------------------------------------------------------------------------- 232 | # ● 读取属性名称用语 233 | #-------------------------------------------------------------------------- 234 | def self.init_elements 235 | return unless @elements.empty? 236 | $data_system.elements.each_with_index do |element,i| 237 | @elements[i] = element unless element.nil? 238 | end 239 | end 240 | #-------------------------------------------------------------------------- 241 | # ● 读取武器类型用语 242 | #-------------------------------------------------------------------------- 243 | def self.init_weapon_types 244 | return unless @weapon_types.empty? 245 | $data_system.weapon_types.each_with_index do |type,i| 246 | @weapon_types[i] = type unless type.nil? 247 | end 248 | end 249 | #-------------------------------------------------------------------------- 250 | # ● 读取防具类型用语 251 | #-------------------------------------------------------------------------- 252 | def self.init_armor_types 253 | return unless @armor_types.empty? 254 | $data_system.armor_types.each_with_index do |type,i| 255 | @armor_types[i] = type unless type.nil? 256 | end 257 | end 258 | #-------------------------------------------------------------------------- 259 | # ● 读取技能类型用语 260 | #-------------------------------------------------------------------------- 261 | def self.init_skill_types 262 | return unless @skill_types.empty? 263 | $data_system.skill_types.each_with_index do |type,i| 264 | @skill_types[i] = type unless type.nil? 265 | end 266 | end 267 | #-------------------------------------------------------------------------- 268 | # ● 读取装备位置用语 269 | #-------------------------------------------------------------------------- 270 | def self.init_etypes 271 | return unless @etypes.empty? 272 | $data_system.terms.etypes.each_with_index do |type,i| 273 | @etypes[i] = type unless type.nil? 274 | end 275 | end 276 | #-------------------------------------------------------------------------- 277 | # ● 获取指定code的特性信息 278 | #-------------------------------------------------------------------------- 279 | def self.select_features(item,code) 280 | item.features.select {|f| f.code == code}.each {|index| yield index } 281 | end 282 | #-------------------------------------------------------------------------- 283 | # ● 获取指定code的使用效果信息 284 | #-------------------------------------------------------------------------- 285 | def self.select_effects(item,code) 286 | item.effects.select {|e| e.code == code}.each {|index| yield index } 287 | end 288 | #-------------------------------------------------------------------------- 289 | # ● 获取物品帮助说明 290 | #-------------------------------------------------------------------------- 291 | def self.get_item_help(item) 292 | name(item) + description(item) + skill_cost(item) + occasion(item) + 293 | price(item) + skill_speed(item) + success_rate(item) + item_type(item) + 294 | damage_scope(item) + buff_params(item) + atk_states(item) + 295 | special_flag(item) + (item.is_a?(RPG::Skill) ? required_wtype(item) : "") 296 | end 297 | #-------------------------------------------------------------------------- 298 | # ● 获取物品帮助说明 299 | #-------------------------------------------------------------------------- 300 | def self.get_equip_help(equip) 301 | name(equip) + description(equip) + price(equip) + etype_id(equip) + 302 | exdrop(equip) + equip_limit(equip) + equip_param(equip) + equip_slot(equip) + 303 | features_param(equip) + features_rate(equip) + state_attack(equip) + 304 | equip_skill(equip) + flag_ability(equip) 305 | end 306 | #-------------------------------------------------------------------------- 307 | # ● 获取物品技能名字 308 | #-------------------------------------------------------------------------- 309 | def self.name(item) 310 | if $VIPArcherScript[:itemcolor] # require 物品描绘颜色脚本 by:VIPArcher 311 | "\\c[16]名称:\\c[#{VIPArcher::ItemColor::Color_Lv[item.color]}]" + 312 | "#{item.name} #{(item.color.to_s + "★") if item.color != 0}\\c[0]\n" 313 | else 314 | "\\c[16]名称:\\c[0]#{item.name}\n" 315 | end 316 | end 317 | #-------------------------------------------------------------------------- 318 | # ● 获取物品技能背景说明 319 | #-------------------------------------------------------------------------- 320 | def self.description(item) 321 | "\\c[16]介绍:\\c[0]#{item.description}\n" 322 | end 323 | #-------------------------------------------------------------------------- 324 | # ● 获取技能物品使用场合 325 | #-------------------------------------------------------------------------- 326 | def self.occasion(item) 327 | return "" if item.occasion == 0 328 | "\\c[16]可用场合:#{OCCASION[item.occasion]}\\c[0]\n" 329 | end 330 | #-------------------------------------------------------------------------- 331 | # ● 获取物品价格信息 332 | #-------------------------------------------------------------------------- 333 | def self.price(item) 334 | return "" if item.is_a?(RPG::Skill) 335 | price = item.price == 0 ? "\\c[14]无法出售\\c[0]" : item.price.to_s 336 | if $VIPArcherScript[:load] # require 队伍负重脚本 337 | "\\c[16]售价:#{price} 重量:#{item.load}\\c[0]\n" 338 | else 339 | "\\c[16]售价:#{price}\\c[0]\n" 340 | end 341 | end 342 | #-------------------------------------------------------------------------- 343 | # ● 获取掉率扩展信息 344 | #-------------------------------------------------------------------------- 345 | def self.exdrop(equip) 346 | return "" if equip.is_a?(RPG::Item) 347 | return "" unless $VIPArcherScript[:exdrop_rate] # require 队伍掉率扩展 348 | equip.note =~ /<(\W+)掉率:\s*([0-9+.-]+)%>/i ? 349 | "\\c[#{$2.to_i > 0 ? UP : DOWN}]#{$1}掉率: #{$2}%\\c[0]\n" : "" 350 | end 351 | #-------------------------------------------------------------------------- 352 | # ● 获取装备能力限制数据 require 装备能力限制 by 后知后觉 353 | #-------------------------------------------------------------------------- 354 | def self.equip_limit(equip) 355 | help = "" 356 | return help unless $VIPArcherScript[:equip_limit] #装备能力限制 357 | help += "\\c[16]等级需求:#{equip.level_limit}\n" if equip.level_limit > 0 358 | 0..7.each do |i| 359 | if equip.params_limit(i) != 0 360 | help += "\\c[16]#{@params[i]}需求:#{equip.params_limit(i)}\\c[0]\n" 361 | end 362 | end ; help 363 | end 364 | #-------------------------------------------------------------------------- 365 | # ● 获取装备能力附加值 366 | #-------------------------------------------------------------------------- 367 | def self.equip_param(equip) 368 | help = "" 369 | equip.params.each_with_index do |param,i| 370 | value_color = "\\c[#{param > 0 ? UP : DOWN}]" 371 | value_string = "#{"+"if param > 0}#{param.to_int.to_s}\\c[0]\n" 372 | help += "#{@params[i]}: #{value_color}#{value_string}" if param != 0 373 | end ; help 374 | end 375 | #-------------------------------------------------------------------------- 376 | # ● 获取装备风格信息 377 | #-------------------------------------------------------------------------- 378 | def self.equip_slot(equip) 379 | if $VIPArcherScript[:slot_type] # require 装备风格扩展 by VIPArcher 380 | equip.note =~ //i ? 381 | "\\c[#{VIP}]#{CODE[55]}:#{SLOT_TYPE[$1.to_i]}\\c[0]\n" : "" 382 | else 383 | equip.features.any? {|f|f.code == 55} ? 384 | "\\c[#{VIP}]#{CODE[55]}:双持武器\\c[0]\n" : "" 385 | end 386 | end 387 | #-------------------------------------------------------------------------- 388 | # ● 获取装备位置信息 389 | #-------------------------------------------------------------------------- 390 | def self.etype_id(equip) 391 | "\\c[16]装备位置:\\c[0]#{Vocab::etype(equip.etype_id)}\\c[0]\n" 392 | end 393 | #-------------------------------------------------------------------------- 394 | # ● 获取技能装备限制 395 | #-------------------------------------------------------------------------- 396 | def self.required_wtype(skill) 397 | w_1 = $data_system.weapon_types[skill.required_wtype_id1] 398 | w_2 = $data_system.weapon_types[skill.required_wtype_id2] 399 | (w_1 + w_2).empty? ? "" : "\\c[#{DOWN}]武器限制:#{w_1} #{w_2}\\c[0]\n" 400 | end 401 | #-------------------------------------------------------------------------- 402 | # ● 获取技能消耗信息 403 | #-------------------------------------------------------------------------- 404 | def self.skill_cost(skill) 405 | return "" if skill.is_a?(RPG::Item) 406 | mp = skill.mp_cost > 0 ? "\\c[#{MP}]MP:#{skill.mp_cost}\\c[0]\n" : "" 407 | tp = skill.tp_cost > 0 ? "\\c[#{TP}]TP:#{skill.tp_cost}\\c[0]\n" : "" 408 | (mp + tp).empty? ? "" : "\\c[16]消耗:#{mp} #{tp}" 409 | end 410 | #-------------------------------------------------------------------------- 411 | # ● 获取技能物品速度修正 412 | #-------------------------------------------------------------------------- 413 | def self.skill_speed(skill) 414 | return "" if skill.speed == 0 415 | "\\c[#{skill.speed < 0 ? DOWN : UP}]速度修正:#{skill.speed}\\c[0]\n" 416 | end 417 | #-------------------------------------------------------------------------- 418 | # ● 获取技能物品成功率 419 | #-------------------------------------------------------------------------- 420 | def self.success_rate(skill) 421 | return "" if skill.success_rate == 100 422 | "\\c[#{DOWN}]成功率:#{skill.success_rate}%\\c[0]\n" 423 | end 424 | #-------------------------------------------------------------------------- 425 | # ● 获取技能伤害类型或者物品类型 426 | #-------------------------------------------------------------------------- 427 | def self.item_type(item) 428 | if item.is_a?(RPG::Skill) 429 | "\\c[16]伤害类型:#{HIT[item.hit_type]}\\c[0]\n" 430 | elsif item.is_a?(RPG::Item) 431 | "\\c[16]物品类型:\\c[#{VIP}]#{"贵重物品 " if item.itype_id != 1}" + 432 | "\\c[#{DOWN}]#{item.consumable ? "消耗品" : "非消耗品"}\\c[0]\n" 433 | else ; "" 434 | end 435 | end 436 | #-------------------------------------------------------------------------- 437 | # ● 获取技能物品效果范围 438 | #-------------------------------------------------------------------------- 439 | def self.damage_scope(item) 440 | scope = item.scope == 0 ? "" : "\\c[16]范围:#{SCOPE[item.scope]}\\c[0]\n" 441 | type,id = DAMAGE_TYPE[item.damage.type],@elements[item.damage.element_id] 442 | damage = item.damage.type == 0 ? "" : "\\c[16]效果:#{id}#{type}\\c[0]\n" 443 | scope + damage 444 | end 445 | #-------------------------------------------------------------------------- 446 | # ● 获取技能物品强化弱化效果 447 | #-------------------------------------------------------------------------- 448 | def self.buff_params(item) 449 | help = "" 450 | select_effects(item,31) do |e| 451 | help += "\\c[#{UP}]强化:#{@params[e.data_id]} #{e.value1.to_i}回合\\c[0]\n" 452 | end 453 | select_effects(item,32) do |e| 454 | help += "\\c[#{UP}]弱化:#{@params[e.data_id]} #{e.value1.to_i}回合\\c[0]\n" 455 | end 456 | select_effects(item,33) do |e| 457 | help += "\\c[#{UP}]解除:强化#{@params[e.data_id]}\\c[0]\n" 458 | end 459 | select_effects(item,34) do |e| 460 | help += "\\c[#{UP}]解除:弱化#{@params[e.data_id]}\\c[0]\n" 461 | end ; help 462 | end 463 | #-------------------------------------------------------------------------- 464 | # ● 获取技能物品附加移除状态 465 | #-------------------------------------------------------------------------- 466 | def self.atk_states(item) 467 | help = "" 468 | select_effects(item,21) do |e| 469 | state = e.data_id == 0 ? "普通攻击" : @states[e.data_id] 470 | help += "\\c[#{UP}]附加:#{state} #{(e.value1*100).to_i}%\\c[0]\n" 471 | end 472 | select_effects(item,22) do |e| 473 | help += "\\c[#{UP}]解除:#{@states[e.data_id]} #{(e.value1 * 100).to_i}%\\c[0]\n" 474 | end ; help 475 | end 476 | #-------------------------------------------------------------------------- 477 | # ● 获取技能物品特殊效果内容 478 | #-------------------------------------------------------------------------- 479 | def self.special_flag(item) 480 | help = "" 481 | select_effects(item,41) {|e| help += "\\c[#{VIP}]特殊效果:撤退\\c[0]\n"} 482 | select_effects(item,42) do |e| 483 | help += "\\c[#{UP}]提升:#{@params[e.data_id]}#{e.value1.to_i}点\\c[0]\n" 484 | end 485 | select_effects(item,43) do |e| 486 | help += "\\c[#{VIP}]学会:#{$data_skills[e.data_id].name}\\c[0]\n" 487 | end ; help 488 | end 489 | #-------------------------------------------------------------------------- 490 | # ● 获取装备特性能力值 491 | #-------------------------------------------------------------------------- 492 | def self.features_param(equip) 493 | help = "" 494 | equip.features.each do |f| 495 | value = "#{f.value < 0 ? "﹣" : "﹢"}#{(f.value.abs*100).to_i}%\\c[0]" 496 | params = case f.code 497 | when 21 then @params[f.data_id] 498 | when 22,23 then XPARAM[f.data_id] 499 | else ; next ; end 500 | help += "\\c[#{f.value < 0 ? DOWN : UP}]#{params}#{value}\n" 501 | end ; help 502 | end 503 | #-------------------------------------------------------------------------- 504 | # ● 获取装备状态抗性 505 | #-------------------------------------------------------------------------- 506 | def self.features_rate(equip) 507 | help = "" 508 | equip.features.each do |f| 509 | name,value = "#{CODE[f.code]}:","#{(f.value*100).to_i}%\\c[0]" 510 | params = case f.code 511 | when 11 then @elements[f.data_id] 512 | when 12 then @params[f.data_id] 513 | when 13 then @states[f.data_id] 514 | when 14 515 | help += "\\c[#{VIP}]#{name}#{@states[f.data_id]}\\c[0]\n" ; next 516 | else ; next ; end 517 | help += "\\c[#{UP}]#{name}#{params}×#{value}\\c[0]\n" 518 | end ; help 519 | end 520 | #-------------------------------------------------------------------------- 521 | # ● 获取装备附加状态攻击效果 522 | #-------------------------------------------------------------------------- 523 | def self.state_attack(equip) 524 | help = "" 525 | equip.features.each do |f| 526 | text = case f.code 527 | when 31 then "#{@elements[f.data_id]}" 528 | when 32 then "#{@states[f.data_id]}#{(f.value * 100).to_i}%" 529 | when 34 then help += "\\c[#{UP}]#{CODE[f.code]}:#{f.value}\\c[0]\n" ; next 530 | when 33 then color = f.value > 0 ? UP : DOWN 531 | help += "\\c[#{color}]#{CODE[f.code]}:#{f.value}\\c[0]\n" ; next 532 | else ; next ; end 533 | help += "\\c[#{UP}]#{CODE[f.code]}:#{text}\\c[0]\n" 534 | end ; help 535 | end 536 | #-------------------------------------------------------------------------- 537 | # ● 获取装备附加装备效果技能 538 | #-------------------------------------------------------------------------- 539 | def self.equip_skill(equip) 540 | help = "" 541 | if $VIPArcherScript[:slot_type] # require 装备风格扩展 by VIPArcher 542 | equip.note.split(/[\r\n]+/).each do |line| 543 | help += line =~ //i ? 544 | "\\c[#{DOWN}]#{CODE[53]}:#{Vocab.etype($1.to_i)}\\c[0]\n" : "" 545 | help += line =~ //i ? 546 | "\\c[#{DOWN}]#{CODE[54]}:#{Vocab.etype($1.to_i)}\\c[0]\n" : "" 547 | end 548 | end 549 | equip.features.each do |f| 550 | text = case f.code 551 | when 41,42 then "#{CODE[f.code]}:#{@skill_types[f.data_id]}" 552 | when 43,44 then "#{CODE[f.code]}:#{$data_skills[f.data_id].name}" 553 | when 51 554 | help += "\\c[#{UP}]#{CODE[f.code]}:#{@weapon_types[f.data_id]}\\c[0]\n" ; next 555 | when 52 556 | help += "\\c[#{UP}]#{CODE[f.code]}:#{@armor_types[f.data_id]}\\c[0]\n" ; next 557 | when 53,54 558 | help += "\\c[#{DOWN}]#{CODE[f.code]}:#{@etypes[f.data_id]}\\c[0]\n" ; next 559 | else ; next ; end 560 | help += "\\c[#{f.code % 2 == 0 ? DOWN : UP}]#{text}\\c[0]\n" 561 | end ; help 562 | end 563 | #-------------------------------------------------------------------------- 564 | # ● 获取装备标志和队伍能力 565 | #-------------------------------------------------------------------------- 566 | def self.flag_ability(equip) 567 | help = "" 568 | equip.features.each do |f| 569 | flag_party = case f.code 570 | when 61 571 | help += "\\c[#{VIP}]#{CODE[f.code]}:#{(f.value * 100).to_i}%\\c[0]\n" ; next 572 | when 62 then FLAG[f.data_id] 573 | when 64 then PARTY_ABILITY[f.data_id] 574 | else ; next ; end 575 | help += "\\c[#{VIP}]#{CODE[f.code]}:#{flag_party}\\c[0]\n" 576 | end ; help 577 | end 578 | #-------------------------------------------------------------------------- 579 | # ● 计算行数 有些字体的汉字和[字母,数字,符号]的宽度不同, 580 | # 有可能会照成行数计算不对,尽量用宽度相同的字体吧 581 | #-------------------------------------------------------------------------- 582 | def self.get_line(text,max_size) 583 | xtext,line,text_new = [],0,"" 584 | text.each_line{|x| text_new += x.gsub(/\\\S\[\d+\]/i){}} #去掉控制符 585 | text_new.each_line{|x| xtext.push x.gsub(/\n/){}} #去掉换行符 586 | xtext.each{|x| line += (x.size / (max_size.to_f + 1).to_i) + 1} 587 | line 588 | end 589 | end 590 | #============================================================================== 591 | # ■ Window_Help_Ex 592 | #------------------------------------------------------------------------------ 593 | #  加强显示特技和物品等的说明 594 | #============================================================================== 595 | class Window_Help_Ex < Window_Help 596 | include VIPArcher 597 | #-------------------------------------------------------------------------- 598 | # ● 初始化对象 599 | #-------------------------------------------------------------------------- 600 | def initialize(viewport) 601 | super(0) ; self.viewport ,self.width ,self.height = viewport ,210 ,0 602 | contents.font.size ,self.z ,@time = 14 ,150 ,0 603 | end 604 | #-------------------------------------------------------------------------- 605 | # ● ***********计算窗口显示指定行数时的应用高度(适应字体大小)*********** 606 | #-------------------------------------------------------------------------- 607 | def fitting_height_vip(line_number) 608 | line_number * contents.font.size + standard_padding * 2 609 | end 610 | #-------------------------------------------------------------------------- 611 | # ● 绘制带有控制符的文本内容 612 | # 如果传递了width参数的话,会自动换行 613 | # draw_text_ex的增强,使其可以自动换行 原作者:叶子 修改:wyongcan 614 | #-------------------------------------------------------------------------- 615 | def draw_text_ex(x, y, text, width = nil,text_width = nil,normalfont = true) 616 | reset_font_settings if normalfont == true 617 | text = convert_escape_characters(text) 618 | pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)} 619 | unless width.nil? 620 | pos[:height],pos[:width],pos[:text_width] = contents.font.size,width,text_width 621 | end 622 | process_character(text.slice!(0, 1), text, pos) until text.empty? 623 | end 624 | #-------------------------------------------------------------------------- 625 | # ● 文字的处理 626 | # c : 文字 627 | # text : 绘制处理中的字符串缓存(字符串可能会被修改) 628 | # pos : 绘制位置 {:x, :y, :new_x, :height} 629 | #-------------------------------------------------------------------------- 630 | def process_character(c, text, pos) 631 | super(c, text, pos) 632 | text_width = pos[:text_width].nil? ? text_size(c).width : pos[:text_width] 633 | process_new_line(text, pos) if pos[:width] != nil && 634 | pos[:x] - pos[:new_x] + text_width > pos[:width] 635 | end 636 | #-------------------------------------------------------------------------- 637 | # ● 处理换行文字 638 | #-------------------------------------------------------------------------- 639 | def process_new_line(text, pos) 640 | super(text, pos) 641 | pos[:height] = contents.font.size unless pos[:width].nil? 642 | end 643 | #-------------------------------------------------------------------------- 644 | # ● 设置内容 645 | #-------------------------------------------------------------------------- 646 | def set_text(text) 647 | @text = text if text != @text 648 | end 649 | #-------------------------------------------------------------------------- 650 | # ● 更新帮助位置 651 | #-------------------------------------------------------------------------- 652 | def uppos(index,rect,window) 653 | self.height = fitting_height_vip(Help_Ex.get_line(@text,13)) 654 | create_contents 655 | contents.font.name,contents.font.size = Help_Ex::Font_Name,Help_Ex::Font_Size 656 | rect.x -= window.ox ; rect.y -= window.oy 657 | ax = rect.x + rect.width + 10 658 | ax = rect.x - self.width + 10 if ax + self.width > window.width + 10 659 | ax = 0 if ax < 0 ; ay = rect.y + rect.height 660 | ay = rect.y - self.height if ay + self.height > window.height 661 | ax += window.x ; ay += window.y 662 | ay = 0 if ay < 0 ; self.show 663 | self.x , self.y , self.openness, @time = ax , ay , 0 , Help_Ex::TIME 664 | refresh 665 | end 666 | #-------------------------------------------------------------------------- 667 | # ● 设置物品 668 | # item : 技能、物品等 669 | #-------------------------------------------------------------------------- 670 | def set_item(item) 671 | return self.hide unless item ; text = "" 672 | text += if item.is_a?(RPG::EquipItem) then Help_Ex.get_equip_help(item) 673 | else ; Help_Ex.get_item_help(item) ; end 674 | text = text[0,text.size - 2] if text[text.size - 2,2] == "\n" 675 | set_text(text) 676 | end 677 | #-------------------------------------------------------------------------- 678 | # ● 刷新 679 | #-------------------------------------------------------------------------- 680 | def refresh 681 | contents.clear 682 | self.hide if @text == "" 683 | draw_text_ex(4, 0, @text,width,40,false) 684 | end 685 | #-------------------------------------------------------------------------- 686 | # ● 更新画面 687 | #-------------------------------------------------------------------------- 688 | def update 689 | super ; @time -= 1 if @time > 0 ; self.open if @time == 0 690 | end 691 | end 692 | #============================================================================== 693 | # ■ 设置帮助增强窗口 694 | #============================================================================== 695 | class Window_Selectable < Window_Base 696 | attr_reader :help_ex_window 697 | #-------------------------------------------------------------------------- 698 | # ● 调用帮助窗口的更新方法 699 | #-------------------------------------------------------------------------- 700 | alias help_ex_call_update_help call_update_help 701 | def call_update_help 702 | help_ex_call_update_help ; update_ex_help if active && @help_ex_window 703 | end 704 | #-------------------------------------------------------------------------- 705 | # ● 更新帮助内容 706 | #-------------------------------------------------------------------------- 707 | def update_ex_help 708 | @help_ex_window.set_item(item) if @help_ex_window 709 | @help_ex_window.uppos(index,item_rect(index),self) if index != -1 && item 710 | end 711 | #-------------------------------------------------------------------------- 712 | # ● 设置帮助增强窗口 713 | #-------------------------------------------------------------------------- 714 | def help_ex_window=(help_ex_window) 715 | @help_ex_window = help_ex_window 716 | end 717 | end 718 | #============================================================================== 719 | # ■ 在各场景处理帮助窗口 720 | #============================================================================== 721 | class Scene_Base 722 | #-------------------------------------------------------------------------- 723 | # ● 生成帮助增强窗口 724 | #-------------------------------------------------------------------------- 725 | def create_help_ex 726 | @help_ex_window = Window_Help_Ex.new(@viewport) 727 | @item_window.help_ex_window = @help_ex_window if @item_window 728 | @slot_window.help_ex_window = @help_ex_window if @slot_window 729 | @skill_window.help_ex_window = @help_ex_window if @skill_window 730 | @buy_window.help_ex_window = @help_ex_window if @buy_window 731 | @sell_window.help_ex_window = @help_ex_window if @sell_window 732 | end 733 | end 734 | #道具栏 735 | class Scene_Item < Scene_ItemBase 736 | #-------------------------------------------------------------------------- 737 | # ● 开始处理 738 | #-------------------------------------------------------------------------- 739 | alias help_ex_start start 740 | def start 741 | help_ex_start ; create_help_ex 742 | end 743 | #-------------------------------------------------------------------------- 744 | # ● 物品“取消” 745 | #-------------------------------------------------------------------------- 746 | alias help_ex_on_item_cancel on_item_cancel 747 | def on_item_cancel 748 | help_ex_on_item_cancel ; @help_ex_window.hide 749 | end 750 | end 751 | #装备栏 752 | class Scene_Equip < Scene_MenuBase 753 | #-------------------------------------------------------------------------- 754 | # ● 开始处理 755 | #-------------------------------------------------------------------------- 756 | alias help_ex_start start 757 | def start 758 | help_ex_start ; create_help_ex 759 | end 760 | #-------------------------------------------------------------------------- 761 | # ● 装备栏“取消” 762 | #-------------------------------------------------------------------------- 763 | alias help_ex_on_slot_cancel on_slot_cancel 764 | def on_slot_cancel 765 | help_ex_on_slot_cancel ; @help_ex_window.hide 766 | end 767 | end 768 | #技能栏 769 | class Scene_Skill < Scene_ItemBase 770 | #-------------------------------------------------------------------------- 771 | # ● 开始处理 772 | #-------------------------------------------------------------------------- 773 | alias help_ex_start start 774 | def start 775 | help_ex_start ; create_help_ex 776 | end 777 | #-------------------------------------------------------------------------- 778 | # ● 物品“确定” 779 | #-------------------------------------------------------------------------- 780 | alias help_ex_on_item_ok on_item_ok 781 | def on_item_ok 782 | help_ex_on_item_ok ; @help_ex_window.hide 783 | end 784 | #-------------------------------------------------------------------------- 785 | # ● 物品“取消” 786 | #-------------------------------------------------------------------------- 787 | alias help_ex_on_item_cancel on_item_cancel 788 | def on_item_cancel 789 | help_ex_on_item_cancel ; @help_ex_window.hide 790 | end 791 | end 792 | #战斗界面 793 | class Scene_Battle < Scene_Base 794 | #-------------------------------------------------------------------------- 795 | # ● 开始处理 796 | #-------------------------------------------------------------------------- 797 | alias help_ex_start start 798 | def start 799 | help_ex_start ; create_help_ex 800 | end 801 | #-------------------------------------------------------------------------- 802 | # ● 技能“确定” 803 | #-------------------------------------------------------------------------- 804 | alias help_ex_on_skill_ok on_skill_ok 805 | def on_skill_ok 806 | help_ex_on_skill_ok ; @help_ex_window.hide 807 | end 808 | #-------------------------------------------------------------------------- 809 | # ● 技能“取消” 810 | #-------------------------------------------------------------------------- 811 | alias help_ex_on_skill_cancel on_skill_cancel 812 | def on_skill_cancel 813 | help_ex_on_skill_cancel ; @help_ex_window.hide 814 | end 815 | #-------------------------------------------------------------------------- 816 | # ● 物品“确定” 817 | #-------------------------------------------------------------------------- 818 | alias help_ex_on_item_ok on_item_ok 819 | def on_item_ok 820 | help_ex_on_item_ok ; @help_ex_window.hide 821 | end 822 | #-------------------------------------------------------------------------- 823 | # ● 物品“取消” 824 | #-------------------------------------------------------------------------- 825 | alias help_ex_on_item_cancel on_item_cancel 826 | def on_item_cancel 827 | help_ex_on_item_cancel ; @help_ex_window.hide 828 | end 829 | end 830 | #商店界面 831 | class Scene_Shop < Scene_MenuBase 832 | #-------------------------------------------------------------------------- 833 | # ● 开始处理 834 | #-------------------------------------------------------------------------- 835 | alias help_ex_start start 836 | def start 837 | help_ex_start ; create_help_ex 838 | end 839 | #-------------------------------------------------------------------------- 840 | # ● 买入“确定” 841 | #-------------------------------------------------------------------------- 842 | alias help_ex_on_buy_ok on_buy_ok 843 | def on_buy_ok 844 | help_ex_on_buy_ok ; @help_ex_window.hide 845 | end 846 | #-------------------------------------------------------------------------- 847 | # ● 买入“取消” 848 | #-------------------------------------------------------------------------- 849 | alias help_ex_on_buy_cancel on_buy_cancel 850 | def on_buy_cancel 851 | help_ex_on_buy_cancel ; @help_ex_window.hide 852 | end 853 | #-------------------------------------------------------------------------- 854 | # ● 卖出“确定” 855 | #-------------------------------------------------------------------------- 856 | alias help_ex_on_sell_ok on_sell_ok 857 | def on_sell_ok 858 | help_ex_on_sell_ok ; @help_ex_window.hide 859 | end 860 | #-------------------------------------------------------------------------- 861 | # ● 卖出“取消” 862 | #-------------------------------------------------------------------------- 863 | alias help_ex_on_sell_cancel on_sell_cancel 864 | def on_sell_cancel 865 | help_ex_on_sell_cancel ; @help_ex_window.hide 866 | end 867 | end 868 | #============================================================================== 869 | # ★ 脚本顺序检查 ★ 870 | #============================================================================== 871 | msgbox "物品描绘颜色脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:itemcolor] && 872 | $VIPArcherScript[:help_ex] > $VIPArcherScript[:itemcolor] 873 | msgbox "队伍掉率扩展脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:exdrop_rate] && 874 | $VIPArcherScript[:help_ex] > $VIPArcherScript[:exdrop_rate] 875 | msgbox "装备风格扩展脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:slot_type] && 876 | $VIPArcherScript[:help_ex] > $VIPArcherScript[:slot_type] 877 | msgbox "队伍负重脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:load] && 878 | $VIPArcherScript[:help_ex] > $VIPArcherScript[:load] -------------------------------------------------------------------------------- /scripts/足音.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # +++ 足音 v1.1 +++ 3 | # By:VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # v1.1 删掉一些不必要的语句 7 | # v1.0 完成基础脚本 8 | #============================================================================== 9 | # 10 | # 设定玩家在不同地形标志移动时不同的脚步声 11 | # 12 | # 如果不想用地形标志来判断,想用区域ID的话就把脚本倒数第9行? 13 | # $game_player.terrain_tag 改成 $game_player.region_id 14 | # 15 | # 脚步声的素材名称命名是有一定规则的。例如Step0_0 16 | # "Step"+地形标志ID+"_"+随机编号(0-3) 17 | # 脚步声素材每组4枚。例如地形标志为2的脚步声 18 | # 就命名为[Step2_0.ogg;Step2_1.ogg;Step2_2.ogg;Step2_3.ogg] 19 | # 也可以设置一些区域是没有脚步声的。 20 | # 效果的开关可以通过控制设置的开关进行控制 21 | # 22 | #============================================================================== 23 | $VIPArcherScript ||= {};$VIPArcherScript[:footsound] = 20140909 24 | #------------------------------------------------------------------------------- 25 | module VIPArcher end 26 | #============================================================================== 27 | # ★ 设定部分 ★ 28 | #============================================================================== 29 | module VIPArcher::FOOTSOUND 30 | SW = 1 #关闭脚步声开关编号 打开此开关不播放脚步声 31 | NOSOUND = [0,1] #没有脚步声的地形标志 32 | SOUNDURL = "Audio/SE/Footsound/" #脚本声素材路径 33 | VOL = 50 #音量 34 | PITCH = 100 #音调 35 | end 36 | #============================================================================== 37 | # ☆ 设定结束 ☆ 38 | #============================================================================== 39 | class Game_Party < Game_Unit 40 | include VIPArcher::FOOTSOUND 41 | #-------------------------------------------------------------------------- 42 | # ● 角色移动一步时的处理 43 | #-------------------------------------------------------------------------- 44 | alias vip_20140909_on_player_walk on_player_walk 45 | def on_player_walk 46 | vip_20140909_on_player_walk 47 | foot_sound_play 48 | end 49 | #-------------------------------------------------------------------------- 50 | # ● 播放脚步声 #要用区域ID就改成 tag = $game_player.region_id 51 | #-------------------------------------------------------------------------- 52 | def foot_sound_play 53 | tag = $game_player.terrain_tag 54 | return if $game_switches[SW] 55 | return if NOSOUND.include?(tag) 56 | Audio.se_play("#{SOUNDURL}Step#{tag}_#{rand(4)}",VOL,PITCH) if @step_off 57 | @step_off ^= true #这里只是为了每2步才播放一次脚本声 58 | end 59 | end -------------------------------------------------------------------------------- /scripts/跳过标题.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 跳过标题 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | $VIPArcherScript ||= {};$VIPArcherScript[:skip_title] = 20140701 7 | #-------------------------------------------------------------------------------- 8 | module VIPArcher end 9 | #============================================================================== 10 | # ★ 设定部分 ★ 11 | #============================================================================== 12 | module VIPArcher::SkipTitle 13 | Allowed = false #是否允许返回标题 14 | end 15 | #============================================================================== 16 | # ☆ 设定结束 ☆ 17 | #============================================================================== 18 | class << SceneManager 19 | def first_scene_class 20 | DataManager.setup_new_game 21 | $game_map.autoplay 22 | Scene_Map 23 | end 24 | end unless $BTEST 25 | #------------------------------------------------------------------------------- 26 | class Scene_End < Scene_MenuBase 27 | #-------------------------------------------------------------------------- 28 | # ● 返回标题改成开始新游戏 29 | #-------------------------------------------------------------------------- 30 | def command_to_title 31 | DataManager.setup_new_game 32 | close_command_window 33 | fadeout_all 34 | $game_map.autoplay 35 | SceneManager.goto(Scene_Map) 36 | end unless VIPArcher::SkipTitle::Allowed 37 | end 38 | #------------------------------------------------------------------------------- 39 | class Scene_Gameover < Scene_Base 40 | #-------------------------------------------------------------------------- 41 | # ● 结束游戏画面切换到标题画面 42 | #-------------------------------------------------------------------------- 43 | def goto_title 44 | DataManager.setup_new_game 45 | fadeout_all 46 | $game_map.autoplay 47 | SceneManager.goto(Scene_Map) 48 | end unless VIPArcher::SkipTitle::Allowed 49 | end 50 | #------------------------------------------------------------------------------- 51 | class Game_Interpreter 52 | #-------------------------------------------------------------------------- 53 | # ● 返回标题画面 54 | #-------------------------------------------------------------------------- 55 | def command_354 56 | DataManager.setup_new_game 57 | $game_map.autoplay 58 | SceneManager.goto(Scene_Map) 59 | Fiber.yield 60 | end unless VIPArcher::SkipTitle::Allowed 61 | end -------------------------------------------------------------------------------- /scripts/选项窗口光标.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 选项窗口光标 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 说明: 7 | # 插入该脚本后游戏的的 Window_Selectable 及其子类窗口都会拥有一个光标。 8 | # 光标文件放在 Graphics\System 文件夹下名为为 "WindowCursor" 9 | # 光标文件不存在时,会使用窗口皮肤的右向的那个小箭头作为光标。 10 | #============================================================================== 11 | $VIPArcherScript ||= {};$VIPArcherScript[:window_cursor] = 20150513 12 | #------------------------------------------------------------------------------- 13 | module VIPArcher end 14 | #============================================================================== 15 | # ★ 设定部分 ★ 16 | #============================================================================== 17 | module VIPArcher::WindowCursor 18 | FILENAME = "WindowCursor" # 光标的文件名(放在 Graphics\System 文件夹下) 19 | BUFFER_X = 0 # 光标 X 坐标的修正量 20 | BUFFER_Y = 6 # 光标 Y 坐标的修正量 21 | EFFECT_TYPE = 1 # 特效: nil => 无特效,1 => 横向,2 => 纵向 22 | EFFECT_SPEED = 8 # 刷新特性的速度(请勿设置为 0) 23 | CURSOR_FRAME = 1 # 光标的帧数(使用素材做光标时的素材帧数) 24 | end 25 | #============================================================================== 26 | # ☆ 设定结束 ☆ 27 | #============================================================================== 28 | class Sprite_WindowCursor < Sprite_Base 29 | include VIPArcher::WindowCursor 30 | #-------------------------------------------------------------------------- 31 | # initialize 32 | #-------------------------------------------------------------------------- 33 | def initialize(window) 34 | super(window.viewport) 35 | @window, @effect, self.opacity = window, [0,0,0], 0 36 | create_bitmap 37 | end 38 | #-------------------------------------------------------------------------- 39 | # create_bitmap 40 | #-------------------------------------------------------------------------- 41 | def create_bitmap 42 | begin 43 | self.bitmap = Cache.system(FILENAME) 44 | @w, @h, @frame = self.bitmap.width / CURSOR_FRAME, self.bitmap.height, 0 45 | self.src_rect.set(@frame, 0, @w, @h) 46 | rescue 47 | self.bitmap = Bitmap.new(10, 16) 48 | @w, @h = self.bitmap.width, self.bitmap.height 49 | self.bitmap.blt(0, 0,@window.windowskin, Rect.new(102, 24, 10, 16)) 50 | end 51 | end 52 | #-------------------------------------------------------------------------- 53 | # ● 更新精灵 54 | #-------------------------------------------------------------------------- 55 | def update 56 | super 57 | update_visibility 58 | update_position 59 | update_effect if Graphics.frame_count % EFFECT_SPEED == 0 60 | end 61 | #-------------------------------------------------------------------------- 62 | # ● 释放 63 | #-------------------------------------------------------------------------- 64 | def dispose 65 | self.bitmap.dispose 66 | super 67 | end 68 | #-------------------------------------------------------------------------- 69 | # ● 更新特效 70 | #-------------------------------------------------------------------------- 71 | def update_effect 72 | update_src_rect 73 | return unless EFFECT_TYPE 74 | case @effect[0] += 1 75 | when 1..7 then @effect[EFFECT_TYPE] += 1 76 | when 8..14 then @effect[EFFECT_TYPE] -= 1 77 | else @effect[0] = 0 end 78 | end 79 | #-------------------------------------------------------------------------- 80 | # ● 更新源矩形 81 | #-------------------------------------------------------------------------- 82 | def update_src_rect 83 | return if @w == self.bitmap.width 84 | sx = (@frame += 1) % CURSOR_FRAME * @w 85 | self.src_rect.set(sx, 0, @w, @h) 86 | end 87 | #-------------------------------------------------------------------------- 88 | # ● 更新可见性 89 | #-------------------------------------------------------------------------- 90 | def update_visibility 91 | self.visible = @window.visible 92 | self.visible = @window.openness > 250 93 | self.opacity += @window.active ? 45 : -45 94 | self.opacity = 0 if @window.index < 0 95 | end 96 | #-------------------------------------------------------------------------- 97 | # ● 更新位置 98 | #-------------------------------------------------------------------------- 99 | def update_position 100 | rect = @window.cursor_rect 101 | self.z = @window.z + 100 102 | self.x = @window.x + rect.x - @window.ox + BUFFER_X + @effect[1] 103 | self.y = @window.y + rect.y - @window.oy + 104 | BUFFER_Y + rect.height / 2 + @effect[2] 105 | end 106 | end 107 | #============================================================================== 108 | class Window_Selectable < Window_Base 109 | #-------------------------------------------------------------------------- 110 | # ● 初始化对象 111 | #------------------------------------------------------------------------- 112 | alias cursor_sprite_initialize initialize 113 | def initialize(*args) 114 | cursor_sprite_initialize(*args) 115 | create_cursor_sprite 116 | end 117 | #-------------------------------------------------------------------------- 118 | # ● 创建光标 注:如果某类选项窗口不需要光标,可在其窗口类中重定义该方法 119 | #-------------------------------------------------------------------------- 120 | def create_cursor_sprite 121 | @cursor_sprite = Sprite_WindowCursor.new(self) 122 | end 123 | #-------------------------------------------------------------------------- 124 | # ● 释放 125 | #-------------------------------------------------------------------------- 126 | alias cursor_sprite_dispose dispose 127 | def dispose 128 | cursor_sprite_dispose 129 | @cursor_sprite.dispose if @cursor_sprite 130 | end 131 | #-------------------------------------------------------------------------- 132 | # ● 更新画面 133 | #-------------------------------------------------------------------------- 134 | alias cursor_sprite_update update 135 | def update 136 | cursor_sprite_update 137 | @cursor_sprite.update if @cursor_sprite 138 | end 139 | end -------------------------------------------------------------------------------- /scripts/镜像.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # 镜子 v1.2 By:VIPArcher [email: VIPArcher@sina.com] 3 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 4 | #=============================================================================== 5 | # 说明: 6 | # 在地图下方生成人物行走图做成模仿镜子的效果。站在指定区域时镜像才可见 7 | # 事件中注释或者行走图文件名带有(reflecthide)的事件/角色不显示镜像。 8 | # 事件中调用get_character(param).reflect_index = x 9 | # 事件中调用get_character(param).reflect_name = "行走图文件名" 10 | # 更改该事件/角色的镜像的行走图 11 | # param : -1 则玩家、0 则本事件、其他 则是指定的事件ID 12 | # x:索引ID,0~7代表8个行走图位置 13 | # 事件移动指令中执行脚本@reflect_name = "行走图文件名" 14 | # 或 @reflect_index = x 和上面是一样的效果 15 | #=============================================================================== 16 | $VIPArcherScript ||= {};$VIPArcherScript[:reflect] = 20140917 17 | #------------------------------------------------------------------------------- 18 | module VIPArcher end 19 | #============================================================================== 20 | # ☆ 设定部分 ☆ 21 | #============================================================================== 22 | module VIPArcher::Reflect 23 | 24 | Z = -1 #显示镜像的z坐标(调的太低或太高可能会被其他不必要的物件遮挡 25 | 26 | REG_SY = { #设置可见镜像的区域ID以及对镜像高度调整的值 27 | #区域ID => 镜像“高度” 28 | 1 => 30, 29 | 2 => 48, 30 | 3 => 54 31 | };REG_SY.default = 0 #这行不能删 32 | end 33 | #============================================================================== 34 | # ★ 设定结束 ★ 35 | #============================================================================== 36 | class Game_CharacterBase ; attr_accessor :reflect_index , :reflect_name end 37 | #============================================================================== 38 | # 脚本部分 39 | #============================================================================== 40 | class Sprite_Reflect < Sprite_Character 41 | include VIPArcher::Reflect 42 | #-------------------------------------------------------------------------- 43 | # ● 初始化对象 44 | # character : Game_Character 45 | #-------------------------------------------------------------------------- 46 | def initialize(viewport, character = nil) 47 | character.reflect_name ||= character.character_name 48 | character.reflect_index ||= character.character_index 49 | super(viewport, character) 50 | end 51 | #-------------------------------------------------------------------------- 52 | # ● 更新位置 53 | #-------------------------------------------------------------------------- 54 | def update_position 55 | self.mirror , self.x , self.z = true , @character.screen_x , Z 56 | self.y = @character.screen_y - REG_SY[@character.region_id] 57 | end 58 | #-------------------------------------------------------------------------- 59 | # ● 更新其他 60 | #-------------------------------------------------------------------------- 61 | def update_other 62 | self.opacity = @character.opacity - 40 63 | self.blend_type = @character.blend_type 64 | self.bush_depth = @character.bush_depth 65 | self.visible = region_id? && !name_hide? && !note_hide? 66 | self.visible = !@character.transparent if self.visible 67 | end 68 | #-------------------------------------------------------------------------- 69 | # ● 注释有(reflecthide)的事件不显示镜像 70 | #-------------------------------------------------------------------------- 71 | def note_hide? 72 | return unless @character.is_a?(Game_Event) 73 | return if @character.list.nil? 74 | @character.list.each do |command| 75 | if command.code == 108 or command.code == 408 76 | command.parameters.each do |line| 77 | return true if line.include?("(reflecthide)") 78 | end 79 | end 80 | end ; false 81 | end 82 | #-------------------------------------------------------------------------- 83 | # ● 行走图文件名带有(reflecthide)的角色/事件不显示镜像 84 | #-------------------------------------------------------------------------- 85 | def name_hide? ; @character.character_name.include?("(reflecthide)") end 86 | #-------------------------------------------------------------------------- 87 | # ● 角色/事件站在区域ID为REG_SY时才显示镜像 88 | #-------------------------------------------------------------------------- 89 | def region_id? ; REG_SY.has_key?(@character.region_id) end 90 | #-------------------------------------------------------------------------- 91 | # ● 更新源位图(Source Bitmap) 92 | #-------------------------------------------------------------------------- 93 | def update_bitmap 94 | return unless graphic_changed? 95 | @character_name = @character.reflect_name 96 | @character_index = @character.reflect_index 97 | set_character_bitmap 98 | end 99 | #-------------------------------------------------------------------------- 100 | # ● 判定图像是否被更改 101 | #-------------------------------------------------------------------------- 102 | def graphic_changed? 103 | @character_name != @character.reflect_name || 104 | @character_index != @character.reflect_index 105 | end 106 | #-------------------------------------------------------------------------- 107 | # ● 更新源矩形 108 | #-------------------------------------------------------------------------- 109 | def update_src_rect 110 | index = @character.reflect_index 111 | pattern = @character.pattern < 3 ? @character.pattern : 1 112 | sx = (index % 4 * 3 + pattern) * @cw 113 | sy = (index / 4 * 4 + (8 - @character.direction) / 2) * @ch 114 | self.src_rect.set(sx, sy, @cw, @ch) 115 | end 116 | #-------------------------------------------------------------------------- 117 | # ● 取消心情动画显示 118 | #-------------------------------------------------------------------------- 119 | def setup_new_effect ; end 120 | end 121 | #------------------------------------------------------------------------------- 122 | class Spriteset_Map 123 | #-------------------------------------------------------------------------- 124 | # ● 生成镜像精灵 125 | #-------------------------------------------------------------------------- 126 | alias reflect_create_characters create_characters 127 | def create_characters 128 | reflect_create_characters 129 | @character_reflect_sprites = [] 130 | $game_map.events.values.each do |event| 131 | @character_reflect_sprites.push(Sprite_Reflect.new(@viewport1, event)) 132 | end 133 | $game_player.followers.reverse_each do |follower| 134 | @character_reflect_sprites.push(Sprite_Reflect.new(@viewport1,follower)) 135 | end 136 | @character_reflect_sprites.push(Sprite_Reflect.new(@viewport1,$game_player)) 137 | end 138 | #-------------------------------------------------------------------------- 139 | # ● 释放镜像精灵 140 | #-------------------------------------------------------------------------- 141 | alias reflect_dispose_characters dispose_characters 142 | def dispose_characters 143 | reflect_dispose_characters 144 | @character_reflect_sprites.each {|sprite| sprite.dispose } 145 | end 146 | #-------------------------------------------------------------------------- 147 | # ● 刷新镜像精灵 148 | #-------------------------------------------------------------------------- 149 | alias reflect_update_characters update_characters 150 | def update_characters 151 | reflect_update_characters 152 | @character_reflect_sprites.each {|sprite| sprite.update } 153 | end 154 | end -------------------------------------------------------------------------------- /scripts/队伍掉落率金钱获得率扩展.rb: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # ■ 队伍掉率扩展 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # ■ 通过备注改变队伍能力的掉落率,由于是直接覆盖了原方法, 7 | # 所以特性里的双倍掉率,双倍金钱无效了。这点请注意 8 | # 使用说明: 9 | # 在角色|职业|装备|状态的备注栏备注上对应的信息 10 | # 改变物品掉率备注<物品掉率:X%> X为概率 可为负数、小数 11 | # 改变金钱掉率备注<金钱掉率:X%> X为概率 可为负数、小数 12 | # 同时存在多个备注可叠加,最终的掉率为(100 + 总的掉率改变量)% 13 | #============================================================================== 14 | $VIPArcherScript ||= {};$VIPArcherScript[:exdrop_rate] = __FILE__ #20141103 15 | #------------------------------------------------------------------------------- 16 | class Game_Enemy < Game_Battler 17 | #-------------------------------------------------------------------------- 18 | # ● 获取物品掉率的倍率 19 | #-------------------------------------------------------------------------- 20 | def drop_item_rate 21 | return $game_party.party_drop_rate 22 | end 23 | end 24 | #------------------------------------------------------------------------------- 25 | class Game_Troop < Game_Unit 26 | #-------------------------------------------------------------------------- 27 | # ● 获取金钱的倍率 28 | #-------------------------------------------------------------------------- 29 | def gold_rate 30 | return $game_party.gold_drop_rate 31 | end 32 | end 33 | #------------------------------------------------------------------------------- 34 | class Game_Party < Game_Unit 35 | #-------------------------------------------------------------------------- 36 | # ● 获取全队伍物品掉率总值 37 | #-------------------------------------------------------------------------- 38 | def party_drop_rate 39 | drop_rate = 100 40 | battle_members.each {|actor| actor.feature_objects.each {|obj| 41 | drop_rate += $1.to_f if obj.note =~ /<物品掉率:\s*([0-9+.-]+)%>/}} 42 | return drop_rate / 100 43 | end 44 | #-------------------------------------------------------------------------- 45 | # ● 获取全队伍金钱掉率总值 46 | #-------------------------------------------------------------------------- 47 | def gold_drop_rate 48 | gold_rate = 100 49 | battle_members.each {|actor| actor.feature_objects.each {|obj| 50 | gold_rate += $1.to_f if obj.note =~ /<金钱掉率:\s*([0-9+.-]+)%>/}} 51 | return gold_rate / 100 52 | end 53 | end -------------------------------------------------------------------------------- /scripts/队伍负重系统.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # +++ VX移植 - VA负重系统改进版 +++ 3 | #============================================================================== 4 | # VX版 原作者 By 雪流星 5 | # 蓝本 杂兵天下的VA移植版 6 | # 改进 By:VIPArcher [email: VIPArcher@sina.com] 7 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 8 | #============================================================================== 9 | # 物品备注 则该物品占用 N 点负重 10 | # load也可以写成「负重」或「負重」#注:没有“「」” 11 | # 不写的话默认为 Default_Load 12 | # 更改当前负重可以对 $game_party.current_load 进行加,减,赋值 13 | # 例如:$game_party.current_load += 1 #当前物品总重量加 1 14 | # 默认给物品增加一行说明.说明内容是物品的重量. 但默认帮助窗口一共只能显示2行内容. 15 | # 因此你在设置帮助说明的时候. 如果设置了2行内容. 那么这新增加的第3行将无法显示出来. 16 | #============================================================================== 17 | $VIPArcherScript ||= {};$VIPArcherScript[:load] = __FILE__ #20140919 18 | #------------------------------------------------------------------------------- 19 | module VIPArcher end 20 | #============================================================================== 21 | # ★ 设定部分 ★ 22 | #============================================================================== 23 | module VIPArcher::Load 24 | Default_Load = 1 # 物品的默认负重 25 | Width = 150 # 负重信息窗口宽度 26 | Load_Name = "负重:" # 负重前显示的文字 27 | Load_Var = 0 # 作为队伍负重上限的变量ID,为0禁用变量作为负重上限, 28 | # 计算方式变成累计每个角色的负重能力来计算负重上限。 29 | Load_Eval = "((mhp + mmp) / agi) * [hp_rate,0.5].max" 30 | # 每个角色的负重计算公式(eval) 31 | 32 | Stop_SW = false # true 使用 / false 不使用 33 | # 事件中调用增减道具/武器/防具时,如果会导致超过负重上限,是否执行中断事件处理 34 | # 推荐不使用,因为新加的功能就有一个是当超过负重时限制角色移动,开启这个 35 | # 的话这个限制移动就无效了的说·3· 36 | 37 | Movable = true # true 使用 / false 不使用 38 | # 满负重时降低移动速度(不使用时禁止移动连事件都无法启动,只能丢弃/使用物品) 39 | 40 | Move_Speed = 2 # 满负重时的移动速度降低量 41 | 42 | # 负重超过上限时的提示内容 43 | Message = "负重超过承受范围,移动将变得\ec[10]【十分艰难!】\\c[0]" + 44 | "\n\ei[4]丢弃些没用的东西吧。" 45 | 46 | Lose_SW = true # true 使用 / false 不使用 47 | # 按X键(A键)是否可以丢弃道具 48 | # 如果你另外使用了丢弃道具的脚本请关闭 49 | 50 | Help_SW = true #true 使用 / false 不使用 51 | # 是否在帮助窗口内自动添加负重信息 52 | 53 | Equip_SW = true #true 计算 / false 不计算 54 | # 装备在身上的装备是否算入负重 55 | # "★★★★★★ 注意 ★★★★★★" 56 | # 如果你的角色初始装备有占负重并且开启上面的功能,那么你必须 57 | # 在游戏一开始时为当前负重赋值(自己算到底有多少负重·3·) 58 | # 当有新队员加入队伍并且也带有负重的装备那么你也需要为当前负重加上对应的重量, 59 | # 例如:$game_party.current_load += 10 就是加上10的当前负重 60 | end 61 | #============================================================================== 62 | # ☆ 设定结束 ☆ 63 | #============================================================================== 64 | class RPG::BaseItem 65 | include VIPArcher::Load 66 | #-------------------------------------------------------------------------- 67 | # ● 获取道具的重量 68 | #-------------------------------------------------------------------------- 69 | def load 70 | return unless self.is_a?(RPG::Item) || self.is_a?(RPG::EquipItem) 71 | return $1.to_i if @note =~ /<(?:load|负重|負重)\s*(\d+)>/i 72 | Default_Load 73 | end 74 | #-------------------------------------------------------------------------- 75 | # ● 新增负重帮助内容 76 | #-------------------------------------------------------------------------- 77 | def description 78 | if Help_SW && load && load != 0 79 | @description + "\n\e}重量:#{load}\e{" 80 | else 81 | @description 82 | end 83 | end unless $VIPArcherScript[:help_ex] 84 | end 85 | #============================================================================== 86 | #  显示当前负重信息的窗口 87 | #============================================================================== 88 | class Window_Load < Window_Base 89 | include VIPArcher::Load 90 | #-------------------------------------------------------------------------- 91 | # ● 初始化对象 92 | #-------------------------------------------------------------------------- 93 | def initialize(viewport) 94 | super(Graphics.width - window_width, 72, window_width, fitting_height(1)) 95 | self.viewport = @viewport 96 | refresh 97 | end 98 | #-------------------------------------------------------------------------- 99 | # ● 获取窗口的宽度 100 | #-------------------------------------------------------------------------- 101 | def window_width 102 | Width 103 | end 104 | #-------------------------------------------------------------------------- 105 | # ● 刷新 106 | #-------------------------------------------------------------------------- 107 | def refresh 108 | contents.clear 109 | contents.font.size - 4 110 | change_color(system_color) 111 | draw_text(0, 0, window_width - 64, 24,Load_Name,0) 112 | change_color($game_party.load_max? ? power_down_color : normal_color) 113 | weight = "#{$game_party.current_load}/#{$game_party.total_load}" 114 | draw_text(0, 0, window_width - 24, 24, weight,2) 115 | @temp_load = $game_party.current_load 116 | end 117 | #-------------------------------------------------------------------------- 118 | # ● 更新画面 119 | #-------------------------------------------------------------------------- 120 | def update 121 | super 122 | refresh if @temp_load != $game_party.current_load 123 | end 124 | end 125 | #------------------------------------------------------------------------------- 126 | class Window_ItemCategory < Window_HorzCommand 127 | include VIPArcher::Load 128 | #-------------------------------------------------------------------------- 129 | # ● 获取窗口的宽度 130 | #-------------------------------------------------------------------------- 131 | def window_width 132 | scene_item_is? ? Graphics.width - Width : Graphics.width 133 | end 134 | #-------------------------------------------------------------------------- 135 | # ● 获取列数 136 | #-------------------------------------------------------------------------- 137 | def col_max 138 | return scene_item_is? ? 3 : 4 139 | end 140 | #-------------------------------------------------------------------------- 141 | # ● 判断是否为物品栏场景 142 | #-------------------------------------------------------------------------- 143 | def scene_item_is? 144 | return SceneManager.scene_is?(Scene_Item) 145 | end 146 | end 147 | #============================================================================== 148 | # ■ 物品界面显示负重栏 149 | #============================================================================== 150 | class Scene_Item < Scene_ItemBase 151 | include VIPArcher::Load 152 | #-------------------------------------------------------------------------- 153 | # ● 开始处理 154 | #-------------------------------------------------------------------------- 155 | alias load_start start 156 | def start 157 | load_start 158 | @load_window = Window_Load.new(@viewport) 159 | end 160 | #-------------------------------------------------------------------------- 161 | # ● 更新画面 162 | #-------------------------------------------------------------------------- 163 | alias load_update update 164 | def update 165 | #-------------------------------------------------------------------------- 166 | # ★ 按X键(A键)丢弃道具 - 贵重物品无法丢弃 ★修改:VIPArcher 167 | #-------------------------------------------------------------------------- 168 | if Input.trigger?(Input::X) && Lose_SW 169 | item = @item_window.item 170 | if item.is_a?(RPG::Item) && item.key_item? || item.nil? 171 | Sound.play_buzzer 172 | else 173 | Sound.play_cancel 174 | $game_party.lose_item(item, 1) 175 | @item_window.refresh 176 | end 177 | end 178 | load_update 179 | end 180 | end 181 | #------------------------------------------------------------------------------- 182 | class Window_ShopNumber < Window_Selectable 183 | include VIPArcher::Load 184 | attr_accessor :buy_or_sell #买入的标志 185 | #-------------------------------------------------------------------------- 186 | # ● 刷新 187 | #-------------------------------------------------------------------------- 188 | alias vip_shopnumber_refresh refresh 189 | def refresh 190 | vip_shopnumber_refresh 191 | draw_current_weight(@item) 192 | end 193 | #-------------------------------------------------------------------------- 194 | # ○ 买卖时重量变化的描绘 195 | #-------------------------------------------------------------------------- 196 | def draw_current_weight(item) 197 | current = $game_party.current_load 198 | weight = current + item.load * @number * (@buy_or_sell ? 1 : -1) 199 | width = contents_width - 8 200 | cx = text_size(@currency_unit).width 201 | change_color(system_color) 202 | draw_text(4, y + 60, width, line_height, Load_Name) 203 | change_color(normal_color) 204 | wt = "#{weight} / #{$game_party.total_load}" 205 | change_color(power_down_color) if weight > $game_party.total_load 206 | draw_text(4, y + 60, width, line_height, wt, 2) 207 | end 208 | end 209 | #------------------------------------------------------------------------------- 210 | class Window_ShopStatus < Window_Base 211 | include VIPArcher::Load 212 | #-------------------------------------------------------------------------- 213 | # ● 刷新 214 | #-------------------------------------------------------------------------- 215 | alias vip_shopstatus_refresh refresh 216 | def refresh 217 | vip_shopstatus_refresh 218 | draw_weight_occupy(4, 24) 219 | end 220 | #-------------------------------------------------------------------------- 221 | # ● 绘制持负重信息 222 | #-------------------------------------------------------------------------- 223 | def draw_weight_occupy(x, y) 224 | rect = Rect.new(x, y, contents.width - 4 - x, line_height) 225 | change_color(system_color) 226 | draw_text(rect, Load_Name, 3) 227 | change_color(normal_color) 228 | weight = "#{$game_party.current_load}/#{$game_party.total_load}" 229 | change_color(power_down_color) if $game_party.load_max? 230 | draw_text(rect, weight, 2) 231 | @temp_load = $game_party.current_load 232 | end 233 | end 234 | #============================================================================== 235 | # ■ 获取队伍最大负重 236 | #============================================================================== 237 | class Game_Party < Game_Unit 238 | include VIPArcher::Load 239 | #-------------------------------------------------------------------------- 240 | # ● 定义实例变量 241 | #-------------------------------------------------------------------------- 242 | attr_accessor :current_load, :load_trade_item #负重 243 | #-------------------------------------------------------------------------- 244 | # ● 初始化对象 245 | #-------------------------------------------------------------------------- 246 | alias load_initialize initialize 247 | def initialize 248 | load_initialize 249 | total_load 250 | @current_load = 0 251 | @total_load = 0 252 | end 253 | #-------------------------------------------------------------------------- 254 | # ● 获取队伍最大负重 255 | #-------------------------------------------------------------------------- 256 | def total_load 257 | return $game_variables[Load_Var] if Load_Var > 0 258 | all_members.inject(0) {|total,actor| total + actor.load } 259 | end 260 | #-------------------------------------------------------------------------- 261 | # ● 判断负重是否已满 262 | #-------------------------------------------------------------------------- 263 | def load_max? 264 | return false if @current_load == 0 265 | @current_load >= total_load 266 | end 267 | #-------------------------------------------------------------------------- 268 | # ● 增加/减少物品时计算负重 269 | #-------------------------------------------------------------------------- 270 | alias load_gain_item gain_item 271 | def gain_item(item, n, include_equip = false) 272 | return if item.nil? 273 | load_gain_item(item, n, include_equip) 274 | @current_load += item.load * n unless @load_trade_item 275 | end 276 | end 277 | #------------------------------------------------------------------------------- 278 | class Game_Actor < Game_Battler 279 | include VIPArcher::Load 280 | #-------------------------------------------------------------------------- 281 | # ● 装备时不计算负重的增减 * 方法覆盖 282 | # new_item : 取出的物品 283 | # old_item : 放入的物品 284 | #-------------------------------------------------------------------------- 285 | def trade_item_with_party(new_item, old_item) 286 | return false if new_item && !$game_party.has_item?(new_item) 287 | $game_party.load_trade_item = true if Equip_SW == true 288 | $game_party.gain_item(old_item, 1) 289 | $game_party.lose_item(new_item, 1) 290 | $game_party.load_trade_item = false if Equip_SW == true 291 | return true 292 | end 293 | #-------------------------------------------------------------------------- 294 | # ● 获取角色的负重上限 295 | #-------------------------------------------------------------------------- 296 | def load 297 | eval(Load_Eval).to_i rescue msgbox "请检查负重能力公式是否正确" 298 | end 299 | end 300 | #============================================================================== 301 | # ■ 增减物品时判断负重 302 | #============================================================================== 303 | class Game_Interpreter 304 | include VIPArcher::Load 305 | #-------------------------------------------------------------------------- 306 | # ● 增减道具 307 | #-------------------------------------------------------------------------- 308 | alias load_command_126 command_126 309 | def command_126 310 | n = operate_value(@params[1], @params[2], @params[3]) 311 | return command_115 if check_load($data_items[@params[0]], n) && Stop_SW 312 | load_command_126 313 | end 314 | #-------------------------------------------------------------------------- 315 | # ● 增減武器 316 | #-------------------------------------------------------------------------- 317 | alias load_command_127 command_127 318 | def command_127 319 | n = operate_value(@params[1], @params[2], @params[3]) 320 | return command_115 if check_load($data_weapons[@params[0]], n) && Stop_SW 321 | load_command_127 322 | end 323 | #-------------------------------------------------------------------------- 324 | # ● 增減防具 325 | #-------------------------------------------------------------------------- 326 | alias load_command_128 command_128 327 | def command_128 328 | n = operate_value(@params[1], @params[2], @params[3]) 329 | return command_115 if check_load($data_armors[@params[0]], n) && Stop_SW 330 | load_command_128 331 | end 332 | #-------------------------------------------------------------------------- 333 | # ● 增减物品超重时提示 334 | #-------------------------------------------------------------------------- 335 | def check_load(item, n) 336 | if (((item.load * n) + $game_party.current_load) > $game_party.total_load) 337 | $game_message.texts.push("#{Message}") if $game_message.visible != true 338 | $game_message.visible = true 339 | end 340 | ((item.load * n) + $game_party.current_load) > $game_party.total_load 341 | end 342 | end 343 | #============================================================================== 344 | # ★ 满负重时限制行动 ★ 345 | #============================================================================== 346 | class Game_Player < Game_Character 347 | include VIPArcher::Load 348 | #-------------------------------------------------------------------------- 349 | # ● 判定是否可以移动 350 | #-------------------------------------------------------------------------- 351 | alias load_movable? movable? 352 | def movable? 353 | return false if $game_party.load_max? && !Movable ; load_movable? 354 | end 355 | #-------------------------------------------------------------------------- 356 | # ● 满负重时降低移动速度 357 | #-------------------------------------------------------------------------- 358 | def real_move_speed 359 | return super - Move_Speed if $game_party.load_max? && Movable ; super 360 | end 361 | end 362 | #============================================================================== 363 | # ★ 满负重时限制购买 ★ 364 | #============================================================================== 365 | class Window_ShopBuy < Window_Selectable 366 | #-------------------------------------------------------------------------- 367 | # ● 查询商品是否可买 368 | #-------------------------------------------------------------------------- 369 | alias load_enable? enable? 370 | def enable?(item) 371 | load_enable?(item) && !$game_party.load_max? 372 | end 373 | end 374 | #============================================================================== 375 | # ★ 根据负重设定可购买的物品数量 ★ 376 | #============================================================================== 377 | class Scene_Shop < Scene_MenuBase 378 | #-------------------------------------------------------------------------- 379 | # ● 指令“买入” 380 | #-------------------------------------------------------------------------- 381 | alias vip_load_command_buy command_buy 382 | def command_buy 383 | vip_load_command_buy ; @number_window.buy_or_sell = true 384 | end 385 | #-------------------------------------------------------------------------- 386 | # ● 指令“卖出” 387 | #-------------------------------------------------------------------------- 388 | alias vip_load_command_sell command_sell 389 | def command_sell 390 | vip_load_command_sell ; @number_window.buy_or_sell = false 391 | end 392 | #-------------------------------------------------------------------------- 393 | # ● 获取可以买入的最大值 394 | #-------------------------------------------------------------------------- 395 | alias load_max_buy max_buy 396 | def max_buy 397 | vip = @item.load == 0 ? load_max_buy : ($game_party.total_load - 398 | $game_party.current_load) / @item.load 399 | [load_max_buy,vip].min 400 | end 401 | end -------------------------------------------------------------------------------- /scripts/限时显示选项.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 限时显示选项 3 | # By :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | # 说明: 7 | # 在开始选择前开启计时器,如果计时器归0时自动调用“取消”的方法。要保证取消有效。 8 | #============================================================================== 9 | $VIPArcherScript ||= {};$VIPArcherScript[:time_choiceList] = 20141027 10 | #-------------------------------------------------------------------------------- 11 | module VIPArcher end 12 | #============================================================================== 13 | # ★ 设定部分 ★ 14 | #============================================================================== 15 | module VIPArcher::Time_Choice 16 | ID = 1 # 这个开关开启时,显示选项将在计时器归零时自动调用"取消"的方法 17 | end 18 | #============================================================================== 19 | # ☆ 设定结束 ☆ 20 | #============================================================================== 21 | class Window_ChoiceList < Window_Command 22 | include VIPArcher::Time_Choice 23 | #-------------------------------------------------------------------------- 24 | # ● 调用“取消”的处理方法 25 | #-------------------------------------------------------------------------- 26 | alias timer_call_cancel_handler call_cancel_handler 27 | def call_cancel_handler 28 | timer_call_cancel_handler 29 | return unless $game_switches[ID] 30 | deactivate; $game_timer.stop 31 | end 32 | #-------------------------------------------------------------------------- 33 | # ● 更新画面 34 | #-------------------------------------------------------------------------- 35 | alias timer_update update 36 | def update 37 | timer_update 38 | return unless $game_switches[ID] 39 | call_cancel_handler if cancel_enabled? && 40 | $game_timer.sec.zero? && $game_timer.working? 41 | end 42 | end -------------------------------------------------------------------------------- /scripts/隐藏房间黑块遮罩.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 隐藏房间黑块遮罩 3 | # by:VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #============================================================================== 6 | =begin 7 | 使用说明: 8 | · 在地图上建一个事件,事件名为 "Black_Room_Config" 并且在该事件里注释上 9 | 10 | path: BlackRoomFiles 11 | color: Color.new(33,33,33) 12 | x: 3 13 | y: 0 14 | z: 250 15 | edge_width: 20 16 | draw: [3,9,9,13][7,0,9,9] 17 | check: [2,8,10,14][8,0,10,10] 18 | min_opacity: 75 19 | max_opacity: 200 20 | switch_id: 5 21 | 22 | · 以上的配置都有默认值,可以不配置,注释框可能不够写,可以使用滚动文字、脚本框、 23 | 显示对话来填,用来设置黑块的事件不会被执行,推荐使用滚动文字配置,不会被换行。 24 | · 各字段作用释义: 25 | path:使用的素材所在路径,不使用素材绘制则没有意义 26 | color:绘制黑块时使用的颜色,使用素材绘制黑块时无效 27 | x: 遮罩区域的 x 坐标 28 | y:遮罩区域的 y 坐标 29 | z: 遮罩块的 z 值(在人物上方:200 同层:100 下方:0,可以做个参考) 30 | edge_width:绘制黑块时边缘的留白宽度,使用素材绘制黑块时无效 31 | draw:要绘制黑块的范围,[左上角x,左上角y,右下角x,右下角y] 写多个会进行拼接 32 | check:检查玩家踏入的范围,在范围内时,黑块将隐藏,设置规则同上 33 | min_opacity:隐藏时不透明度最低值 默认0 34 | max_opacity:显示时不透明度最大值 默认255 35 | switch_id:关联的开关,设置的开关打开时,视为玩家在范围内,将隐藏黑块 36 | 标签内的文件名是在使用素材做遮罩时读取的文件名 37 | · 注意: 38 | 使用素材绘制遮罩时:必须指定 x、y、check 39 | 不用素材绘制遮罩时:x、y会自动计算,无需设置,check 如果未设置则与 draw 一致 40 | 多个矩形之间允许重叠范围,注意不要换行,看地图编辑器右下角坐标就可以轻松取值 41 | Black_Room_Config 的事件可以有多个,一个事件里也可以写多个遮罩 42 | =end 43 | #============================================================================== 44 | $VIPArcherScript ||= {};$VIPArcherScript[:black_room] = 20220520 45 | #------------------------------------------------------------------------------- 46 | module VIPArcher end 47 | #============================================================================== 48 | # ★ 设定部分 ★ 49 | #============================================================================== 50 | module VIPArcher::BlackRoom 51 | SW = 1 # 该开关开启时遮罩块不可见 52 | RE_OUTER = /(.*?)<\/mask>/mi # 读取备注用的正则表达式 53 | RE_INNER = /(\w+) *: *(.*)/ # 读取设置用的正则表达式 54 | DEFAULT_Z = 300 # 遮罩块的Z值 55 | EDGE_WIDTH = 16 # 遮罩块边距留空的距离 56 | EVENT_NAME = 'Black_Room_Config' # 设置遮罩块的事件名 57 | DEFAULT_COLOR = Color.new(0,0,0) # 默认遮罩块填充的颜色 58 | DEFAULT_PATH = 'Parallaxes' # 素材存放默认文件夹 Graphics 下 59 | OPACITY_SPEED = 17 # 透明度变化的速度 60 | end 61 | #============================================================================== 62 | # ☆ 设定结束 ☆ 63 | #============================================================================== 64 | 65 | class Sprite_BlackRoom < Sprite 66 | include VIPArcher::BlackRoom 67 | #-------------------------------------------------------------------------- 68 | # ● 初始化对象 69 | #-------------------------------------------------------------------------- 70 | def initialize(settings, viewport) 71 | super(viewport) 72 | @settings = settings 73 | @check_rects = [] 74 | basename = extract(nil) 75 | self.z = extract('z', DEFAULT_Z).to_i 76 | @switch_id = extract('switch_id', SW).to_i 77 | @min_opacity = extract('min_opacity', 0).to_i 78 | @max_opacity = extract('max_opacity', 255).to_i 79 | @opacity_speed = extract('opacity_speed', OPACITY_SPEED).to_i 80 | if basename.empty? 81 | return unless extract('draw') 82 | draw_rects = make_rects(extract('draw','')) 83 | make_bitmap(draw_rects) 84 | @check_rects = extract('check') ? 85 | make_rects(extract('check','')) : draw_rects 86 | else 87 | folder_name = "Graphics/#{extract('path', DEFAULT_PATH).chomp}" 88 | self.bitmap = Bitmap.new("#{folder_name}/#{basename}") 89 | if RUBY_VERSION == '1.9.2' 90 | p "#{basename}遮罩未设置踏入区域" unless extract('check') 91 | end 92 | @check_rects = make_rects(extract('check','')) 93 | self.x = extract('x', 0).to_i * 32 94 | self.y = extract('y', 0).to_i * 32 95 | end 96 | self.opacity = character_pos? ? @min_opacity : @max_opacity 97 | end 98 | #-------------------------------------------------------------------------- 99 | # ● 通过备注的设置的矩形绘制 Bitmap 100 | #-------------------------------------------------------------------------- 101 | def make_bitmap(draw_rects) 102 | bitmap_x = draw_rects.min_by { |rect| rect.x }.x 103 | bitmap_y = draw_rects.min_by { |rect| rect.y }.y 104 | bitmap_width = draw_rects.max_by { |rect| rect.width }.width 105 | bitmap_height = draw_rects.max_by { |rect| rect.height }.height 106 | self.x = bitmap_x * 32 107 | self.y = bitmap_y * 32 108 | self.bitmap = Bitmap.new(bitmap_width * 32, bitmap_height * 32) 109 | color = extract('color', DEFAULT_COLOR) 110 | edge_width = extract('edge_width', EDGE_WIDTH).to_i 111 | draw_rects.each do |rect| 112 | fill_rect = Rect.new( 113 | edge_width + (rect.x - bitmap_x) * 32, 114 | edge_width + (rect.y - bitmap_y) * 32, 115 | (rect.width - rect.x + 1) * 32 - edge_width * 2, 116 | (rect.height - rect.y + 1) * 32 - edge_width * 2 117 | ) 118 | self.bitmap.fill_rect(fill_rect, color) 119 | end 120 | end 121 | #-------------------------------------------------------------------------- 122 | # ● 备注字符串转矩形数组 123 | #-------------------------------------------------------------------------- 124 | def make_rects(str) 125 | str.scan(/\[[\d, ]+?\]/mi).collect do |rect| 126 | eval("Rect.new(#{$1})") if rect =~ /\[(\d+.*?)\]/ 127 | end 128 | end 129 | #-------------------------------------------------------------------------- 130 | # ● 提取备注中的设定值 131 | #-------------------------------------------------------------------------- 132 | def extract(key, default = nil) 133 | return eval(@settings[key]) if key == 'color' && @settings[key] 134 | @settings[key] || default 135 | end 136 | #-------------------------------------------------------------------------- 137 | # ● 检查位置是否在设定的范围内 138 | #-------------------------------------------------------------------------- 139 | def character_pos? 140 | @check_rects.any? do |rect| 141 | $game_player.x <= rect.width && $game_player.x >= rect.x && 142 | $game_player.y <= rect.height && $game_player.y >= rect.y 143 | end || $game_switches[@switch_id] 144 | end 145 | #-------------------------------------------------------------------------- 146 | # ● 更新透明度 147 | #-------------------------------------------------------------------------- 148 | def update_opacity 149 | self.opacity = character_pos? ? 150 | [self.opacity - @opacity_speed, @min_opacity].max : 151 | [self.opacity + @opacity_speed, @max_opacity].min 152 | self.visible = !$game_switches[SW] 153 | end 154 | #-------------------------------------------------------------------------- 155 | # ● 更新地图卷动位置 156 | #-------------------------------------------------------------------------- 157 | def update_position 158 | self.ox = $game_map.display_x * (RUBY_VERSION == '1.9.2' ? 32 : 0.125) 159 | self.oy = $game_map.display_y * (RUBY_VERSION == '1.9.2' ? 32 : 0.125) 160 | end 161 | #-------------------------------------------------------------------------- 162 | # ● 更新画面 163 | #-------------------------------------------------------------------------- 164 | def update 165 | super 166 | update_opacity 167 | update_position 168 | end 169 | #-------------------------------------------------------------------------- 170 | # ● 释放 171 | #-------------------------------------------------------------------------- 172 | def dispose 173 | self.bitmap.dispose 174 | super 175 | end 176 | end 177 | #------------------------------------------------------------------------------- 178 | class Spriteset_Map 179 | include VIPArcher::BlackRoom 180 | # 显示文字:(401) 滚动文本:(405) 注释:(108, 408) 脚本:(355, 655) 181 | EVENT_CODE = [108, 408, 405, 355, 655, 401] # 可以进行填写配置的事件类型编号 182 | #-------------------------------------------------------------------------- 183 | # ● 生成人物精灵 184 | #-------------------------------------------------------------------------- 185 | alias black_room_create_characters create_characters 186 | def create_characters 187 | black_room_create_characters 188 | room_sprite_dispose if @black_room_sprites 189 | create_black_rooms 190 | end 191 | #-------------------------------------------------------------------------- 192 | # ● 生成黑色遮罩块 193 | #-------------------------------------------------------------------------- 194 | def create_black_rooms 195 | @black_room_sprites = [] 196 | $game_map.events.values.each do |event| 197 | if event.instance_variable_get(:@event).name =~ /#{EVENT_NAME}/i 198 | return if event.list.nil? 199 | event.list.unshift( 200 | RPG::EventCommand.new(115) 201 | ) if event.list.first.code != 115 202 | event.list.inject('') do |result, command| 203 | next result unless EVENT_CODE.include?(command.code) 204 | "#{result}#{command.parameters.join()}\n" 205 | end.scan(RE_OUTER).map do |name, contents| 206 | settings = {nil => name} 207 | contents.scan(RE_INNER) do |key, value| 208 | (settings[key] ||= '') << value 209 | end 210 | sprite = Sprite_BlackRoom.new(settings, @viewport1) 211 | @black_room_sprites.push(sprite) 212 | end 213 | end 214 | end 215 | end 216 | #-------------------------------------------------------------------------- 217 | # ● 释放 218 | #-------------------------------------------------------------------------- 219 | alias black_room_dispose dispose 220 | def dispose 221 | black_room_dispose 222 | room_sprite_dispose 223 | end 224 | #-------------------------------------------------------------------------- 225 | # ● 释放遮罩块 226 | #-------------------------------------------------------------------------- 227 | def room_sprite_dispose 228 | @black_room_sprites.each {|sprite| sprite.dispose } 229 | end 230 | #-------------------------------------------------------------------------- 231 | # ● 更新画面 232 | #-------------------------------------------------------------------------- 233 | alias black_room_update update 234 | def update 235 | black_room_update 236 | @black_room_sprites.each {|sprite| sprite.update } 237 | end 238 | end 239 | -------------------------------------------------------------------------------- /scripts/面向事件显示心情.rb: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # ■ 面向事件显示心情 3 | # by :VIPArcher [email: VIPArcher@sina.com] 4 | # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 5 | #------------------------------------------------------------------------------ 6 | # ■ 使用说明: 7 | # 面向注释有 的事件时,玩家头顶显示第id号心情。心情素材直接使用的是 8 | # 默认的心情素材。(其实默认的心情素材是可以直接扩展的,) 9 | #============================================================================== 10 | $VIPArcherScript ||= {};$VIPArcherScript[:remind_balloon] = 20150125 11 | #------------------------------------------------------------------------------- 12 | module VIPArcher end 13 | #============================================================================== 14 | # ★ 设定部分 ★ 15 | #============================================================================== 16 | module VIPArcher::Remind 17 | SPEED = 4 # 心情显示的速度 18 | WAIT_TIME = 90 # 最终帧的等待时间 19 | FILENAME = "Balloon" # 心情素材的文件名 20 | end 21 | #============================================================================== 22 | # ☆ 设定结束 ☆ 23 | #============================================================================== 24 | class Sprite_Remind < Sprite_Character 25 | include VIPArcher::Remind 26 | #-------------------------------------------------------------------------- 27 | # ● 获取面前事件 28 | #-------------------------------------------------------------------------- 29 | def event 30 | fx = $game_map.round_x_with_direction(character.x, character.direction) 31 | fy = $game_map.round_y_with_direction(character.y, character.direction) 32 | return $game_map.events_xy(fx, fy)[0] 33 | end 34 | #-------------------------------------------------------------------------- 35 | # ● 获取事件的注释心情编号(如果有) 36 | #-------------------------------------------------------------------------- 37 | def get_balloon_id(event) 38 | return 0 if event.nil? || event.list.nil? 39 | event.list.each do |command| 40 | if command.code == 108 || command.code == 408 41 | command.parameters.each do |line| 42 | return $1.to_i if line =~ //i 43 | end 44 | end 45 | end ; 0 46 | end 47 | #-------------------------------------------------------------------------- 48 | # ● 开始显示心情图标 49 | #-------------------------------------------------------------------------- 50 | def start_balloon 51 | dispose_balloon 52 | @balloon_duration = 8 * balloon_speed + balloon_wait 53 | @balloon_sprite = ::Sprite.new(viewport) 54 | @balloon_sprite.bitmap = Cache.system(FILENAME) 55 | @balloon_sprite.ox = 16 56 | @balloon_sprite.oy = 32 57 | update_balloon 58 | end 59 | #-------------------------------------------------------------------------- 60 | # ● 心情图标的显示速度 61 | #-------------------------------------------------------------------------- 62 | def balloon_speed ; SPEED end 63 | #-------------------------------------------------------------------------- 64 | # ● 心情最终帧的等待时间 65 | #-------------------------------------------------------------------------- 66 | def balloon_wait ; WAIT_TIME end 67 | #-------------------------------------------------------------------------- 68 | # ● 结束心情图标的显示 69 | #-------------------------------------------------------------------------- 70 | def end_balloon 71 | dispose_balloon 72 | @balloon_id = 0 73 | end 74 | #-------------------------------------------------------------------------- 75 | # ● 更新位置 76 | #-------------------------------------------------------------------------- 77 | def update_position 78 | super 79 | self.y = @character.screen_y - 32 80 | end 81 | #-------------------------------------------------------------------------- 82 | # ● 更新画面 83 | #-------------------------------------------------------------------------- 84 | def update 85 | super 86 | if @balloon_id != get_balloon_id(event) 87 | @balloon_id = get_balloon_id(event) 88 | start_balloon if @balloon_id > 0 89 | end 90 | end 91 | #-------------------------------------------------------------------------- 92 | # ● 清空父类方法内容 93 | #-------------------------------------------------------------------------- 94 | def update_bitmap ; end ; def setup_new_effect ; end 95 | def end_animation ; end ; def update_src_rect ; end 96 | def update_other ; end ; def update_other ; end 97 | end 98 | #------------------------------------------------------------------------------- 99 | class Spriteset_Map 100 | #-------------------------------------------------------------------------- 101 | # ● 生成提示心情精灵 102 | #-------------------------------------------------------------------------- 103 | alias balloon_remind_create_characters create_characters 104 | def create_characters 105 | balloon_remind_create_characters 106 | @remind_sprite = Sprite_Remind.new(@viewport2,$game_player) 107 | end 108 | #-------------------------------------------------------------------------- 109 | # ● 刷新提示心情精灵 110 | #-------------------------------------------------------------------------- 111 | alias balloon_remind_update update 112 | def update 113 | balloon_remind_update ; @remind_sprite.update 114 | end 115 | #-------------------------------------------------------------------------- 116 | # ● 释放提示心情精灵 117 | #-------------------------------------------------------------------------- 118 | alias balloon_remind_dispose dispose 119 | def dispose 120 | balloon_remind_dispose ; @remind_sprite.dispose 121 | end 122 | end --------------------------------------------------------------------------------