• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Scripts collections


Commit MetaInfo

Revisão764fe84e7e2fc5972d979cb42e08d367de9db88a (tree)
Hora2016-01-09 19:35:16
AutorMathewka <mathewka@git....>
CommiterMathewka

Mensagem de Log

fscript

Mudança Sumário

Diff

--- /dev/null
+++ b/fscript/rpgva/RememberWorld/1.0/RememberWorld.rb
@@ -0,0 +1,106 @@
1+#===============================================================================
2+# ■ [VA] 记忆事件位置
3+# [VA] RememberWorld
4+#-------------------------------------------------------------------------------
5+# 让RGSS3记住事件移动后的位置。
6+#
7+#-------------------------------------------------------------------------------
8+# 更新作者: DeathKing
9+# 许可协议: FSL
10+# 项目版本: 1.0.0725
11+# 最后更新: 2014-07-25
12+# 引用网址:
13+#-------------------------------------------------------------------------------
14+# 能让RGSS3记忆住NPC的移动位置,避免出现地图切换后NPC又回到了初始位置的尴尬。
15+#
16+# 目前这个版本只是简单的记忆了事件的X、Y坐标,并写入对应的Map.rvdata2文件中,
17+# 事实上,可能还需要写入更多的信息,但是具体要写入什么,我正在探索中。
18+#-------------------------------------------------------------------------------
19+# - 1.0.0725 By DeathKing
20+# * 初始版本完成;
21+#
22+#===============================================================================
23+$fscript ||= {}
24+$fscript["RememberWorld"] = "1.0.0725"
25+
26+#-------------------------------------------------------------------------------
27+# ▼ 登记FSL
28+#-------------------------------------------------------------------------------
29+module FSL
30+ module RememberWorld
31+
32+ # 控制开关编号
33+ # 当 ENABLE_SWITCH 号开关打开时,此功能有效
34+ ENABLE_SWITCH = 21
35+
36+ # 不要记录标记
37+ # 如果事件的当前事件页第一条指令为一个注释,而且包含有下面的字符串的话
38+ # 脚本那不记住事件位置。
39+ NOT_REMEMBER_MARK = "<FSL::RememberWorld not-track>"
40+
41+ end
42+end
43+
44+#==============================================================================
45+# ■ Game_Event
46+#------------------------------------------------------------------------------
47+#  处理事件的类。拥有条件判断、事件页的切换、并行处理、执行事件等功能。
48+# 在 Game_Map 类的内部使用。
49+#==============================================================================
50+class Game_Event < Game_Character
51+ #--------------------------------------------------------------------------
52+ # ● 定义实例变量
53+ #--------------------------------------------------------------------------
54+ attr_reader :event
55+end
56+
57+
58+#==============================================================================
59+# ■ Game_Map
60+#------------------------------------------------------------------------------
61+#  管理地图的类。拥有卷动地图以及判断通行度的功能。
62+# 本类的实例请参考 $game_map 。
63+#==============================================================================
64+class Game_Map
65+
66+ include FSL::RememberWorld
67+
68+ #--------------------------------------------------------------------------
69+ # ● 定义实例变量
70+ #--------------------------------------------------------------------------
71+ def remember_world
72+ if $game_switches[ENABLE_SWITCH]
73+ @events.each do |i, event|
74+ # 跳过那些指明不要记住的事件
75+ instruction = event.find_proper_page.list.first
76+ next if (instruction and
77+ instruction.code == 108 and
78+ instruction.parameters[0].include? NOT_REMEMBER_MARK)
79+ @map.events[i].x = event.x
80+ @map.events[i].y = event.y
81+ end
82+ name = sprintf("Data/Map%03d.rvdata2", @map_id)
83+ File.open(name, "wb") do |file|
84+ Marshal.dump(@map, file)
85+ end
86+ end
87+
88+ end
89+end
90+
91+#==============================================================================
92+# ■ Scene_Map
93+#------------------------------------------------------------------------------
94+#  地图画面
95+#==============================================================================
96+class Scene_Map
97+
98+ alias old_rw_pre_transfer pre_transfer
99+ #--------------------------------------------------------------------------
100+ # ● 场所移动前的处理
101+ #--------------------------------------------------------------------------
102+ def pre_transfer
103+ old_rw_pre_transfer
104+ $game_map.remember_world
105+ end
106+end
--- /dev/null
+++ b/fscript/rpgva/RememberWorld/1.1/RememberWorld.rb
@@ -0,0 +1,133 @@
1+#===============================================================================
2+# ■ [VA] 记忆事件位置
3+# [VA] RememberWorld
4+#-------------------------------------------------------------------------------
5+# 让RGSS3记住事件移动后的位置。
6+#
7+#-------------------------------------------------------------------------------
8+# 更新作者: DeathKing
9+# 许可协议: FSL
10+# 项目版本: 1.1.0726
11+# 最后更新: 2014-07-26
12+# 引用网址:
13+#-------------------------------------------------------------------------------
14+# 能让RGSS3记忆住NPC的移动位置,避免出现地图切换后NPC又回到了初始位置的尴尬。
15+#
16+# 目前这个版本只是简单的记忆了事件的X、Y坐标,并写入Game_System的map_events中,
17+# 事实上,可能还需要写入更多的信息,但是具体要写入什么,我正在探索中。
18+#-------------------------------------------------------------------------------
19+# - 1.1.0726 By DeathKing
20+# * 使用Game_System作为载体,避免对地图文件本身做出修改。
21+#
22+# - 1.0.0725 By DeathKing
23+# * 初始版本完成;
24+#
25+#===============================================================================
26+$fscript ||= {}
27+$fscript["RememberWorld"] = "1.1.0726"
28+
29+#-------------------------------------------------------------------------------
30+# ▼ 登记FSL
31+#-------------------------------------------------------------------------------
32+module FSL
33+ module RememberWorld
34+
35+ # 控制开关编号
36+ # 当 ENABLE_SWITCH 号开关打开时,此功能有效
37+ ENABLE_SWITCH = 21
38+
39+ # 不要记录标记
40+ # 如果事件的当前事件页第一条指令为一个注释,而且包含有下面的字符串的话
41+ # 脚本那不记住事件位置。
42+ NOT_REMEMBER_MARK = "<FSL::RememberWorld not-track>"
43+
44+ end
45+end
46+
47+#==============================================================================
48+# ■ Game_System
49+#------------------------------------------------------------------------------
50+#  处理系统附属数据的类。保存存档和菜单的禁止状态之类的数据。
51+# 本类的实例请参考 $game_system 。
52+#==============================================================================
53+
54+class Game_System
55+ #--------------------------------------------------------------------------
56+ # ● 开放map_events实例变量
57+ #--------------------------------------------------------------------------
58+ def map_events
59+ @map_events ||= {}
60+ @map_events
61+ end
62+end
63+
64+#==============================================================================
65+# ■ Game_Event
66+#------------------------------------------------------------------------------
67+#  处理事件的类。拥有条件判断、事件页的切换、并行处理、执行事件等功能。
68+# 在 Game_Map 类的内部使用。
69+#==============================================================================
70+class Game_Event < Game_Character
71+ #--------------------------------------------------------------------------
72+ # ● 定义实例变量
73+ #--------------------------------------------------------------------------
74+ attr_reader :event
75+end
76+
77+#==============================================================================
78+# ■ Game_Map
79+#------------------------------------------------------------------------------
80+#  管理地图的类。拥有卷动地图以及判断通行度的功能。
81+# 本类的实例请参考 $game_map 。
82+#==============================================================================
83+class Game_Map
84+
85+ include FSL::RememberWorld
86+
87+ #--------------------------------------------------------------------------
88+ # ● 定义实例变量
89+ #--------------------------------------------------------------------------
90+ def remember_world
91+ saved = {}
92+ if $game_switches[ENABLE_SWITCH]
93+ @events.each do |i, event|
94+ # 跳过那些指明不要记住的事件
95+ instruction = event.find_proper_page.list.first
96+ next if (instruction and
97+ instruction.code == 108 and
98+ instruction.parameters[0].include? NOT_REMEMBER_MARK)
99+ saved[i] = [event.x, event.y]
100+ end
101+ $game_system.map_events[@map_id] = saved
102+ end
103+ end
104+
105+ #--------------------------------------------------------------------------
106+ # ● 设置事件
107+ #--------------------------------------------------------------------------
108+ alias old_rm_setup_events setup_events
109+ def setup_events
110+ old_rm_setup_events
111+ if (events = $game_system.map_events[@map_id])
112+ events.each do |id, coordinate|
113+ @events[id].moveto(*coordinate)
114+ end
115+ end
116+ end
117+end
118+
119+#==============================================================================
120+# ■ Scene_Map
121+#------------------------------------------------------------------------------
122+#  地图画面
123+#==============================================================================
124+class Scene_Map
125+ alias old_rw_pre_transfer pre_transfer
126+ #--------------------------------------------------------------------------
127+ # ● 场所移动前的处理
128+ #--------------------------------------------------------------------------
129+ def pre_transfer
130+ old_rw_pre_transfer
131+ $game_map.remember_world
132+ end
133+end
--- /dev/null
+++ b/fscript/rpgva/TypingHelp/1.0/TypingHelp.rb
@@ -0,0 +1,80 @@
1+
2+#===============================================================================
3+# ■ [VA] 打字效果的帮助窗口
4+# [VA] TypingHelp
5+#-------------------------------------------------------------------------------
6+# 让显示物品说明的帮助窗口有打字效果
7+#
8+#-------------------------------------------------------------------------------
9+# 更新作者: DeathKing
10+# 许可协议: FSL
11+# 项目版本: 1.0.0930
12+# 最后更新: 2013-09-30
13+# 引用网址:
14+#-------------------------------------------------------------------------------
15+# 如果只需要部分应用打字效果,请将下面的“覆写模式”选项设置为false,并手动为需要
16+# 的窗口设置为 Window_HelpEx 。这个功能只推荐高级玩家使用。
17+#
18+#-------------------------------------------------------------------------------
19+# - 1.0.0930 By DeathKing
20+# * 初始版本完成;
21+#
22+#===============================================================================
23+$fscript ||= {}
24+$fscript["TypingHelp"] = "1.0.0930"
25+
26+#-------------------------------------------------------------------------------
27+# ▼ 登记FSL
28+#-------------------------------------------------------------------------------
29+
30+module FSL
31+ module TypingHelp
32+ # 每几帧刷新一个字
33+ # 推荐设置:1、2、3
34+ TURN = 2
35+
36+ # 覆写模式:是否用此脚本替代原有的Window_Help
37+ # 推荐设置:false
38+ OVERWRITE_WINDOW_HELP = true
39+
40+ end
41+end
42+
43+#==============================================================================
44+# ■ Window_Help
45+#------------------------------------------------------------------------------
46+#  显示特技和物品等的说明、以及角色状态的窗口
47+#==============================================================================
48+
49+class Window_HelpEx < Window_Help
50+
51+ include FSL::TypingHelp
52+
53+ #--------------------------------------------------------------------------
54+ # ● 初始化对象
55+ #--------------------------------------------------------------------------
56+ def initialize(line_number = 2)
57+ super
58+ @text = ""
59+ end
60+ #--------------------------------------------------------------------------
61+ # ● 刷新
62+ #--------------------------------------------------------------------------
63+ def refresh
64+ contents.clear
65+ reset_font_settings
66+ @text = convert_escape_characters(@text)
67+ @pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(@text)}
68+ update
69+ end
70+ #--------------------------------------------------------------------------
71+ # ● 更新
72+ #--------------------------------------------------------------------------
73+ def update
74+ if Graphics.frame_count % TURN == 0
75+ process_character(@text.slice!(0, 1), @text, @pos) unless @text.empty?
76+ end
77+ end
78+end
79+
80+Window_Help = Window_HelpEx if FSL::TypingHelp::OVERWRITE_WINDOW_HELP
--- /dev/null
+++ b/fscript/rpgva/TypingHelp/1.1/TypingHelp.rb
@@ -0,0 +1,85 @@
1+#===============================================================================
2+# ■ [VA] 打字效果的帮助窗口
3+# [VA] TypingHelp
4+#-------------------------------------------------------------------------------
5+# 让显示物品说明的帮助窗口有打字效果
6+#
7+#-------------------------------------------------------------------------------
8+# 更新作者: DeathKing
9+# 许可协议: FSL
10+# 项目版本: 1.1.0112
11+# 最后更新: 2014-01-12
12+# 引用网址:
13+#-------------------------------------------------------------------------------
14+# 如果只需要部分应用打字效果,请将下面的“覆写模式”选项设置为false,并手动为需要
15+# 的窗口设置为 Window_HelpEx 。这个功能只推荐高级玩家使用。
16+#
17+#-------------------------------------------------------------------------------
18+# - 1.1.0112 By DeathKing
19+# * 支持自动换行了;
20+#
21+# - 1.0.0930 By DeathKing
22+# * 初始版本完成;
23+#
24+#===============================================================================
25+$fscript ||= {}
26+$fscript["TypingHelp"] = "1.1.0112"
27+
28+#-------------------------------------------------------------------------------
29+# ▼ 登记FSL
30+#-------------------------------------------------------------------------------
31+
32+module FSL
33+ module TypingHelp
34+ # 每几帧刷新一个字
35+ # 推荐设置:1、2、3
36+ TURN = 2
37+
38+ # 覆写模式:是否用此脚本替代原有的Window_Help
39+ # 推荐设置:false
40+ OVERWRITE_WINDOW_HELP = true
41+
42+ end
43+end
44+
45+#==============================================================================
46+# ■ Window_Help
47+#------------------------------------------------------------------------------
48+#  显示特技和物品等的说明、以及角色状态的窗口
49+#==============================================================================
50+
51+class Window_HelpEx < Window_Help
52+
53+ include FSL::TypingHelp
54+
55+ #--------------------------------------------------------------------------
56+ # ● 初始化对象
57+ #--------------------------------------------------------------------------
58+ def initialize(line_number = 2)
59+ super
60+ @text = ""
61+ end
62+ #--------------------------------------------------------------------------
63+ # ● 刷新
64+ #--------------------------------------------------------------------------
65+ def refresh
66+ contents.clear
67+ reset_font_settings
68+ @text = convert_escape_characters(@text)
69+ @pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(@text)}
70+ update
71+ end
72+ #--------------------------------------------------------------------------
73+ # ● 更新
74+ #--------------------------------------------------------------------------
75+ def update
76+ if Graphics.frame_count % TURN == 0
77+ unless @text.empty?
78+ process_new_line(@text, @pos) if @pos[:x] > contents_width - contents.font.size
79+ process_character(@text.slice!(0, 1), @text, @pos)
80+ end
81+ end
82+ end
83+end
84+
85+Window_Help = Window_HelpEx if FSL::TypingHelp::OVERWRITE_WINDOW_HELP
--- /dev/null
+++ b/fscript/rpgvx/ADK/1.3/ADK.rb
@@ -0,0 +1,163 @@
1+
2+#===============================================================================
3+# ■ [VX] 增强开发包
4+# [VX] Advanced Delevop Kit -- ADK
5+#-------------------------------------------------------------------------------
6+# FSL ADK是FSL脚本可用的加强型开发包。他提供了一些列有效的方法。
7+#
8+#-------------------------------------------------------------------------------
9+# 更新作者: DeathKing
10+# 许可协议: FSL
11+# 衍生关系: ADK < ReadNote
12+# 项目版本: 1.3.0108
13+# 最后更新: 2011-01-08
14+# 引用网址:
15+#-------------------------------------------------------------------------------
16+# - 1.3.0108 By 沉影不器
17+# * 添加read_note方法,此方法区别与read_notes方法;
18+#
19+# - 1.2.0719 By DeathKing
20+# * 将read_note方法修改为read_notes,方便与沉影不器的脚本兼容;
21+#
22+# - 1.1.0607 By DeathKing
23+# * 添加兼容性检查方法;
24+#
25+# - 1.0.0529 By DeathKing
26+# * 初始版本完成;
27+#===============================================================================
28+
29+#-------------------------------------------------------------------------------
30+# ▼ 登记FSL
31+#-------------------------------------------------------------------------------
32+
33+$fscript = {} if $fscript == nil
34+$fscript["ADK"] = "1.3.0108"
35+
36+
37+#-------------------------------------------------------------------------------
38+# ▼ 通用配置模块
39+#-------------------------------------------------------------------------------
40+module FSL
41+ module ADK
42+ end
43+end
44+
45+#-------------------------------------------------------------------------------
46+# ▼ FSL模块功能
47+#-------------------------------------------------------------------------------
48+module FSL
49+ #--------------------------------------------------------------------------
50+ # ● 是否存在指定脚本
51+ # script : 脚本在$fscript中的登记名
52+ #--------------------------------------------------------------------------
53+ def self.script_in?( script )
54+ return true if $fscript[ script.to_s ] != nil
55+ return false
56+ end
57+end
58+
59+#-------------------------------------------------------------------------------
60+#
61+# ▼ 读取注释内容
62+#
63+# 使用read_notes方法返回了一个键值对应的哈希,read_notes会删除掉作为标记的
64+# <和>符号(非破坏性方法)。默认以用空格分隔的几个数据中的第一个为键,余
65+# 下为值。值为一个数组对象。
66+#
67+# 注释内容 读取到的哈希的键值对应情况
68+# <need_item 1 1> --> { "need_item" => [ "1" , "1" ] }
69+# <need_item 1,1> --> { "need_item" => [ "1,1" ] }
70+# <need_item> --> { "need_item" => [] }
71+# need_item --> { "need_item" => [] }
72+#
73+# 不使用尖括号是允许的,但我们不喜欢这样。分隔多个参数请使用空格。
74+#
75+# read_notes是返回哈希对象,因此“键”应该对大小写敏感。
76+#
77+# 使用方法:
78+# obj.read_notes
79+# obj是RPG::State、RPG::BaseItem、RPG::Enemy及其子类的有效对象
80+#
81+#
82+#-------------------------------------------------------------------------------
83+module RPG
84+ class State
85+ def read_notes
86+ result = {}
87+ self.note.split(/[\r\n]+/).each do |line|
88+ result[line.delete("<>").split[0]] = line.delete("<>").split[1..-1]
89+ end
90+ return result
91+ end
92+ end
93+ class BaseItem
94+ def read_notes
95+ result = {}
96+ self.note.split(/[\r\n]+/).each do |line|
97+ result[line.delete("<>").split[0]] = line.delete("<>").split[1..-1]
98+ end
99+ return result
100+ end
101+ end
102+ class Enemy
103+ def read_notes
104+ result = {}
105+ self.note.split(/[\r\n]+/).each do |line|
106+ result[line.delete("<>").split[0]] = line.delete("<>").split[1..-1]
107+ end
108+ return result
109+ end
110+ end
111+end
112+
113+#-------------------------------------------------------------------------------
114+#
115+# ▼ 读取注释栏指定字段
116+#
117+# 采用沉影不器的 ReadNote -fscript 2.02.1001 脚本,请与read_notes区别
118+#
119+# 【例】在vx数据库比如1号物品的备注栏里写: 耐久度 = 10
120+# 读取时使用: p $data_items[1].read_note('耐久度')
121+#
122+# 几点注意:
123+# ① 支持汉字,英文忽略大小写
124+# ② 等号右边遵循ruby语法格式,例如:
125+# test1 = 1 #=> 1
126+# test2 = "a" #=> "a"
127+# test3 = true #=> true
128+# test4 = [1,2,3] #=> [1,2,3]
129+# test5 = {"orz"=>1} #=> {"orz"=>1}
130+# ③ 等号忽略空格,以下均正确:
131+# test = nil; test= nil; test =nil; test=nil
132+#----------------------------------------------------------------------------
133+module RPG
134+ module ReadNote
135+ def self.read(str, section, mismatch = nil)
136+ str.each_line do |line|
137+ ## 不希望忽略大小写,则删掉下一行最后一个i
138+ eval("#{line}; return #{section}") if line =~ /^\s*#{section}\s*=/i
139+ end
140+ return mismatch
141+ end
142+ end
143+ #-------------------------------------------------------------------------
144+ # ○ 读取rmvx备注栏指定字段
145+ # section : 字段名
146+ # mismatch : 未匹配时的返回值
147+ #-------------------------------------------------------------------------
148+ class BaseItem
149+ def read_note(section, mismatch = nil)
150+ ReadNote.read(self.note, section, mismatch)
151+ end
152+ end
153+ class Enemy
154+ def read_note(section, mismatch = nil)
155+ ReadNote.read(self.note, section, mismatch)
156+ end
157+ end
158+ class State
159+ def read_note(section, mismatch = nil)
160+ ReadNote.read(self.note, section, mismatch)
161+ end
162+ end
163+end
\ No newline at end of file
--- /dev/null
+++ b/fscript/rpgvx/FSLShop/1.5/FSLShop.rb
@@ -0,0 +1,971 @@
1+#===============================================================================
2+# ■ [VX]简易商店拓展描绘
3+# [VX]FirefliesSimulation
4+#-------------------------------------------------------------------------------
5+# 【基本机能】方便商店购物选择
6+# 放在默认脚本之后,Main脚本之前,通过事件指令【商店处理】调用。
7+#
8+#-------------------------------------------------------------------------------
9+# 更新作者: wangswz DeathKing
10+# 许可协议: FSL
11+# 项目版本: 1.5.0903
12+# 引用网址: http://bbs.66rpg.com/thread-154915-1-1.html
13+#
14+#-------------------------------------------------------------------------------
15+# - 1.5.0903 By wangswz
16+# * 增加物品数值显示
17+# * 增加对KGC数值破限脚本的支持
18+#
19+# - 1.4.0830 By DeathKing
20+# * 修正了item.number_limit的NoMethodError判断错误问题
21+#
22+# - 1.3.0828 By wangswz
23+# * 调整操作手感 L R 换成左右键
24+#
25+# - 1.2.0828 By wangswz
26+# * 物品 武器 防具分栏显示
27+# * 现在可以在武器 防具栏内按X键(键盘默认A)来切换进行ATK DEF SPI AGI属性的
28+# 降序排列了
29+#
30+# - 1.1.0825 By wangswz
31+# * 兼容KGC合成脚本
32+# * 增加物品描绘信息
33+#
34+#-------------------------------------------------------------------------------
35+
36+
37+#===============================================================================
38+#-------------------------------------------------------------------------------
39+# ▼ 通用配置模块
40+#-------------------------------------------------------------------------------
41+module FSL
42+ module SHOP
43+ # 无法装备的提示信息
44+ Shop_help = "-无法装备-"
45+
46+ # 无法使用的提示信息
47+ Shop_help2 = "-无法使用-"
48+
49+ # 设置atk def spi agi 上升 下降 相等时 图标显示 4个一组
50+ Shop_icon = [
51+ 120,121,122,123,
52+ 124,125,126,127,
53+ 0, 0, 0, 0
54+ ]
55+ end
56+end
57+#==============================================================================
58+$imported = {} if $imported == nil
59+$fscript = {} if $fscript == nil
60+$fscript["FSLShop"] = "1.5.o903"
61+#==============================================================================
62+
63+#==============================================================================
64+# ■ Scene_Map
65+#==============================================================================
66+
67+class Scene_Map < Scene_Base
68+ #--------------------------------------------------------------------------
69+ # ● ショップ画面への切り替え
70+ #--------------------------------------------------------------------------
71+ def call_shop
72+ if $imported["ComposeItem"] == true && $game_switches[KGC::ComposeItem::COMPOSE_CALL_SWITCH]
73+ # 合成画面に移行
74+ $game_temp.next_scene = nil
75+ $game_switches[KGC::ComposeItem::COMPOSE_CALL_SWITCH] = false
76+ $scene = Scene_ComposeItem.new
77+ else
78+ $game_temp.next_scene = nil
79+ $scene = Scene_Shop2.new
80+ end
81+ end
82+end
83+#==============================================================================
84+# ■ Scene_Shop
85+#------------------------------------------------------------------------------
86+#  处理商店画面的类。
87+#==============================================================================
88+
89+class Scene_Shop2 < Scene_Base
90+ #--------------------------------------------------------------------------
91+ # ● 开始处理
92+ #--------------------------------------------------------------------------
93+ def start
94+ super
95+ create_menu_background
96+ create_command_window
97+ create_command_window2
98+ @help_window = Window_Help.new
99+ @gold_window = Window_Gold.new(384, 56)
100+ @dummy_window = Window_Base.new(0, 112, 544, 304)
101+ @dummy_window2 = Window_Base.new(304, 112, 240, 304)
102+ @dummy_window3 = Window_Base.new(0, 168, 304, 248)
103+ @dummy_window2.visible = false
104+ @dummy_window3.visible = false
105+ @buy_window = Window_ShopBuy2.new(0, 168)
106+ @buy_window.active = false
107+ @buy_window.visible = false
108+ @buy_window.help_window = @help_window
109+ @sell_window = Window_ShopSell.new(0, 112, 544, 304)
110+ @sell_window.active = false
111+ @sell_window.visible = false
112+ @sell_window.help_window = @help_window
113+ @number_window = Window_ShopNumber.new(0, 112)
114+ @number_window.active = false
115+ @number_window.visible = false
116+ @actor_index = 0
117+ @status_window = Window_Shop_ActorStatus.new($game_party.members[@actor_index])
118+ @status_window.visible = false
119+ end
120+ #--------------------------------------------------------------------------
121+ # ● 结束处理
122+ #--------------------------------------------------------------------------
123+ def terminate
124+ super
125+ dispose_menu_background
126+ dispose_command_window
127+ dispose_command_window2
128+ @help_window.dispose
129+ @gold_window.dispose
130+ @dummy_window.dispose
131+ @dummy_window2.dispose
132+ @dummy_window3.dispose
133+ @buy_window.dispose
134+ @sell_window.dispose
135+ @number_window.dispose
136+ @status_window.dispose
137+ end
138+ #--------------------------------------------------------------------------
139+ # ● 更新画面
140+ #--------------------------------------------------------------------------
141+ def update
142+ super
143+ update_menu_background
144+ @help_window.update
145+ @command_window.update
146+ @command_window2.update
147+ @gold_window.update
148+ @dummy_window.update
149+ @dummy_window2.update
150+ @dummy_window3.update
151+ @buy_window.update
152+ @sell_window.update
153+ @number_window.update
154+ @status_window.update
155+ if @command_window.active
156+ update_command_selection
157+ elsif @buy_window.active
158+ update_buy_selection1
159+ elsif @sell_window.active
160+ update_sell_selection
161+ elsif @number_window.active
162+ update_number_input
163+ elsif @command_window2.active
164+ update_command_selection2
165+ end
166+ end
167+ #--------------------------------------------------------------------------
168+ # ● 生成命令窗口
169+ #--------------------------------------------------------------------------
170+ def create_command_window
171+ s1 = Vocab::ShopBuy
172+ s2 = Vocab::ShopSell
173+ s3 = Vocab::ShopCancel
174+ @command_window = Window_Command.new(384, [s1, s2, s3], 3)
175+ @command_window.y = 56
176+ if $game_temp.shop_purchase_only
177+ @command_window.draw_item(1, false)
178+ end
179+ end
180+ #--------------------------------------------------------------------------
181+ # ● 释放命令窗口
182+ #--------------------------------------------------------------------------
183+ def dispose_command_window
184+ @command_window.dispose
185+ end
186+ #--------------------------------------------------------------------------
187+ # ● 更新命令窗口
188+ #--------------------------------------------------------------------------
189+ def update_command_selection
190+ if Input.trigger?(Input::B)
191+ Sound.play_cancel
192+ $scene = Scene_Map.new
193+ elsif Input.trigger?(Input::C)
194+ case @command_window.index
195+ when 0 # 买入
196+ Sound.play_decision
197+ @command_window.active = false
198+ @dummy_window.visible = false
199+ @dummy_window2.visible = true
200+ @dummy_window3.visible = true
201+ @command_window2.active = true
202+ @command_window2.visible = true
203+ when 1 # 卖出
204+ if $game_temp.shop_purchase_only
205+ Sound.play_buzzer
206+ else
207+ Sound.play_decision
208+ @command_window.active = false
209+ @dummy_window.visible = false
210+ @sell_window.active = true
211+ @sell_window.visible = true
212+ @sell_window.refresh
213+ end
214+ when 2 # 离开
215+ Sound.play_decision
216+ $scene = Scene_Map.new
217+ end
218+ end
219+ end
220+ #--------------------------------------------------------------------------
221+ # ● 生成二级命令窗口
222+ #--------------------------------------------------------------------------
223+ def create_command_window2
224+ s1 = "物品"
225+ s2 = "武器"
226+ s3 = "防具"
227+ @command_window2 = Window_Command.new(304, [s1, s2, s3], 3)
228+ @command_window2.x = 0
229+ @command_window2.y = 112
230+ @command_window2.active = false
231+ @command_window2.visible = false
232+ end
233+ #--------------------------------------------------------------------------
234+ # ● 释放二级命令窗口
235+ #--------------------------------------------------------------------------
236+ def dispose_command_window2
237+ @command_window2.dispose
238+ end
239+ #--------------------------------------------------------------------------
240+ # ● 更新二级命令窗口
241+ #--------------------------------------------------------------------------
242+ def update_command_selection2
243+ if Input.trigger?(Input::B)
244+ Sound.play_cancel
245+ @command_window.active = true
246+ @command_window2.active = false
247+ @command_window2.visible = false
248+ @dummy_window.visible = true
249+ @dummy_window2.visible = false
250+ @dummy_window3.visible = false
251+ @buy_window.active = false
252+ @buy_window.visible = false
253+ @status_window.visible = false
254+ @status_window.item = nil
255+ @help_window.set_text("")
256+ return
257+ elsif Input.trigger?(Input::C)
258+ case @command_window2.index
259+ when 0
260+ Sound.play_decision
261+ @command_window2.active = false
262+ @buy_window.index = 0
263+ @buy_window.active = true
264+ @buy_window.visible = true
265+ @buy_window.type = 0
266+ @buy_window.refresh
267+ @status_window.visible = true
268+ when 1
269+ Sound.play_decision
270+ @command_window2.active = false
271+ @buy_window.index = 0
272+ @buy_window.active = true
273+ @buy_window.visible = true
274+ @buy_window.type = 1
275+ @buy_window.refresh
276+ @status_window.visible = true
277+ when 2
278+ Sound.play_decision
279+ @command_window2.active = false
280+ @buy_window.index = 0
281+ @buy_window.active = true
282+ @buy_window.visible = true
283+ @buy_window.type = 2
284+ @buy_window.refresh
285+ @status_window.visible = true
286+ end
287+ end
288+ end
289+ #--------------------------------------------------------------------------
290+ # ● 更新买入选择
291+ #--------------------------------------------------------------------------
292+ def update_buy_selection1
293+ @status_window.item = @buy_window.item
294+ if Input.trigger?(Input::B)
295+ Sound.play_cancel
296+ @command_window2.active = true
297+ @buy_window.active = false
298+ @buy_window.visible = false
299+ @status_window.visible = false
300+ @status_window.item = nil
301+ @help_window.set_text("")
302+ return
303+ end
304+ if Input.trigger?(Input::C)
305+ @item = @buy_window.item
306+ number = $game_party.item_number(@item)
307+ if $imported["LimitBreak"] == true
308+ if @item == nil || @item.price > $game_party.gold ||
309+ number == @item.number_limit
310+ Sound.play_buzzer
311+ else
312+ Sound.play_decision
313+ max = (@item.price == 0 ?
314+ @item.number_limit : $game_party.gold / @item.price)
315+ max = [max, @item.number_limit - number].min
316+ @buy_window.active = false
317+ @buy_window.visible = false
318+ @number_window.set(@item, max, @item.price)
319+ @number_window.active = true
320+ @number_window.visible = true
321+ end
322+ else
323+ if @item == nil or @item.price > $game_party.gold or number == 99
324+ Sound.play_buzzer
325+ else
326+ Sound.play_decision
327+ max = @item.price == 0 ? 99 : $game_party.gold / @item.price
328+ max = [max, 99 - number].min
329+ @buy_window.active = false
330+ @buy_window.visible = false
331+ @number_window.set(@item, max, @item.price)
332+ @number_window.active = true
333+ @number_window.visible = true
334+ end
335+ end
336+ end
337+ if Input.trigger?(Input::RIGHT)
338+ Sound.play_cursor
339+ next_actor
340+ elsif Input.trigger?(Input::LEFT)
341+ Sound.play_cursor
342+ prev_actor
343+ end
344+ if Input.trigger?(Input::X)
345+ @buy_window.sort_item
346+ end
347+ end
348+ #--------------------------------------------------------------------------
349+ # ● 切换至下一角色画面
350+ #--------------------------------------------------------------------------
351+ def next_actor
352+ @actor_index += 1
353+ @actor_index %= $game_party.members.size
354+ @status_window.actor = ($game_party.members[@actor_index])
355+ end
356+ #--------------------------------------------------------------------------
357+ # ● 切换至上一角色画面
358+ #--------------------------------------------------------------------------
359+ def prev_actor
360+ @actor_index += $game_party.members.size - 1
361+ @actor_index %= $game_party.members.size
362+ @status_window.actor = ($game_party.members[@actor_index])
363+ end
364+ #--------------------------------------------------------------------------
365+ # ● 更新卖出选择
366+ #--------------------------------------------------------------------------
367+ def update_sell_selection
368+ if Input.trigger?(Input::B)
369+ Sound.play_cancel
370+ @command_window.active = true
371+ @dummy_window.visible = true
372+ @sell_window.active = false
373+ @sell_window.visible = false
374+ @status_window.item = nil
375+ @help_window.set_text("")
376+ elsif Input.trigger?(Input::C)
377+ @item = @sell_window.item
378+ @status_window.item = @item
379+ if @item == nil or @item.price == 0
380+ Sound.play_buzzer
381+ else
382+ Sound.play_decision
383+ max = $game_party.item_number(@item)
384+ @sell_window.active = false
385+ @sell_window.visible = false
386+ @number_window.set(@item, max, @item.price / 2)
387+ @number_window.active = true
388+ @number_window.visible = true
389+ @status_window.visible = true
390+ end
391+ end
392+ end
393+ #--------------------------------------------------------------------------
394+ # ● 更新数值输入
395+ #--------------------------------------------------------------------------
396+ def update_number_input
397+ if Input.trigger?(Input::B)
398+ cancel_number_input
399+ elsif Input.trigger?(Input::C)
400+ decide_number_input
401+ end
402+ end
403+ #--------------------------------------------------------------------------
404+ # ● 取消数值输入
405+ #--------------------------------------------------------------------------
406+ def cancel_number_input
407+ Sound.play_cancel
408+ @number_window.active = false
409+ @number_window.visible = false
410+ case @command_window.index
411+ when 0 # 买入
412+ @buy_window.active = true
413+ @buy_window.visible = true
414+ when 1 # 卖出
415+ @sell_window.active = true
416+ @sell_window.visible = true
417+ @status_window.visible = false
418+ end
419+ end
420+ #--------------------------------------------------------------------------
421+ # ● 确认数值输入
422+ #--------------------------------------------------------------------------
423+ def decide_number_input
424+ Sound.play_shop
425+ @number_window.active = false
426+ @number_window.visible = false
427+ case @command_window.index
428+ when 0 # 买入
429+ $game_party.lose_gold(@number_window.number * @item.price)
430+ $game_party.gain_item(@item, @number_window.number)
431+ @gold_window.refresh
432+ @buy_window.refresh
433+ @status_window.refresh
434+ @buy_window.active = true
435+ @buy_window.visible = true
436+ when 1 # 卖出
437+ $game_party.gain_gold(@number_window.number * (@item.price / 2))
438+ $game_party.lose_item(@item, @number_window.number)
439+ @gold_window.refresh
440+ @sell_window.refresh
441+ @status_window.refresh
442+ @sell_window.active = true
443+ @sell_window.visible = true
444+ @status_window.visible = false
445+ end
446+ end
447+end
448+#==============================================================================
449+# ■ Window_Shop_ActorStatus
450+#------------------------------------------------------------------------------
451+#  显示角色的状态窗口。
452+#==============================================================================
453+
454+class Window_Shop_ActorStatus < Window_Base
455+ #--------------------------------------------------------------------------
456+ # ● 初始化对像
457+ # actor : 角色
458+ #--------------------------------------------------------------------------
459+ def initialize(actor, item = nil, sort = 0)
460+ super(304, 112, 240, 304)
461+ @item = item
462+ @actor = actor
463+ @sort = sort
464+ refresh
465+ end
466+ #--------------------------------------------------------------------------
467+ # ● 刷新
468+ #--------------------------------------------------------------------------
469+ def refresh
470+ self.contents.clear
471+ draw_Shopface(@actor.face_name, @actor.face_index, 84, 4)
472+ draw_actor_name(@actor, 4, 0)
473+ draw_actor_graphic(@actor, 192, 56)
474+
475+ if @item != nil
476+ draw_actor_parameter_change(@actor, 4, 96)
477+ number = $game_party.item_number(@item)
478+ self.contents.font.color = system_color
479+ self.contents.draw_text(4, WLH * 10, 200, WLH, Vocab::Possession)
480+ self.contents.font.color = normal_color
481+ self.contents.draw_text(4, WLH * 10, 200, WLH, number, 2)
482+ if @item.is_a?(RPG::Item) && @item.scope > 0
483+ draw_item_parameter_change(4, 48)
484+ elsif @item.is_a?(RPG::Item)
485+ self.contents.font.color = system_color
486+ self.contents.draw_text(0, y + 24, 200, WLH, FSL::SHOP::Shop_help2, 1)
487+ end
488+ end
489+ end
490+ #--------------------------------------------------------------------------
491+ # ● 绘制物品效果
492+ # x : 绘制点 X 座标
493+ # y : 绘制点 Y 座标
494+ #--------------------------------------------------------------------------
495+ def draw_item_parameter_change(x, y)
496+ if @item.scope > 6
497+ draw_actor_hp(@actor, x, y)
498+ draw_actor_mp(@actor, x, y + 24)
499+ self.contents.font.color = system_color
500+ self.contents.draw_text(x, y + WLH * 2, 200, WLH, "hp mp 回复值/率", 2)
501+
502+ self.contents.font.color = hp_gauge_color1
503+ self.contents.draw_text(x - 10, y + WLH * 3, 104, WLH, sprintf("%d", @item.hp_recovery), 2)
504+ self.contents.draw_text(x, y + WLH * 4, 104, WLH, sprintf("%d", @item.hp_recovery_rate)+"%", 2)
505+
506+ self.contents.font.color = mp_gauge_color1
507+ self.contents.draw_text(x - 10, y + WLH * 3, 200, WLH, sprintf("%d", @item.mp_recovery), 2)
508+ self.contents.draw_text(x, y + WLH * 4, 200, WLH, sprintf("%d", @item.mp_recovery_rate)+"%", 2)
509+
510+ if @item.parameter_type > 0
511+ self.contents.font.color = system_color
512+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "增加能力")
513+ self.contents.font.color = normal_color
514+ case @item.parameter_type
515+ when 1
516+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "HP", 1)
517+ when 2
518+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "MP", 1)
519+ when 3
520+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "ATK", 1)
521+ when 4
522+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "DEF", 1)
523+ when 5
524+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "SPI", 1)
525+ when 6
526+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "AGI", 1)
527+ end
528+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, sprintf("%d", @item.parameter_points), 2)
529+ else
530+ self.contents.font.color = text_color(7)
531+ self.contents.draw_text(x, y + WLH * 7, 200, WLH, "增加能力")
532+ end
533+ else
534+ self.contents.font.color = normal_color
535+ draw_actor_parameter(@actor, x, y, 0)
536+ draw_actor_parameter(@actor, x, y + 24, 2)
537+
538+ self.contents.font.color = system_color
539+ self.contents.draw_text(x, y + WLH * 2, 240, WLH, "伤害值 力量/精神影响")
540+
541+ self.contents.font.color = normal_color
542+ self.contents.draw_text(x, y + WLH * 3, 104, WLH, sprintf("%d", @item.base_damage))
543+
544+ self.contents.font.color = hp_gauge_color1
545+ self.contents.draw_text(x, y + WLH * 4, 104, WLH, sprintf("%d", @item.atk_f), 2)
546+
547+ self.contents.font.color = mp_gauge_color1
548+ self.contents.draw_text(x, y + WLH * 4, 200, WLH, sprintf("%d", @item.spi_f), 2)
549+ end
550+
551+ self.contents.font.color = system_color
552+ if @item.plus_state_set.size == 0
553+ self.contents.font.color = text_color(7)
554+ end
555+ self.contents.draw_text(x, y + WLH * 5, 200, WLH, "增益")
556+ self.contents.font.color = system_color
557+ if @item.minus_state_set.size == 0
558+ self.contents.font.color = text_color(7)
559+ end
560+ self.contents.draw_text(x, y + WLH * 6, 200, WLH, "削减")
561+ m = 48
562+ for i in @item.plus_state_set
563+ draw_icon($data_states[i].icon_index, x + m, y + WLH * 5)
564+ break if m == 168
565+ m += 24
566+ end
567+ m = 48
568+ for i in @item.minus_state_set
569+ draw_icon($data_states[i].icon_index, x + m, y + WLH * 6)
570+ break if m == 168
571+ m += 24
572+ end
573+ end
574+ #--------------------------------------------------------------------------
575+ # ● 绘制角色当前装备和能力值
576+ # actor : 角色
577+ # x : 绘制点 X 座标
578+ # y : 绘制点 Y 座标
579+ #--------------------------------------------------------------------------
580+ def draw_actor_parameter_change(actor, x, y)
581+ return if @item.is_a?(RPG::Item)
582+ enabled = actor.equippable?(@item)
583+ if @item.is_a?(RPG::Weapon)
584+ item1 = weaker_weapon(actor)
585+ elsif actor.two_swords_style and @item.kind == 0
586+ item1 = nil
587+ else
588+ if $imported["EquipExtension"] == true
589+ index = actor.equip_type.index(@item.kind)
590+ item1 = (index != nil ? actor.equips[1 + index] : nil)
591+ else
592+ item1 = actor.equips[1 + @item.kind]
593+ end
594+ end
595+
596+ if enabled
597+
598+ atk1 = item1 == nil ? 0 : item1.atk
599+ atk2 = @item == nil ? 0 : @item.atk
600+ change = atk2 - atk1
601+ shop_change(change)
602+ if change > 0
603+ draw_icon(FSL::SHOP::Shop_icon[0], 108, y + WLH)
604+ elsif change < 0
605+ draw_icon(FSL::SHOP::Shop_icon[4], 108, y + WLH)
606+ else
607+ draw_icon(FSL::SHOP::Shop_icon[8], 108, y + WLH)
608+ end
609+ self.contents.draw_text(x, y + WLH, 200, WLH, sprintf("%d", atk2), 2)
610+
611+ def1 = item1 == nil ? 0 : item1.def
612+ def2 = @item == nil ? 0 : @item.def
613+ change = def2 - def1
614+ shop_change(change)
615+ if change > 0
616+ draw_icon(FSL::SHOP::Shop_icon[1], 108, y + WLH * 2)
617+ elsif change < 0
618+ draw_icon(FSL::SHOP::Shop_icon[5], 108, y + WLH * 2)
619+ else
620+ draw_icon(FSL::SHOP::Shop_icon[9], 108, y + WLH)
621+ end
622+ self.contents.draw_text(x, y + WLH * 2, 200, WLH, sprintf("%d", def2), 2)
623+
624+ spi1 = item1 == nil ? 0 : item1.spi
625+ spi2 = @item == nil ? 0 : @item.spi
626+ change = spi2 - spi1
627+ shop_change(change)
628+ if change > 0
629+ draw_icon(FSL::SHOP::Shop_icon[2], 108, y + WLH * 3)
630+ elsif change < 0
631+ draw_icon(FSL::SHOP::Shop_icon[6], 108, y + WLH * 3)
632+ else
633+ draw_icon(FSL::SHOP::Shop_icon[10], 108, y + WLH)
634+ end
635+ self.contents.draw_text(x, y + WLH * 3, 200, WLH, sprintf("%d", spi2), 2)
636+
637+ agi1 = item1 == nil ? 0 : item1.agi
638+ agi2 = @item == nil ? 0 : @item.agi
639+ change = agi2 - agi1
640+ shop_change(change)
641+ if change > 0
642+ draw_icon(FSL::SHOP::Shop_icon[3], 108, y + WLH * 4)
643+ elsif change < 0
644+ draw_icon(FSL::SHOP::Shop_icon[7], 108, y + WLH * 4)
645+ else
646+ draw_icon(FSL::SHOP::Shop_icon[11], 108, y + WLH)
647+ end
648+ self.contents.draw_text(x, y + WLH * 4, 200, WLH, sprintf("%d", agi2), 2)
649+
650+ self.contents.font.color = system_color
651+ self.contents.draw_text(4, y - 32, 204, WLH, "当前装备")
652+
653+ self.contents.draw_text(x + 32, y + WLH, 200, WLH, sprintf("%d", atk1))
654+ self.contents.draw_text(x + 32, y + WLH * 2, 200, WLH, sprintf("%d", def1))
655+ self.contents.draw_text(x + 32, y + WLH * 3, 200, WLH, sprintf("%d", spi1))
656+ self.contents.draw_text(x + 32, y + WLH * 4, 200, WLH, sprintf("%d", agi1))
657+
658+ self.contents.draw_text(0, y + WLH, 200, WLH, "ATK")
659+ self.contents.draw_text(0, y + WLH * 2, 200, WLH, "DEF")
660+ self.contents.draw_text(0, y + WLH * 3, 200, WLH, "SPI")
661+ self.contents.draw_text(0, y + WLH * 4, 200, WLH, "AGI")
662+
663+ if item1 != nil
664+ self.contents.draw_text(24, y, 208, WLH, item1.name)
665+ draw_icon(item1.icon_index, 0, y)
666+ else
667+ self.contents.draw_text(24, y, 208, WLH, "无")
668+ end
669+ else
670+ self.contents.font.color = normal_color
671+ self.contents.draw_text(0, y + 24, 200, WLH, FSL::SHOP::Shop_help, 1)
672+ end
673+ end
674+ #--------------------------------------------------------------------------
675+ # ● 判断数值颜色
676+ # change : 数值
677+ #--------------------------------------------------------------------------
678+ def shop_change(change)
679+ if change == 0
680+ self.contents.font.color = normal_color
681+ else
682+ self.contents.font.color = change>0 ? power_up_color : power_down_color
683+ end
684+ end
685+ #--------------------------------------------------------------------------
686+ # ● 获取双刀派角色所装备的武器中较弱的武器
687+ # actor : 角色
688+ #--------------------------------------------------------------------------
689+ def weaker_weapon(actor)
690+ if actor.two_swords_style
691+ weapon1 = actor.weapons[0]
692+ weapon2 = actor.weapons[1]
693+ if weapon1 == nil or weapon2 == nil
694+ return nil
695+ elsif weapon1.atk < weapon2.atk
696+ return weapon1
697+ else
698+ return weapon2
699+ end
700+ else
701+ return actor.weapons[0]
702+ end
703+ end
704+ #--------------------------------------------------------------------------
705+ # ● 设置角色
706+ # actor : 角色
707+ #--------------------------------------------------------------------------
708+ def actor=(actor)
709+ if @actor != actor
710+ @actor = actor
711+ refresh
712+ end
713+ end
714+ #--------------------------------------------------------------------------
715+ # ● 设置物品
716+ # item : 新物品
717+ #--------------------------------------------------------------------------
718+ def item=(item)
719+ if @item != item
720+ @item = item
721+ refresh
722+ end
723+ end
724+ #--------------------------------------------------------------------------
725+ # ● 绘制头像部分图
726+ # face_name : 头像文件名
727+ # face_index : 头像号码
728+ # x : 描画目标 X 坐标
729+ # y : 描画目标 Y 坐标
730+ # size : 显示大小
731+ #--------------------------------------------------------------------------
732+ def draw_Shopface(face_name, face_index, x, y, size = 96)
733+ bitmap = Cache.face(face_name)
734+ rect = Rect.new(0, 0, 0, 0)
735+ rect.x = face_index % 4 * 96 + (96 - size) / 2
736+ rect.y = face_index / 4 * 96 + (96 - size) / 2 + size / 4
737+ rect.width = size
738+ rect.height = size / 2
739+ self.contents.blt(x, y, bitmap, rect)
740+ bitmap.dispose
741+ end
742+end
743+#==============================================================================
744+# ■ Window_ShopBuy2
745+#------------------------------------------------------------------------------
746+#  商店画面、浏览显示可以购买的商品的窗口。
747+#==============================================================================
748+
749+class Window_ShopBuy2 < Window_Selectable
750+ #--------------------------------------------------------------------------
751+ # ● 初始化对像
752+ # x : 窗口 X 座标
753+ # y : 窗口 Y 座标
754+ #--------------------------------------------------------------------------
755+ def initialize(x, y)
756+ super(x, y, 304, 248)
757+ @shop_goods = $game_temp.shop_goods
758+ @type = 0
759+ @sort = 0
760+ refresh
761+ self.index = 0
762+ end
763+ #--------------------------------------------------------------------------
764+ # ● 商品类型
765+ #--------------------------------------------------------------------------
766+ def type=(type)
767+ if @type != type
768+ @type = type
769+ refresh
770+ end
771+ end
772+ #--------------------------------------------------------------------------
773+ # ● 获取商品
774+ #--------------------------------------------------------------------------
775+ def item
776+ if @type == 0
777+ return @data1[self.index]
778+ elsif @type == 1
779+ return @data2[self.index]
780+ else
781+ return @data3[self.index]
782+ end
783+ end
784+ #--------------------------------------------------------------------------
785+ # ● 刷新
786+ #--------------------------------------------------------------------------
787+ def refresh
788+ @data1 = []
789+ @data2 = []
790+ @data3 = []
791+ for goods_item in @shop_goods
792+ case goods_item[0]
793+ when 0
794+ item = $data_items[goods_item[1]]
795+ if item != nil
796+ @data1.push(item)
797+ end
798+ when 1
799+ item = $data_weapons[goods_item[1]]
800+ if item != nil
801+ @data2.push(item)
802+ end
803+ when 2
804+ item = $data_armors[goods_item[1]]
805+ if item != nil
806+ @data3.push(item)
807+ end
808+ end
809+ end
810+ for i in 0...@data2.size
811+ for j in i...@data2.size
812+ if @data2[i].atk < @data2[j].atk
813+ m = @data2[i]
814+ @data2[i] = @data2[j]
815+ @data2[j] = m
816+ end
817+ end
818+ end
819+ for i in 0...@data3.size
820+ for j in i...@data3.size
821+ if @data3[i].atk < @data3[j].atk
822+ m = @data3[i]
823+ @data3[i] = @data3[j]
824+ @data3[j] = m
825+ end
826+ end
827+ end
828+ @sort = 1
829+ if @type == 0
830+ @item_max = @data1.size
831+ elsif @type == 1
832+ @item_max = @data2.size
833+ else
834+ @item_max = @data3.size
835+ end
836+
837+ create_contents
838+ for i in 0...@item_max
839+ draw_item1(i)
840+ end
841+ end
842+ #--------------------------------------------------------------------------
843+ # ● 绘制商品
844+ # index : 商品索引
845+ #--------------------------------------------------------------------------
846+ def draw_item1(index)
847+ if @type == 0
848+ item = @data1[index]
849+ elsif @type == 1
850+ item = @data2[index]
851+ else
852+ item = @data3[index]
853+ end
854+ number = $game_party.item_number(item)
855+ if $imported["LimitBreak"] == true
856+ enabled = (item.price <= $game_party.gold && number < item.number_limit)
857+ else
858+ enabled = (item.price <= $game_party.gold and number < 99)
859+ end
860+ rect = item_rect(index)
861+ self.contents.clear_rect(rect)
862+ draw_item_name(item, rect.x, rect.y, enabled)
863+ rect.width -= 4
864+ self.contents.draw_text(rect, item.price, 2)
865+ end
866+ #--------------------------------------------------------------------------
867+ # ● 顺位排序
868+ #--------------------------------------------------------------------------
869+ def sort_item
870+ case @sort
871+ when 0
872+ for i in 0...@data2.size
873+ for j in i...@data2.size
874+ if @data2[i].atk < @data2[j].atk
875+ m = @data2[i]
876+ @data2[i] = @data2[j]
877+ @data2[j] = m
878+ end
879+ end
880+ end
881+ for i in 0...@data3.size
882+ for j in i...@data3.size
883+ if @data3[i].atk < @data3[j].atk
884+ m = @data3[i]
885+ @data3[i] = @data3[j]
886+ @data3[j] = m
887+ end
888+ end
889+ end
890+ @sort = 1
891+ when 1
892+ for i in 0...@data2.size
893+ for j in i...@data2.size
894+ if @data2[i].def < @data2[j].def
895+ m = @data2[i]
896+ @data2[i] = @data2[j]
897+ @data2[j] = m
898+ end
899+ end
900+ end
901+ for i in 0...@data3.size
902+ for j in i...@data3.size
903+ if @data3[i].def < @data3[j].def
904+ m = @data3[i]
905+ @data3[i] = @data3[j]
906+ @data3[j] = m
907+ end
908+ end
909+ end
910+ @sort = 2
911+ when 2
912+ for i in 0...@data2.size
913+ for j in i...@data2.size
914+ if @data2[i].spi < @data2[j].spi
915+ m = @data2[i]
916+ @data2[i] = @data2[j]
917+ @data2[j] = m
918+ end
919+ end
920+ end
921+ for i in 0...@data3.size
922+ for j in i...@data3.size
923+ if @data3[i].spi < @data3[j].spi
924+ m = @data3[i]
925+ @data3[i] = @data3[j]
926+ @data3[j] = m
927+ end
928+ end
929+ end
930+ @sort = 3
931+ when 3
932+ for i in 0...@data2.size
933+ for j in i...@data2.size
934+ if @data2[i].agi < @data2[j].agi
935+ m = @data2[i]
936+ @data2[i] = @data2[j]
937+ @data2[j] = m
938+ end
939+ end
940+ end
941+ for i in 0...@data3.size
942+ for j in i...@data3.size
943+ if @data3[i].agi < @data3[j].agi
944+ m = @data3[i]
945+ @data3[i] = @data3[j]
946+ @data3[j] = m
947+ end
948+ end
949+ end
950+ @sort = 0
951+ end
952+ if @type == 0
953+ @item_max = @data1.size
954+ elsif @type == 1
955+ @item_max = @data2.size
956+ else
957+ @item_max = @data3.size
958+ end
959+
960+ create_contents
961+ for i in 0...@item_max
962+ draw_item1(i)
963+ end
964+ end
965+ #--------------------------------------------------------------------------
966+ # ● 更新帮助窗口文字
967+ #--------------------------------------------------------------------------
968+ def update_help
969+ @help_window.set_text(item == nil ? "" : item.description)
970+ end
971+end
\ No newline at end of file
--- /dev/null
+++ b/fscript/rpgvx/FirefliesSimulation/1.2/FirefliesSimulation.rb
@@ -0,0 +1,372 @@
1+#===============================================================================
2+# ■ [VX]萤火虫模拟
3+# [VX]FirefliesSimulation
4+#-------------------------------------------------------------------------------
5+# 地图上开启萤火虫的方法: 执行事件脚本 $scene.fireflies(数量)
6+# 关闭的方法是: $scene.fireflies(0)
7+#
8+# 其它scene类的开启同样执行该scene对象的 fireflies(数量)
9+#-------------------------------------------------------------------------------
10+# 更新作者: 沉影不器
11+# 许可协议: FSL
12+# 项目版本: 1.2.0827
13+# 引用网址: http://bbs.66rpg.com/thread-111137-1-2.html
14+#-------------------------------------------------------------------------------
15+# - 1.2.0827 By 沉影不器
16+# * 使用FSL协议
17+#
18+# - 1.1.0108 By 沉影不器
19+# * 允许使用地图模式(否则为屏幕模式),即萤火虫相对整个地图坐标活动
20+# * 允许自定义萤火虫的初始化区域
21+# * 增加闪烁参数
22+#
23+# - 1.0.1128 By 沉影不器
24+# * 初版
25+#===============================================================================
26+$fscript = {} if $fscript == nil
27+$fscript["FirefliesSimulation"] = "1.2.0827"
28+
29+#-------------------------------------------------------------------------------
30+# ▼ 通用配置模块
31+#-------------------------------------------------------------------------------
32+module FSL
33+ module Fireflies_Simulation
34+ PicName = "firefly" # 图片名
35+ Opacity = 255 # 不透明度
36+ Speed = 5 # 移动速度
37+ CYC = 120 # 群体分散度
38+ Disperse = 5 # 个体分散度
39+ BlendType = 1 # 合成方式(0:正常 1:加法 2:减法)
40+ LeaderEnable = true # 允许头领带队
41+ MapMode = true # 开启地图模式(地图当坐标,否则屏幕当坐标)
42+ Sparkle = 80 # 闪烁值(0-100; 0:关闭闪烁)
43+ IniRect = [] # 初始化萤火虫的区域[x,y,width,height]
44+ # * 两个元素表示用坐标点做区域
45+ # * 放空默认使用屏幕或全地图做区域
46+ # 该参数受MapMode影响
47+ end
48+end
49+#==============================================================================
50+# □ Game_Firefly
51+#==============================================================================
52+class Game_Firefly
53+ include FSL::Fireflies_Simulation
54+ #--------------------------------------------------------------------------
55+ # ○ 实例变量
56+ #--------------------------------------------------------------------------
57+ attr_reader :id # ID
58+ attr_reader :x # X 坐标
59+ attr_reader :y # Y 坐标
60+ attr_reader :z # Z 坐标
61+ attr_reader :angle # 角度 (0~360) ### 图像旋转预留
62+ attr_reader :blend_type # 合成方式
63+ attr_reader :pic_name
64+ attr_reader :opacity
65+ attr_accessor :leader_id # 头领id
66+ #--------------------------------------------------------------------------
67+ # ○ 初始化对象
68+ #--------------------------------------------------------------------------
69+ def initialize(id)
70+ @id = id
71+ @w,@h = set_rect
72+ @x,@y = rand_pos
73+ @angle = rand(360)
74+ @z = 199
75+ @angle = 0
76+ @opacity = Opacity
77+ @leader_id = 0
78+ @pic_name = PicName
79+ @blend_type = BlendType
80+ ## 百分比*10
81+ @speed = Speed/100.0
82+ ## 是否头领
83+ @leader = @id == @leader_id
84+ ## 群体分散计数器
85+ @move_count = 0
86+ end
87+ #--------------------------------------------------------------------------
88+ # ○ 是否地图模式?
89+ #--------------------------------------------------------------------------
90+ def map_type?
91+ return (MapMode and $scene.is_a? Scene_Map)
92+ end
93+ #--------------------------------------------------------------------------
94+ # ○ 活动范围
95+ #--------------------------------------------------------------------------
96+ def set_rect
97+ if map_type?
98+ return $game_map.width*256,$game_map.height*256
99+ else
100+ return Graphics.width,Graphics.height
101+ end
102+ end
103+ #--------------------------------------------------------------------------
104+ # ○ 打散
105+ #--------------------------------------------------------------------------
106+ def rand_pos
107+ case IniRect.size
108+ when 1
109+ return rand(IniRect[0]),rand(IniRect[0])
110+ when 2
111+ return rand(IniRect[0]),rand(IniRect[1])
112+ when 3
113+ return [IniRect[0]+rand(IniRect[2]),IniRect[1]+rand(IniRect[2])]
114+ when 4
115+ return [IniRect[0]+rand(IniRect[2]),IniRect[1]+rand(IniRect[3])]
116+ else
117+ return rand(@w),rand(@h)
118+ end
119+ end
120+ #--------------------------------------------------------------------------
121+ # ○ 自主移动
122+ #--------------------------------------------------------------------------
123+ def self_move
124+ ## 方向转换角度范围(-15..15)
125+ @angle += (-1)**(rand(2)+1) * rand(15)
126+ ## 角度转弧度
127+ rad = (@angle * Math::PI) / 180
128+ speed = (100.0-rand(Disperse)) * @speed
129+ dx = Math.cos(rad) * speed
130+ dy = Math.sin(rad) * speed
131+ @x += dx
132+ @y += dy
133+ ## 转向
134+ turn_around(dx, dy)
135+ end
136+ #--------------------------------------------------------------------------
137+ # ○ 跟随移动
138+ #--------------------------------------------------------------------------
139+ def follow_move
140+ ## 超出距离时自主移动
141+ if distance > 150**2
142+ self_move
143+ return
144+ end
145+ ## 群体分散
146+ if @move_count < 0
147+ @move_count = CYC
148+ rx = leader.x - @x
149+ ry = leader.y - @y
150+ @angle = Math.atan2(ry,rx)*180 / Math::PI
151+ ## 打散
152+ @angle += rand(60) * ((-1)**(rand(2)+1))
153+ else
154+ @move_count -= rand(Disperse)
155+ ## 方向转换角度范围(-30..30)
156+ @angle += rand(15) * ((-1)**(rand(2)+1))
157+ end
158+ ###@angle = rad*180 / Math::PI
159+ ## 角度转弧度
160+ rad = (@angle * Math::PI) / 180
161+ speed = (rand(Disperse)+100.0) * @speed
162+ dx = Math.cos(rad) * speed
163+ dy = Math.sin(rad) * speed
164+ @x += dx
165+ @y += dy
166+ end
167+ #--------------------------------------------------------------------------
168+ # ○ 活动类型
169+ #--------------------------------------------------------------------------
170+ def update_active_type
171+ return if Sparkle.zero?
172+ @opacity = Opacity - Opacity * rand(Sparkle) / 100.0
173+ end
174+ #--------------------------------------------------------------------------
175+ # ○ 转向
176+ #--------------------------------------------------------------------------
177+ def turn_around(dx, dy)
178+ if @x <= 0 && dx < 0 or @x >= @w && dx > 0
179+ @angle = Math.atan2(dy,-dx)*180 / Math::PI
180+ @x -= dx
181+ ## 角度转弧度
182+ rad = (@angle * Math::PI) / 180
183+ speed = (rand(Disperse)+100.0) * @speed
184+ new_dx = Math.cos(rad) * speed
185+ new_dy = Math.sin(rad) * speed
186+ @x += new_dx
187+ @y += new_dy
188+ elsif @y <= 0 && dy < 0 or @y >= @h && dy > 0
189+ @angle = Math.atan2(-dy,dx)*180 / Math::PI
190+ @y -= dy
191+ ## 角度转弧度
192+ rad = (@angle * Math::PI) / 180
193+ speed = (rand(Disperse)+100.0) * @speed
194+ new_dx = Math.cos(rad) * speed
195+ new_dy = Math.sin(rad) * speed
196+ @x += new_dx
197+ @y += new_dy
198+ end
199+ end
200+ #--------------------------------------------------------------------------
201+ # ○ 距离判断 (返回值: 与头领的距离**2)
202+ #--------------------------------------------------------------------------
203+ def distance
204+ if map_type?
205+ result = (screen_x-leader.screen_x)**2 + (screen_y-leader.screen_y)**2
206+ else
207+ result = (@x-leader.x)**2 + (@y-leader.y)**2
208+ end
209+ return result
210+ end
211+ #--------------------------------------------------------------------------
212+ # ○ 跟随对象
213+ #--------------------------------------------------------------------------
214+ def leader
215+ return $game_fireflies[0]
216+ end
217+ #--------------------------------------------------------------------------
218+ # ○ 是否跟随对象(头领)?
219+ #--------------------------------------------------------------------------
220+ def leader?
221+ return @leader
222+ end
223+ #--------------------------------------------------------------------------
224+ # ○ 判断坐标一致
225+ # x : X 坐标
226+ # y : Y 坐标
227+ #--------------------------------------------------------------------------
228+ def pos?(x, y)
229+ return (@x == x and @y == y)
230+ end
231+ #--------------------------------------------------------------------------
232+ # ○ 刷新
233+ #--------------------------------------------------------------------------
234+ def update
235+ if !LeaderEnable or !leader?
236+ follow_move
237+ else
238+ self_move
239+ end
240+ ## 处理活动类型
241+ update_active_type
242+ end
243+ #--------------------------------------------------------------------------
244+ # ● 获取画面 X 坐标
245+ #--------------------------------------------------------------------------
246+ def screen_x
247+ return ($game_map.adjust_x(@x) + 8007) / 8 - 1000 + 16
248+ end
249+ #--------------------------------------------------------------------------
250+ # ● 获取画面 Y 坐标
251+ #--------------------------------------------------------------------------
252+ def screen_y
253+ return ($game_map.adjust_y(@y) + 8007) / 8 - 1000 + 32
254+ end
255+ #--------------------------------------------------------------------------
256+ # ● 获取画面 Z 坐标
257+ #--------------------------------------------------------------------------
258+ def screen_z
259+ if @priority_type == 2
260+ return 200
261+ elsif @priority_type == 0
262+ return 60
263+ elsif @tile_id > 0
264+ pass = $game_map.passages[@tile_id]
265+ if pass & 0x10 == 0x10 # [☆]
266+ return 160
267+ else
268+ return 40
269+ end
270+ else
271+ return 100
272+ end
273+ end
274+end
275+
276+#==============================================================================
277+# □ Sprite_Firefly
278+#==============================================================================
279+class Sprite_Firefly < Sprite_Base
280+ #--------------------------------------------------------------------------
281+ # ○ 初始化对象
282+ # firefly : 萤火虫数据实例
283+ # viewport : 视区
284+ #--------------------------------------------------------------------------
285+ def initialize(firefly, viewport = nil)
286+ super(viewport)
287+ @firefly = firefly
288+ self.bitmap = Cache.system(@firefly.pic_name)
289+ ###self.bitmap = Cache.system('firefly_head') if @firefly.leader?
290+ self.ox = self.width/2
291+ self.oy = self.height/2
292+ self.z = @firefly.z
293+ update
294+ end
295+ #--------------------------------------------------------------------------
296+ # ○ 释放
297+ #--------------------------------------------------------------------------
298+ def dispose
299+ super
300+ end
301+ #--------------------------------------------------------------------------
302+ # ○ 更新
303+ #--------------------------------------------------------------------------
304+ def update
305+ super
306+ @firefly.update
307+ if @firefly.map_type?
308+ self.x = @firefly.screen_x
309+ self.y = @firefly.screen_y
310+ else
311+ self.x = @firefly.x
312+ self.y = @firefly.y
313+ end
314+ self.opacity = @firefly.opacity
315+ self.blend_type = @firefly.blend_type
316+ end
317+end
318+
319+#==============================================================================
320+# ■ Scene_Base
321+#==============================================================================
322+class Scene_Base
323+ #--------------------------------------------------------------------------
324+ # ○ 生成萤火虫
325+ # num :数量
326+ #--------------------------------------------------------------------------
327+ def fireflies(num)
328+ # 小等于零时释放
329+ dispose_firefly if num <= 0
330+ # 生成实例
331+ $game_fireflies = []
332+ for i in 0...num
333+ $game_fireflies << Game_Firefly.new(i)
334+ end
335+ # 生成sprite
336+ @firefly_sprites = []
337+ for i in $game_fireflies
338+ @firefly_sprites << Sprite_Firefly.new(i)
339+ end
340+ end
341+ #--------------------------------------------------------------------------
342+ # ○ 刷新萤火虫
343+ #--------------------------------------------------------------------------
344+ def update_firefly
345+ return if @firefly_sprites == nil
346+ for sprite in @firefly_sprites
347+ sprite.update
348+ end
349+ end
350+ #--------------------------------------------------------------------------
351+ # ○ 释放萤火虫
352+ #--------------------------------------------------------------------------
353+ def dispose_firefly
354+ return if @firefly_sprites == nil
355+ for sprite in @firefly_sprites
356+ sprite.dispose
357+ end
358+ @firefly_sprites = []
359+ end
360+ #--------------------------------------------------------------------------
361+ # ◎ 更新画面
362+ #--------------------------------------------------------------------------
363+ def update
364+ update_firefly
365+ end
366+ #--------------------------------------------------------------------------
367+ # ◎ 结束处理
368+ #--------------------------------------------------------------------------
369+ def terminate
370+ dispose_firefly
371+ end
372+end
--- /dev/null
+++ b/fscript/rpgvx/JumpSkill/1.1/JumpSkill.rb
@@ -0,0 +1,204 @@
1+#==============================================================================
2+# ■ [VX] 按键跳跃
3+# [VX] Jump Skill
4+#------------------------------------------------------------------------------
5+#   让角色拥有跳跃的能力,这个功能类似于《暗黑破坏神II》中野蛮人的技能。
6+# 这个脚本是友好的,在作者公开的白皮书下,你可以实现很多效果!
7+#
8+# 当玩家按下键时,主角就会执行跳跃,根据配置的不同,可以做出“跳跃技能”
9+# 为生活技能的效果。
10+#
11+#------------------------------------------------------------------------------
12+# 更新作者: DeathKing
13+# 许可协议: FSL
14+# 项目版本: 1.1.0107
15+# 最后更新: 2011-01-07
16+# 引用网址:
17+#------------------------------------------------------------------------------
18+# - 1.1.0107 By DeathKing
19+# * 整理配置模块;
20+# * 优化算法,使他运行更为流畅;
21+#
22+# - 1.0.0613 By DeathKing
23+# * 初始版本完成;
24+#
25+#==============================================================================
26+
27+#------------------------------------------------------------------------------
28+# ▼ 登记FSL
29+#------------------------------------------------------------------------------
30+$fscript = {} if $fscript == nil
31+$fscript["JumpSkill"] = "1.1.0107"
32+
33+#------------------------------------------------------------------------------
34+# ▼ 通用配置模块
35+#------------------------------------------------------------------------------
36+# 在游戏中你可以修改这些常量!
37+# 记得使用::解析域!
38+# FSL::JumpSkill::常量 = ***
39+#------------------------------------------------------------------------------
40+module FSL
41+ module JumpSkill
42+
43+ # 允许跳跃,当这个为false时则不允许跳跃
44+ JUMP_ALLOWED = true
45+ # 每次跳跃的距离
46+ JUMP_LENGTH = 2
47+ # 跳跃对应按键,可以配合全键盘脚本使用
48+ JUMP_BUTTON = Input::L
49+
50+ # 如果这个id不为0的话,只有在制定id的角色在
51+ # 队伍中且MP足够、会跳跃技能才可施放。
52+ # 如果JUMP_SKILL_ID为0,则指需要满足指定角色
53+ # 在队伍中
54+
55+ # 跳跃技能对应主角编号
56+ JUMP_ACTOR_ID = 0
57+ # 跳跃技能对应编号,一个开关属性,
58+ # 要求跳跃技能对应主角习得此技能才可跳跃
59+ JUMP_SKILL_ID = 0
60+ # 每次跳跃消耗的MP
61+ JUMP_COST_MP = 1
62+
63+ # 如果不想听见烦人的音乐,请让他等于一个空字符串
64+ # 一个SE文件示范:"Audio/SE/Jump1"
65+
66+ # 跳跃技能SE音效文件名(可跳跃的场合)
67+ JUMP_ABLE_SE = "" #"Audio/SE/Jump1"
68+ # 跳跃技能SE音效文件名(不可跳跃的场合)
69+ JUMP_DISABLE_SE = "" #"Audio/SE/Buzzer1"
70+
71+ end # JumpSkill
72+end # FSL
73+
74+#==============================================================================
75+# ■ Game_Player
76+#------------------------------------------------------------------------------
77+#  处理主角的类。事件启动的判定、以及地图的滚动等功能。
78+# 本类的实例请参考 $game_player。
79+#==============================================================================
80+
81+class Game_Player < Game_Character
82+
83+ include FSL::JumpSkill
84+
85+ alias jump_skill_update update
86+
87+ #---------------------------------------------------------------------------
88+ # ● 刷新画面
89+ #---------------------------------------------------------------------------
90+ def update
91+ jump_by_input
92+ jump_skill_update
93+ end
94+ #---------------------------------------------------------------------------
95+ # ● 是否按下跳跃键
96+ #---------------------------------------------------------------------------
97+ def jump_by_input
98+ # 判断是否按下了跳跃键
99+ return false unless Input.trigger?( JUMP_BUTTON )
100+ # 判断是否可跳跃
101+ if jumpable?
102+ # 是的话就执行跳跃
103+ # 播放跳跃SE
104+ Audio.se_play( JUMP_ABLE_SE ) if JUMP_ABLE_SE != ""
105+ # 扣除MP
106+ unless JUMP_ACTOR_ID == 0
107+ $game_actors[JUMP_ACTOR_ID].mp -= JUMP_COST_MP
108+ end
109+ # 执行跳跃
110+ sjump
111+ return true
112+ else
113+ # 否的话就播放无法跳跃的音效
114+ Audio.se_play( JUMP_DISABLE_SE ) if JUMP_DISABLE_SE != ""
115+ return false
116+ end
117+ end
118+ #---------------------------------------------------------------------------
119+ # ● 是否可跳跃
120+ #---------------------------------------------------------------------------
121+ # 此方法不会检查跳跃目的地是否可以通行,关于跳跃目的地是否可以通行,
122+ # 是由sjump方法完成的。
123+ #---------------------------------------------------------------------------
124+ def jumpable?
125+ # 不允许跳跃就返回false
126+ return false unless JUMP_ALLOWED
127+ jump_skill_actor = $game_actors[JUMP_ACTOR_ID]
128+ jump_skill = $data_skills[JUMP_SKILL_ID]
129+ # 获得主角是否有跳跃技能
130+ unless JUMP_ACTOR_ID == 0
131+ unless JUMP_SKILL_ID == 0
132+ # 如果角色不在队伍中就无法使用
133+ unless $game_party.members.include?( jump_skill_actor )
134+ return false
135+ else
136+ # 如果指定角色不会改技能就无法使用
137+ return false unless jump_skill_actor.skill_learn?( jump_skill )
138+ # 如果角色的MP不够就无法使用
139+ return false unless jump_skill_actor.mp >= JUMP_COST_MP
140+ return true
141+ end
142+ else
143+ return true
144+ end
145+ else
146+ return true
147+ end
148+ end
149+ #---------------------------------------------------------------------------
150+ # ● 超级跳跃
151+ # x_plus : X 座标增值
152+ # y_plus : Y 座标增值
153+ #---------------------------------------------------------------------------
154+ # 此跳跃可以搜寻跳跃能力内的最大跳跃限度,遗憾的是,这个只能搜寻一条
155+ # 直线。
156+ #---------------------------------------------------------------------------
157+ def sjump
158+ # 数据初始化
159+ x_plus = y_plus = 0
160+ # 获得主角朝向,使用逆推搜寻
161+ case @direction
162+ when 2
163+ JUMP_LENGTH.downto(1) do |i|
164+ if passable?( x , y + i )
165+ x_plus, y_plus = 0, i
166+ break
167+ end
168+ end
169+ when 4
170+ JUMP_LENGTH.downto(1) do |i|
171+ if passable?( x - i , y )
172+ x_plus, y_plus = -i, 0
173+ break
174+ end
175+ end
176+ when 6
177+ JUMP_LENGTH.downto(1) do |i|
178+ if passable?( x + i , y )
179+ x_plus, y_plus = i, 0
180+ break
181+ end
182+ end
183+ when 8
184+ JUMP_LENGTH.downto(1) do |i|
185+ if passable?( x , y - i )
186+ x_plus, y_plus = 0, -i
187+ break
188+ end
189+ end
190+ end # case @direction
191+ if x_plus.abs > y_plus.abs # 横向距离较大
192+ x_plus < 0 ? turn_left : turn_right
193+ elsif x_plus.abs > y_plus.abs # 纵向距离较大
194+ y_plus < 0 ? turn_up : turn_down
195+ end
196+ @x += x_plus
197+ @y += y_plus
198+ distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
199+ @jump_peak = 10 - @move_speed + distance
200+ @jump_count = @jump_peak * 2
201+ @stop_count = 0
202+ straighten
203+ end
204+end
--- /dev/null
+++ b/fscript/rpgvx/MapExpansion/1.3/MapExpansion.rb
@@ -0,0 +1,268 @@
1+#===============================================================================
2+# ■ VX 简易地图扩张
3+#-------------------------------------------------------------------------------
4+# 脚本说明及使用方法请参考“引用网址”
5+#-------------------------------------------------------------------------------
6+# 更新作者: 铃仙·优昙华院·因幡
7+# 许可协议: FSL -DNR
8+# 项目版本: 1.3.0614
9+# 引用网址: http://bbs.66rpg.com/thread-155105-1-1.html
10+#-------------------------------------------------------------------------------
11+# - 1.0.0828 By 铃仙·优昙华院·因幡
12+# * 更新内容: 1.基本脚本组件
13+#
14+# - 1.1.0829 By 铃仙·优昙华院·因幡
15+# * 更新内容: 1.添加 A系列模块替换功能
16+# 2.添加自动执行功能
17+#
18+# - 1.2.0913 By 铃仙·优昙华院·因幡
19+# * 更新内容: 1.优化脚本结构
20+# 2.添加动态修改B C D E中某图块通行度功能
21+# 3.添加动态修改针对某地图坐标的通行度功能
22+# 4.附赠送查看地图图块ID脚本插件,详细请查阅《图块ID查看》
23+#
24+# - 1.3.0614 By 铃仙·优昙华院·因幡
25+# * 更新内容: 1.修正在多次切换同一张地图后,出现图块读取错误的 BUG
26+# 2.优化整体甲苯结构
27+# 3.优化使用方法
28+#===============================================================================
29+
30+$fscript = {} if $fscript == nil
31+$fscript["MapExpansion"] = "1.3.0614"
32+
33+#==============================================================================
34+# ■ reisen_module
35+#------------------------------------------------------------------------------
36+#  配置模块
37+#==============================================================================
38+
39+module FSL
40+ module ReisenMapExpansion
41+
42+ ALL_MAP = "A1A2A3A4A5BCDE"
43+ A_MAP = "A1A2A3A4A5"
44+ NOT_A_MAP = "BCDE"
45+
46+ # 地图自动切换设定
47+ MAP_DATA = {
48+ # 地图ID => 方案
49+ 2 => 2,
50+ }
51+
52+ CAN = 0x06
53+ NOT_CAN = 0x0f
54+ HIGH = 0x16
55+
56+ # 单块地图通行设定
57+ MAP_TILE_ID_PASSAGE = {
58+ # [地图ID,x,y] => [通行度]
59+ [ 1, 5, 5] => [NOT_CAN],
60+ }
61+ end
62+
63+ module Timap_id
64+ TIMAPID = ["TileA1", "TileA2", "TileA3", "TileA4", "TileA5", "TileB",
65+ "TileC", "TileD", "TileE"]
66+ end
67+
68+end
69+
70+#==============================================================================
71+# ■ Game_Map
72+#------------------------------------------------------------------------------
73+#  处理地图的类。包含卷动以及可以通行的判断功能。本类的实例请参考 $game_map 。
74+#==============================================================================
75+
76+class Game_Map
77+ #--------------------------------------------------------------------------
78+ # ● 定义实例变量
79+ #--------------------------------------------------------------------------
80+ attr_accessor :game_timap_need_refresh
81+ attr_reader :game_timap_id
82+ CAN = FSL::ReisenMapExpansion::CAN
83+ NOT_CAN = FSL::ReisenMapExpansion::NOT_CAN
84+ HIGH = FSL::ReisenMapExpansion::HIGH
85+ #--------------------------------------------------------------------------
86+ # ● 初始化对像
87+ #--------------------------------------------------------------------------
88+ alias reisen_map_expansion_initialize initialize
89+ def initialize
90+ @game_timap_id = nil
91+ @game_timap_need_refresh = false
92+ @map_tile_xy_passage = FSL::ReisenMapExpansion::MAP_TILE_ID_PASSAGE
93+ reisen_map_expansion_initialize
94+ end
95+ #--------------------------------------------------------------------------
96+ # ● 可以通行判定
97+ # x : X 坐标
98+ # y : Y 坐标
99+ # flag : 通行度标志(非交通工具时,一般为 0x01)
100+ #--------------------------------------------------------------------------
101+ alias reisen_map_expansion_passable? passable?
102+ def passable?(x, y, flag = 0x01)
103+ return false if @map_tile_xy_passage[[@map_id, x, y]] == [NOT_CAN]
104+ reisen_map_expansion_passable?(x, y, flag)
105+ end
106+ #--------------------------------------------------------------------------
107+ # ● 设置
108+ # map_id : 地图 ID
109+ #--------------------------------------------------------------------------
110+ alias reisen_map_expansion_setup setup
111+ def setup(map_id)
112+ reisen_map_expansion_setup(map_id)
113+ if FSL::ReisenMapExpansion::MAP_DATA[map_id] != nil
114+ reisen_map_data = FSL::ReisenMapExpansion::MAP_DATA[map_id]
115+ change_tilemap(reisen_map_data)
116+ end
117+ end
118+ #--------------------------------------------------------------------------
119+ # ● 设置单个坐标通行度
120+ #--------------------------------------------------------------------------
121+ def set_tile_id_passages(map_id, x, y, flag)
122+ @map_tile_xy_passage[[map_id, x, y]] = flag
123+ end
124+ #--------------------------------------------------------------------------
125+ # ● 获取通行度
126+ #--------------------------------------------------------------------------
127+ def get_passages
128+ unless @game_timap_id
129+ @passages = $data_system.passages
130+ else
131+ @passages = (load_data("Data/System_#{@game_timap_id}.rvdata")).passages
132+ end
133+ end
134+ #--------------------------------------------------------------------------
135+ # ● 刷新
136+ #--------------------------------------------------------------------------
137+ def refresh
138+ if @map_id > 0
139+ get_passages
140+ for event in @events.values
141+ event.refresh
142+ end
143+ for common_event in @common_events.values
144+ common_event.refresh
145+ end
146+ end
147+ @need_refresh = false
148+ end
149+ #--------------------------------------------------------------------------
150+ # ● 更改单个地图元件通行度
151+ #--------------------------------------------------------------------------
152+ def chang_tile_passage(tile_id, flag)
153+ if tile_id <= 2000
154+ @passages[tile_id] = flag
155+ end
156+ end
157+ #--------------------------------------------------------------------------
158+ # ● 更改地图元件与通行度
159+ #--------------------------------------------------------------------------
160+ def change_tilemap(index)
161+ if $scene.is_a?(Scene_Map)
162+ @game_timap_id = index
163+ get_passages
164+ @game_timap_need_refresh = true
165+ end
166+ end
167+end
168+
169+#==============================================================================
170+# ■ Spriteset_Map
171+#------------------------------------------------------------------------------
172+#  处理地图画面活动块和元件的类。本类在 Scene_Map 类的内部使用。
173+#==============================================================================
174+
175+class Spriteset_Map
176+ #--------------------------------------------------------------------------
177+ # ● 生成地图元件
178+ #--------------------------------------------------------------------------
179+ def create_tilemap
180+ @tilemap = Tilemap.new(@viewport1)
181+ @titlemap_name = []
182+ load_tilemap
183+ end
184+ #--------------------------------------------------------------------------
185+ # ● 加载 原件
186+ #--------------------------------------------------------------------------
187+ def load_tilemap
188+ (0..8).each do |i|
189+ filename = "#{FSL::Timap_id::TIMAPID[i]}_#{$game_map.game_timap_id}"
190+ if @titlemap_name[i] != filename
191+ if FileTest.exist?("Graphics/System/" + filename + ".png")
192+ @tilemap.bitmaps[i].dispose if @tilemap.bitmaps[i]
193+ @tilemap.bitmaps[i] = Cache.system(filename)
194+ @titlemap_name[i] = filename
195+ else
196+ @tilemap.bitmaps[i].dispose if @tilemap.bitmaps[i]
197+ @tilemap.bitmaps[i] = Cache.system(FSL::Timap_id::TIMAPID[i])
198+ @titlemap_name[i] = FSL::Timap_id::TIMAPID[i] + "_"
199+ end
200+ end
201+ end
202+ @tilemap.map_data = $game_map.data
203+ @tilemap.passages = $game_map.passages
204+ end
205+ #--------------------------------------------------------------------------
206+ # ● 更新地图元件
207+ #--------------------------------------------------------------------------
208+ alias reisen_update_tilemap update_tilemap
209+ def update_tilemap
210+ if $game_map.game_timap_need_refresh
211+ load_tilemap
212+ $game_map.game_timap_need_refresh = false
213+ end
214+ reisen_update_tilemap
215+ end
216+ #--------------------------------------------------------------------------
217+ # ● 更改地图元件
218+ #--------------------------------------------------------------------------
219+ def change_tilemap
220+ load_tilemap
221+ end
222+end
223+#==============================================================================
224+# ■ Scene_Map
225+#------------------------------------------------------------------------------
226+#  处理地图画面的类。
227+#==============================================================================
228+
229+class Scene_Map < Scene_Base
230+ #--------------------------------------------------------------------------
231+ # ● 定义实例变量
232+ #--------------------------------------------------------------------------
233+ attr_accessor :spriteset
234+end
235+
236+#==============================================================================
237+# ■ Game_Interpreter
238+#------------------------------------------------------------------------------
239+#  执行事件命令的解释器。本类在 Game_Map 类、Game_Troop 类、与
240+# Game_Event 类的内部使用。
241+#==============================================================================
242+
243+class Game_Interpreter
244+ #--------------------------------------------------------------------------
245+ # ● 常量
246+ #--------------------------------------------------------------------------
247+ CAN = FSL::ReisenMapExpansion::CAN
248+ NOT_CAN = FSL::ReisenMapExpansion::NOT_CAN
249+ HIGH = FSL::ReisenMapExpansion::HIGH
250+ #--------------------------------------------------------------------------
251+ # ● 更改单个地图元件通行度
252+ #--------------------------------------------------------------------------
253+ def chang_tile_passage(tile_id, flag)
254+ $game_map.chang_tile_passage(tile_id, flag)
255+ end
256+ #--------------------------------------------------------------------------
257+ # ● 切换地图元件与通行度
258+ #--------------------------------------------------------------------------
259+ def change_tilemap(index)
260+ $game_map.change_tilemap(index)
261+ end
262+ #--------------------------------------------------------------------------
263+ # ● 设置单个坐标通行度
264+ #--------------------------------------------------------------------------
265+ def set_id_passages(map_id, x, y, flag)
266+ $game_map.set_tile_id_passages(map_id, x, y, flag)
267+ end
268+end
--- /dev/null
+++ b/fscript/rpgvx/SkillNeedItem/1.6/SkillNeedItem.rb
@@ -0,0 +1,355 @@
1+#=============================================================================
2+# ■ [VX] 技能消耗物品
3+# [VX] Skill Need Item
4+#-----------------------------------------------------------------------------
5+# 设定一些值,当拥有制定物品的制定个数及以上时才可发动特技。发动特技会
6+# 消耗掉这些物品。
7+#
8+# 在技能的“注释”中如下书写(请确保使用的是西文半角而不是全角):
9+# <need_item 物品id,对应数量 物品id,对应数量 …… >
10+# <need_item 1,1 2,2 3,3>
11+#
12+#-----------------------------------------------------------------------------
13+# 更新作者: DeathKing 六祈
14+# 许可协议: FSL -NOS ADK
15+# 项目版本: 1.6.0108
16+# 最后更新: 2011-01-08
17+# 引用网址:
18+#-----------------------------------------------------------------------------
19+# - 1.6.0108 By DeathKing
20+# * 修正了有的角色无法释放技能的BUG;
21+# * 修正了窗体的Z坐标,使他始终置于最上;
22+# * 添加了RPG::UsabeItem::Skill#item_reqire方法,使得可以快速
23+# 获取道具的要求列表,这样脚本运行更为快速;
24+#
25+# - 1.5.0726 By DeathKing
26+# * 修正了按下PageDown和PageUp后无法切换角色的小BUG;
27+#
28+# - 1.4.0725 By 六祈
29+# * 修正了Game_Actor.skill_can_use?方法的错误;
30+# * 修正了Window_SNItem.skill_can_use?方法的错误;
31+# * 添加了对技能是否可使用的重新判定;
32+#
33+# - 1.3.0719 By DeathKing
34+# * ADK的升级,可兼容沉影不器的读取装备注释脚本;
35+#
36+# - 1.2.0714 By DeathKing
37+# * 修改了消耗物品的算法;
38+#
39+# - 1.1.0607 By DeathKing
40+# * 改变了设置方法;
41+#
42+# - 1.0.0529 By DeathKing
43+# * 初始版本完成;
44+#
45+#=============================================================================
46+
47+#-----------------------------------------------------------------------------
48+# ▼ 登记FSL
49+#-----------------------------------------------------------------------------
50+$fscript = {} if $fscript == nil
51+$fscript["SkillNeedItem"] = "1.6.0108"
52+
53+#-----------------------------------------------------------------------------
54+# ▼ 检查依赖
55+#-----------------------------------------------------------------------------
56+if $fscript["ADK"].to_s <= "1.2"
57+ miss = "增强开发包(ADK)"
58+ version = "1.2"
59+ print "缺少#{miss},请下载或放在本脚本之前,并确保其版本不低于#{version}。"
60+end
61+
62+#-----------------------------------------------------------------------------
63+# ▼ 通用配置模块
64+#-----------------------------------------------------------------------------
65+module FSL
66+ module SNItem
67+
68+ # 改进后的技能消耗物品可以对物品是否足够做出判断了,不过我我们依然
69+ # 不能让他很清楚的现实在物品提示中
70+
71+ # (用于提示所需物品数量的)窗口的相关配置,一般不修改
72+ WINDOW_X = 272 # X 544 / 2
73+ WINDOW_Y = 112 # Y 56 * 2
74+ WINDOW_W = 274 # 宽
75+ WINDOW_H = 640 # 高
76+ BACK_OPACITY = 200 # 透明度,255为不透明
77+
78+
79+ TEXT_NEED = "需要:" # “需要:”一词的字符
80+ TEXT_NEED_X = WINDOW_X - 104 # “需要:”字符的 X 坐标
81+ TEXT_ITEM_NUM_X = WINDOW_X - 52 # 物品数量的 X 坐标
82+
83+ end
84+end
85+
86+#==============================================================================
87+# ■ RPG::UsabeItem::Skill
88+#------------------------------------------------------------------------------
89+#   管理技能的类。
90+#==============================================================================
91+module RPG
92+ class Skill < UsableItem
93+ def item_require
94+ # 如果已定义@item_require就直接结束
95+ return @item_require if (defined? @item_require)
96+ # 获得操作数
97+ items = self.read_notes["need_item"]
98+ # 产生一个哈希
99+ @item_require = {}
100+ # 如果获得的操作数为空
101+ return @item_require if items == nil
102+ # 生成物品的需求列表
103+ items.each do |e|
104+ t = e.split(",")
105+ @item_require[t[0].to_i] = t[1].to_i
106+ end
107+ # 返回物品的需求列表
108+ return @item_require
109+ end
110+ end
111+end
112+
113+#==============================================================================
114+# ■ Window_SNItem
115+#------------------------------------------------------------------------------
116+#   需要的物品的窗口。
117+#==============================================================================
118+
119+class Window_SNItem < Window_Base
120+
121+ include FSL::SNItem
122+
123+ #--------------------------------------------------------------------------
124+ # ● 初始化对像
125+ # x : 窗口 X 座标
126+ # y : 窗口 Y 座标
127+ # width : 窗口宽度
128+ # height : 窗口高度
129+ #--------------------------------------------------------------------------
130+ def initialize(x=WINDOW_X, y=WINDOW_Y, width=WINDOW_W, height=WINDOW_H)
131+ super(x, y, width, height)
132+ self.back_opacity = BACK_OPACITY
133+ self.visible = false
134+ self.z = 9999
135+ end
136+ #--------------------------------------------------------------------------
137+ # ● 判定技能可否使用(需要的物品是否满足)
138+ # skill : 技能
139+ #
140+ # 在Game_Actor#skill_can_use?方法中调用时可传递self.index给第二个参数
141+ #--------------------------------------------------------------------------
142+ def self.skill_can_use?(skill,actor_id)
143+ # 如果传递过来的skill为空
144+ return false if skill == nil
145+ # 读取need_item项的参数
146+ item_need = skill.item_require
147+ # need_item参数为空的话返回true
148+ return true if item_need.empty?
149+ # 产生一个队伍物品的哈希克隆(item_id => number)
150+ party_items = {}
151+ $game_party.items.each do |it|
152+ party_items[it.id] = $game_party.item_number(it)
153+ end
154+ # 如果是第一个行动的角色或者不在战斗中则跳过
155+ unless actor_id == 0 or $game_temp.in_battle == false
156+ # 计算到前一个角色技能消耗为止的剩余物品数量哈希
157+ 0.upto( actor_id - 1 ) do |ai|
158+ action = $game_party.members[ai].action
159+ next if action.kind != 1
160+ temp_cost = $data_skills[action.skill_id].item_require
161+ next if temp_cost.empty?
162+ temp_cost.each do |key, value|
163+ party_items[key] -= value
164+ end
165+ end
166+ end
167+ # 判定剩余物品是否足够使用技能
168+ item_need.each do |key, value|
169+ return false unless party_items.has_key?(key)
170+ return false if (party_items[key] < value)
171+ end
172+ return true
173+ end
174+ #--------------------------------------------------------------------------
175+ # ● 刷新窗口
176+ # skill : 技能
177+ # index : 技能在技能窗口的索引,用来判定本
178+ # 窗口应该显示在左边还是右边
179+ #--------------------------------------------------------------------------
180+ def refresh( skill, index = 0)
181+ # 清除之前产生的位图
182+ self.contents.clear
183+ # 如果skill为空就返回false
184+ return false if skill == nil
185+ # 先让需要窗口不可见
186+ self.visible = false
187+ # 读取参数
188+ need_item = skill.item_require
189+ # 如果参数为空,就将其隐藏并返回false
190+ return false if need_item.empty?
191+ # 判定索引以决定窗口位置
192+ self.x = index % 2 == 0 ? WINDOW_X : 0
193+ # 改变窗口大小
194+ self.height = need_item.size * 24 + 32
195+ # 将窗口置为可见
196+ self.visible = true
197+ create_contents
198+ # 遍历用参数
199+ i = 0
200+ # 遍历参数列表
201+ need_item.each do |key, value|
202+ # 生成物品
203+ item = $data_items[key]
204+ # 判定物品是否足够
205+ enabled = $game_party.item_number(item) >= value ? true : false
206+ # 绘制文字
207+ draw_item_name(item, 0, WLH * i, enabled)
208+ self.contents.font.color.alpha = enabled ? 255 : 128
209+ self.contents.draw_text(TEXT_NEED_X, WLH * i, 96, WLH, TEXT_NEED)
210+ self.contents.draw_text(TEXT_ITEM_NUM_X, WLH * i, 32, WLH, value)
211+ i += 1
212+ end # need_item.each
213+ end
214+ #--------------------------------------------------------------------------
215+ # ● 执行对物品消耗
216+ # skill : 技能
217+ #--------------------------------------------------------------------------
218+ def self.exec_cost( skill )
219+ # 传递错误就直接返回false
220+ return false if skill == nil
221+ # 读取need_item项的参数
222+ need_item = skill.item_require#read_notes["need_item"]
223+ # 如果参数为空就直接返回
224+ return true if need_item.empty?
225+ need_item.each do |key, value|
226+ $game_party.gain_item($data_items[key], -value)
227+ end
228+ end
229+
230+end # Window_SNItem
231+
232+#==============================================================================
233+# ■ Game_Actor
234+#------------------------------------------------------------------------------
235+#   处理角色的类。本类在 Game_Actors 类 ($game_actors) 的内部使用、
236+# Game_Party 类请参考 ($game_party) 。
237+#==============================================================================
238+
239+class Game_Actor
240+
241+ alias snitem_skill_can_use? skill_can_use?
242+
243+ #--------------------------------------------------------------------------
244+ # ● 可用技能判断
245+ # skill : 技能
246+ #--------------------------------------------------------------------------
247+ def skill_can_use?(skill)
248+ return false unless Window_SNItem.skill_can_use?(skill, self.index)
249+ snitem_skill_can_use?(skill)
250+ end
251+end
252+
253+#==============================================================================
254+# ■ Scene_Skill
255+#------------------------------------------------------------------------------
256+#   处理特技画面的类。
257+#==============================================================================
258+
259+class Scene_Skill < Scene_Base
260+
261+ alias snitem_initialize initialize
262+ alias snitem_terminate terminate
263+ alias snitem_update update
264+ alias snitem_use_skill_nontarget use_skill_nontarget
265+
266+ #--------------------------------------------------------------------------
267+ # ● 初始化对像
268+ # actor_index : 角色位置
269+ #--------------------------------------------------------------------------
270+ def initialize( actor_index = 0, equip_index = 0 )
271+ snitem_initialize( actor_index, equip_index )
272+ @snitem_window = Window_SNItem.new
273+ end
274+ #--------------------------------------------------------------------------
275+ # ● 结束处理
276+ #--------------------------------------------------------------------------
277+ def terminate
278+ snitem_terminate
279+ @snitem_window.dispose
280+ end
281+ #--------------------------------------------------------------------------
282+ # ● 更新画面
283+ #--------------------------------------------------------------------------
284+ def update
285+ snitem_update
286+ @snitem_window.refresh( @skill_window.skill, @skill_window.index )
287+ end
288+
289+ #--------------------------------------------------------------------------
290+ # ● 非同伴目标使用物品
291+ #--------------------------------------------------------------------------
292+ def use_skill_nontarget
293+ # 执行对物品的消耗
294+ Window_SNItem.exec_cost(@skill)
295+ # 调用原方法
296+ snitem_use_skill_nontarget
297+ end
298+
299+end # Scene_Skill
300+
301+#==============================================================================
302+# ■ Scene_Battle
303+#------------------------------------------------------------------------------
304+#   处理战斗画面的类。
305+#=============================================================================
306+
307+class Scene_Battle < Scene_Base
308+
309+ include FSL::SNItem
310+
311+ alias snitem_update_skill_selection update_skill_selection
312+ alias snitem_start_skill_selection start_skill_selection
313+ alias snitem_end_skill_selection end_skill_selection
314+ alias snitem_execute_action_skill execute_action_skill
315+
316+ #--------------------------------------------------------------------------
317+ # ● 开始技能选择
318+ #--------------------------------------------------------------------------
319+ def start_skill_selection
320+ snitem_start_skill_selection
321+ # 创建需要道具窗口,并把y坐标上移
322+ @snitem_window = Window_SNItem.new(272,56)
323+ end
324+ #--------------------------------------------------------------------------
325+ # ● 结束技能选择
326+ #--------------------------------------------------------------------------
327+ def end_skill_selection
328+ if @skill_window != nil
329+ @snitem_window.dispose
330+ @snitem_window = nil
331+ end
332+ snitem_end_skill_selection
333+ end
334+ #--------------------------------------------------------------------------
335+ # ● 更新技能选择
336+ #--------------------------------------------------------------------------
337+ def update_skill_selection
338+ # 刷新技能
339+ @snitem_window.refresh( @skill_window.skill, @skill_window.index )
340+ # 调用原方法内容
341+ snitem_update_skill_selection
342+ end
343+ #--------------------------------------------------------------------------
344+ # ● 执行战斗行动:使用技能
345+ #--------------------------------------------------------------------------
346+ def execute_action_skill
347+ # 执行原内容
348+ snitem_execute_action_skill
349+ # 生成skill
350+ skill = @active_battler.action.skill
351+ Window_SNItem.exec_cost( skill )
352+ end
353+
354+end # Scene_Battle
355+
--- /dev/null
+++ b/fscript/rpgvx/WindowSlide/1.1/WindowSlide.rb
@@ -0,0 +1,92 @@
1+
2+#==============================================================================
3+# [VX] 窗口滑动
4+# [VX] WindowSlide
5+#----------------------------------------------------------------------------
6+# 使用说明:
7+# 创建窗口之后,可以使用调整窗口的座标,并且将窗口滑动到指定位置。
8+# 可用于制作华丽菜单显示效果
9+# * 窗口.in(方向[, 移动距离])
10+# 方向可以为 2(下), 4(左), 6(右), 8(上)
11+# 移动距离默认为 10
12+# 将窗口滑动至画面外。
13+#
14+# * 窗口.out(方向[, 移动距离])
15+# 方向可以为 2(下), 4(左), 6(右), 8(上)
16+# 移动距离默认为 10
17+# 将窗口由画面外滑动至原位。
18+#
19+# * 窗口.move_to(目标 X 座标, 目标 Y 座标[, 移动距离])
20+# 移动距离默认为 10
21+# 将窗口滑动至指定座标。
22+#----------------------------------------------------------------------------
23+# 更新作者: 雪流星(Snstar2006)
24+# 许可协议: FSL
25+# 项目版本: 1.1.0121
26+#----------------------------------------------------------------------------
27+# - 1.1.0121 By 雪流星(Snstar2006)
28+# * 修改算法,省去计算根号的步骤,稍微提高效率
29+# - 1.0.0121 By 雪流星(Snstar2006)
30+# * 初版
31+#==============================================================================
32+$fscript = {} if $fscript == nil
33+$fscript["WindowSlide"] = "1.1.0121"
34+
35+class Window_Base < Window
36+ alias move_window_initialize initialize
37+ def initialize(x, y, width, height)
38+ move_window_initialize(x, y, width, height)
39+ @permanent_x = x
40+ @permanent_y = y
41+ end
42+ def in(direction, step=10)
43+ case direction
44+ when 2
45+ move_to(self.x, -self.height, step)
46+ when 4
47+ move_to(-self.width, self.y, step)
48+ when 6
49+ move_to(Graphics.width + self.width, self.y, step)
50+ when 8
51+ move_to(self.x, Graphics.height + self.height, step)
52+ end
53+ Graphics.wait(1)
54+ end
55+ def out(direction, step=10)
56+ case direction
57+ when 2, 8
58+ move_to(self.x, @permanent_y, step)
59+ when 4, 6
60+ move_to(@permanent_x, self.y, step)
61+ end
62+ end
63+ def move_to(dest_x, dest_y, move_step=10)
64+ dx = dest_x - self.x
65+ dy = dest_y - self.y
66+ if dx == 0
67+ dy_step = move_step
68+ dx_step = 0
69+ elsif dy == 0
70+ dx_step = move_step
71+ dy_step = 0
72+ else
73+ max_distance_sq = dx**2+dy**2
74+ angle = Math.atan(dy.abs/dx.abs)
75+ dy_step = move_step*Math.sin(angle)
76+ dx_step = max_distance_sq - dy_step**2
77+ end
78+ while (self.x != dest_x || self.y != dest_y)
79+ if dx > 0
80+ self.x = [self.x + dx_step, dest_x].min
81+ else
82+ self.x = [self.x - dx_step, dest_x].max
83+ end
84+ if dy > 0
85+ self.y = [self.y + dy_step, dest_x].min
86+ else
87+ self.y = [self.y - dy_step, dest_x].max
88+ end
89+ Graphics.wait(1)
90+ end
91+ end
92+end
--- /dev/null
+++ b/fscript/rpgxp/HangupEradication/1.2/HangupEradication.rb
@@ -0,0 +1,148 @@
1+
2+#==============================================================================
3+# ■ Hangup 异常根除
4+# Hangup Exception Eradication
5+#----------------------------------------------------------------------------
6+#
7+# Hangup 异常是 RMXP 底层引擎内置的一个异常类,游戏进程会在 Graphics.update
8+# 没有调用超过 10 秒时抛出这个异常。这个脚本使用了 Windows API 暴力地解除
9+# 了这个限制。
10+# 使用方法:Hangup 异常根除脚本必须插入到脚本编辑器的最顶端,所有脚本之前,无
11+# 例外。
12+#
13+#----------------------------------------------------------------------------
14+#
15+# 更新作者: 紫苏
16+# 许可协议: FSL -MEE
17+# 项目版本: 1.2.0827
18+# 引用网址:
19+# http://bbs.66rpg.com/forum.php?mod=viewthread&tid=134316
20+# http://szsu.wordpress.com/2010/08/09/hangup_eradication
21+#
22+#----------------------------------------------------------------------------
23+#
24+# - 1.2.0827 By 紫苏
25+# * 更改了配置模块名
26+# * 更改了 FSL 注释信息
27+#
28+# - 1.2.0805 By 紫苏
29+# * 脚本开始遵循 FSL
30+# * 全局范围内改变了脚本结构
31+#
32+# - 1.1.1101 By 紫苏
33+# * 修正了脚本在 Windows XP 平台下失效的问题
34+#
35+# - 1.0.0927 By 紫苏
36+# * 初始版本完成
37+#
38+#==============================================================================
39+
40+$__jmp_here.call if $__jmp_here
41+
42+#----------------------------------------------------------------------------
43+# ● 登记 FSL。
44+#----------------------------------------------------------------------------
45+$fscript = {} if !$fscript
46+$fscript['HangupEradication'] = '1.2.0827'
47+
48+#==============================================================================
49+# ■ FSL
50+#------------------------------------------------------------------------------
51+#  自由RGSS脚本通用公开协议的功能模块。
52+#==============================================================================
53+
54+module FSL
55+ module HangupEradication
56+ #------------------------------------------------------------------------
57+ # ● 定义需要的 Windows API。
58+ #------------------------------------------------------------------------
59+ OpenThread = Win32API.new('kernel32', 'OpenThread', 'LIL', 'L')
60+ CloseHandle = Win32API.new('kernel32', 'CloseHandle', 'L', 'I')
61+ Thread32Next = Win32API.new('kernel32', 'Thread32Next', 'LP', 'I')
62+ ResumeThread = Win32API.new('kernel32', 'ResumeThread', 'L', 'L')
63+ SuspendThread = Win32API.new('kernel32', 'SuspendThread', 'L', 'L')
64+ Thread32First = Win32API.new('kernel32', 'Thread32First', 'LP', 'I')
65+ GetCurrentProcessId = Win32API.new('kernel32', 'GetCurrentProcessId', 'V', 'L')
66+ CreateToolhelp32Snapshot = Win32API.new('kernel32', 'CreateToolhelp32Snapshot', 'LL', 'L')
67+ end
68+end
69+
70+#==============================================================================
71+# ■ HangupEradication
72+#------------------------------------------------------------------------------
73+#  处理根除 Hangup 异常的类。
74+#==============================================================================
75+
76+class HangupEradication
77+ include FSL::HangupEradication
78+ #--------------------------------------------------------------------------
79+ # ● 初始化对像。
80+ #--------------------------------------------------------------------------
81+ def initialize
82+ @hSnapShot = CreateToolhelp32Snapshot.call(4, 0)
83+ @hLastThread = OpenThread.call(2, 0, self.getLastThreadId)
84+ #@hLastThread = OpenThread.call(2097151, 0, threadID)
85+ ObjectSpace.define_finalizer(self, self.method(:finalize))
86+ end
87+ #--------------------------------------------------------------------------
88+ # ● 获取当前进程创建的最后一个线程的标识。
89+ #--------------------------------------------------------------------------
90+ def getLastThreadId
91+ threadEntry = [28, 0, 0, 0, 0, 0, 0].pack("L*")
92+ threadId = 0 # 线程标识
93+ found = Thread32First.call(@hSnapShot, threadEntry) # 准备枚举线程
94+ while found != 0
95+ arrThreadEntry = threadEntry.unpack("L*") # 线程数据解包
96+ if arrThreadEntry[3] == GetCurrentProcessId.call # 匹配进程标识
97+ threadId = arrThreadEntry[2] # 记录线程标识
98+ end
99+ found = Thread32Next.call(@hSnapShot, threadEntry) # 下一个线程
100+ end
101+ return threadId
102+ end
103+ #--------------------------------------------------------------------------
104+ # ● 根除 Hangup 异常。
105+ # 2 : “暂停和恢复线程访问权限”代码;
106+ # 2097151 : “所有可能的访问权限”代码(Windows XP 平台下无效)。
107+ #--------------------------------------------------------------------------
108+ def eradicate
109+ SuspendThread.call(@hLastThread)
110+ end
111+ #--------------------------------------------------------------------------
112+ # ● 恢复 Hangup 异常。
113+ #--------------------------------------------------------------------------
114+ def resume
115+ while ResumeThread.call(@hLastThread) > 1; end # 恢复最后一个线程
116+ end
117+ #--------------------------------------------------------------------------
118+ # ● 最终化对像。
119+ #--------------------------------------------------------------------------
120+ def finalize
121+ CloseHandle.call(@hSnapShot)
122+ CloseHandle.call(@hLastThread)
123+ end
124+end
125+
126+hangupEradication = HangupEradication.new
127+hangupEradication.eradicate
128+
129+callcc { |$__jmp_here| } # F12 后的跳转标记
130+
131+#==============================================================================
132+# ■ 游戏主过程
133+#------------------------------------------------------------------------------
134+#  游戏脚本的解释从这个外壳开始。
135+#==============================================================================
136+
137+for subscript in 1...$RGSS_SCRIPTS.size
138+ begin
139+ eval(Zlib::Inflate.inflate($RGSS_SCRIPTS[subscript][2]))
140+ rescue Exception => ex
141+ # 异常发生并抛出给解释器时恢复线程。
142+ hangupEradication.resume unless defined?(Reset) and ex.class == Reset
143+ raise ex
144+ end
145+end
146+
147+hangupEradication.resume
148+exit
--- /dev/null
+++ b/fscript/rpgxp/LabelWindow/1.1/LabelWindow.rb
@@ -0,0 +1,144 @@
1+#===============================================================================
2+# ■ 标签窗体
3+# LabelWindow
4+#-------------------------------------------------------------------------------
5+# 提供给脚本开发者,一个用于创建图文结合的标签窗体的脚本。
6+#
7+# * 使用方法:
8+# obj = Window_Lable.new(x, y, w, h, text, icon)
9+#
10+# * 注意事项
11+# ① 字体属性一旦被改变就会刷新;
12+# ② 字体属性的 setter 不负责检查参数。
13+#-------------------------------------------------------------------------------
14+# 更新作者: DeathKing
15+# 许可协议: FSL
16+# 项目版本: 1.1.1211
17+# 引用网址:
18+#-------------------------------------------------------------------------------
19+# - 1.1.1211 By DeathKing
20+# * 修正了 font_name= 方法的错误;
21+#
22+# - 1.0.1031 By DeathKing
23+# * 初版;
24+#
25+#===============================================================================
26+$fscript = {} if $fscript == nil
27+$fscript["LabelWindow"] = "1.1.1211"
28+
29+#-------------------------------------------------------------------------------
30+# ▼ 通用配置模块
31+#-------------------------------------------------------------------------------
32+
33+module FSL
34+ module LabelWindow
35+ DEFAULT_FONT = "黑体"
36+ DEFAULT_SIZE = 22
37+ DEFAULT_COLOR = Color.new(255, 255, 255, 255)
38+ DEFAULT_ITALIC = false
39+ DEFAULT_BOLD = false
40+ end
41+end
42+
43+#==============================================================================
44+# ■ Window_Label
45+#------------------------------------------------------------------------------
46+#  用于创造一个类似于标签的窗口
47+#==============================================================================
48+
49+class Window_Label < Window_Base
50+
51+ include FSL::LabelWindow
52+
53+ WLH = 32
54+
55+ attr_reader :x, :y, :w, :h, :text, :icon
56+ attr_reader :italic, :bold, :font_name, :color, :size
57+
58+ #--------------------------------------------------------------------------
59+ # ● 初始化对象
60+ # x : 窗体的x坐标
61+ # y : 窗体的y坐标
62+ # w : 窗体的宽度
63+ # h : 窗体的高度
64+ # text : 标签文本
65+ # icon : 存放在icons文件夹下的图标文件名
66+ #--------------------------------------------------------------------------
67+ def initialize(x,y,w,h,text,icon="")
68+ # 为实变量赋值
69+ @x,@y,@w,@h,@text,@icon = x,y,w,h,text,icon
70+ super(x,y,w,h)
71+ # 创建窗体
72+ self.contents = Bitmap.new(width - 32, height - 32)
73+ # 设置字体属性
74+ self.contents.font.name = DEFAULT_FONT
75+ self.contents.font.size = DEFAULT_SIZE
76+ self.contents.font.color = DEFAULT_COLOR
77+ self.contents.font.bold = DEFAULT_BOLD
78+ self.contents.font.italic = DEFAULT_ITALIC
79+ # 刷新内容
80+ refresh
81+ end
82+ #--------------------------------------------------------------------------
83+ # ● 刷新
84+ #--------------------------------------------------------------------------
85+ def refresh
86+ # 清除以前创造的位图
87+ self.contents.clear
88+ # 初始化坐标
89+ x,y = 0,0
90+ # 如果指定了图标
91+ if @icon != ""
92+ rect = Rect.new(x, y, 32, 32)
93+ self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
94+ bitmap = RPG::Cache.icon(@icon)
95+ opacity = self.contents.font.color == normal_color ? 255 : 128
96+ self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
97+ x = 32
98+ end
99+ # 绘制文本
100+ self.contents.draw_text(x,y,@text.size*32,WLH,@text)
101+ end #refresh
102+ #--------------------------------------------------------------------------
103+ # ● 一旦标签文本改变就刷新
104+ #--------------------------------------------------------------------------
105+ def text=(value)
106+ @text = value
107+ refresh
108+ end
109+ #--------------------------------------------------------------------------
110+ # ● 一旦被指定为斜体就刷新
111+ #--------------------------------------------------------------------------
112+ def italic=(value)
113+ self.contents.font.italic = value
114+ refresh
115+ end
116+ #--------------------------------------------------------------------------
117+ # ● 一旦被指定为粗体就刷新
118+ #--------------------------------------------------------------------------
119+ def bold=(value)
120+ self.contents.font.bold = value
121+ refresh
122+ end
123+ #--------------------------------------------------------------------------
124+ # ● 一旦修改了字体名称就刷新
125+ #--------------------------------------------------------------------------
126+ def font_name=(value)
127+ self.contents.font.name = value
128+ refresh
129+ end
130+ #--------------------------------------------------------------------------
131+ # ● 一旦修改了字体大小就刷新
132+ #--------------------------------------------------------------------------
133+ def size=(value)
134+ self.contents.font.size = value
135+ refresh
136+ end
137+ #--------------------------------------------------------------------------
138+ # ● 一旦修改了字体颜色就刷新
139+ #--------------------------------------------------------------------------
140+ def color=(value)
141+ self.contents.font.color = value
142+ refresh
143+ end
144+end