赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 79 |
经验 | 15725 |
最后登录 | 2024-11-30 |
在线时间 | 1349 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7852
- 在线时间
- 1349 小时
- 注册时间
- 2015-8-15
- 帖子
- 754
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 金芒芒 于 2024-6-16 09:37 编辑
s1.....s10文本和index x,y= $出战=[115,320]
$出战=[135,300]
$出战=[155,320]
$出战=[175,300]
$出战=[175,340]
$出战=[215,420]
$出战=[135,440]
$出战=[155,460]
$出战=[175,440]
$出战=[215,460]
class Scene_Menu #-------------------------------------------------------------------------- # ● 初始化对像 # menu_index : 命令光标的初期位置 #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main # 生成命令窗口 s1 = $spawn s2 = $spawn2 s3 = $spawn3 s4 = $spawn4 s5 = $spawn5 s6 = $spawn6 s7 = $spawn7 s8 = $spawn8 s9 = $spawn9 s10 = $spawn10 @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7,s8,s9,s10]) @command_window.index = @menu_index # 同伴人数为 0 的情况下 # 执行过渡 Graphics.transition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 Input.update # 刷新画面 update # 如果切换画面就中断循环 if $scene != self break #中断 end end # 准备过渡 Graphics.freeze # 释放窗口 @command_window.dispose # @playtime_window.dispose # @steps_window.dispose # @gold_window.dispose # @status_window.dispose end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @command_window.update # 命令窗口被激活的情况下: 调用 update_command if @command_window.active update_command return end end #-------------------------------------------------------------------------- # ● 刷新画面 (命令窗口被激活的情况下) #-------------------------------------------------------------------------- def update_command # 按下 B 键的情况下 if Input.trigger?(Input::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 切换的地图画面 $scene = Scene_menu2.new return end # 按下 C 键的情况下 if Input.trigger?(Input::C) # 同伴人数为 0、存档、游戏结束以外的场合 if $game_party.actors.size == 0 and @command_window.index < 4 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 命令窗口的光标位置分支 case @command_window.index when 0 # 出战布阵点1 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到物品画面 $出战=[115,320] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 115 @buzhen_spawn.y = 320 when 1 # 出战布阵点2 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 $出战=[135,300] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 135 @buzhen_spawn.y = 300 when 2 # 出战布阵点3 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 $出战=[155,320] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 155 @buzhen_spawn.y = 320 when 3 # 出战布阵点4 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 $出战=[175,300] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 135 @buzhen_spawn.y = 300 when 4 # 出战布阵点5 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 $出战=[175,340] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 175 @buzhen_spawn.y = 340 when 5 # 出战布阵点6 $出战=[215,420] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 215 @buzhen_spawn.y = 420 when 6 # 出战布阵点7 $出战=[135,440] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 135 @buzhen_spawn.y = 440 when 7 # 出战布阵点8 $出战=[155,460] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 217 @buzhen_spawn.y = 460 when 5 # 出战布阵点9 $出战=[175,440] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 218 @buzhen_spawn.y = 423 when 5 # 出战布阵点10 $出战=[215,460] @buzhen_spawn = Sprite.new @buzhen_spawn.bitmap = RPG::Cache.title("title-base-light") @buzhen_spawn.x = 219 end return end end #-------------------------------------------------------------------------- # ● 刷新画面 (状态窗口被激活的情况下) #-------------------------------------------------------------------------- def update_status # 按下 B 键的情况下 if Input.trigger?(Input::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 激活命令窗口 @command_window.active = true return end # 按下 C 键的情况下 if Input.trigger?(Input::C) # 命令窗口的光标位置分支 case @command_window.index when 1 # 特技 # 本角色的行动限制在 2 以上的情况下 if $game_party.actors[@status_window.index].restriction >= 2 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到特技画面 $scene = Scene_Skill.new(@status_window.index) when 2 # 装备 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换的装备画面 $scene = Scene_Equip.new(@status_window.index) when 3 # 状态 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到状态画面 $scene = Scene_Status.new(@status_window.index) end return end end end
class Scene_Menu
#--------------------------------------------------------------------------
# ● 初始化对像
# menu_index : 命令光标的初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s1 = $spawn
s2 = $spawn2
s3 = $spawn3
s4 = $spawn4
s5 = $spawn5
s6 = $spawn6
s7 = $spawn7
s8 = $spawn8
s9 = $spawn9
s10 = $spawn10
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7,s8,s9,s10])
@command_window.index = @menu_index
# 同伴人数为 0 的情况下
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break #中断
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command_window.dispose
# @playtime_window.dispose
# @steps_window.dispose
# @gold_window.dispose
# @status_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@command_window.update
# 命令窗口被激活的情况下: 调用 update_command
if @command_window.active
update_command
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (命令窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_menu2.new
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 同伴人数为 0、存档、游戏结束以外的场合
if $game_party.actors.size == 0 and @command_window.index < 4
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 命令窗口的光标位置分支
case @command_window.index
when 0 # 出战布阵点1
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到物品画面
$出战=[115,320]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 115
@buzhen_spawn.y = 320
when 1 # 出战布阵点2
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
$出战=[135,300]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 135
@buzhen_spawn.y = 300
when 2 # 出战布阵点3
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
$出战=[155,320]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 155
@buzhen_spawn.y = 320
when 3 # 出战布阵点4
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
$出战=[175,300]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 135
@buzhen_spawn.y = 300
when 4 # 出战布阵点5
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
$出战=[175,340]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 175
@buzhen_spawn.y = 340
when 5 # 出战布阵点6
$出战=[215,420]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 215
@buzhen_spawn.y = 420
when 6 # 出战布阵点7
$出战=[135,440]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 135
@buzhen_spawn.y = 440
when 7 # 出战布阵点8
$出战=[155,460]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 217
@buzhen_spawn.y = 460
when 5 # 出战布阵点9
$出战=[175,440]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 218
@buzhen_spawn.y = 423
when 5 # 出战布阵点10
$出战=[215,460]
@buzhen_spawn = Sprite.new
@buzhen_spawn.bitmap = RPG::Cache.title("title-base-light")
@buzhen_spawn.x = 219
end
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (状态窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_status
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 激活命令窗口
@command_window.active = true
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置分支
case @command_window.index
when 1 # 特技
# 本角色的行动限制在 2 以上的情况下
if $game_party.actors[@status_window.index].restriction >= 2
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到特技画面
$scene = Scene_Skill.new(@status_window.index)
when 2 # 装备
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换的装备画面
$scene = Scene_Equip.new(@status_window.index)
when 3 # 状态
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到状态画面
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
# ———————————————————————————————————— # 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息 # ———————————————————————————————————— #============================================================================== # 选项动态加强 # 作者:carol3 #============================================================================== # ■ Window_Command #------------------------------------------------------------------------------ # 一般的命令选择行窗口。 #============================================================================== class Window_Command < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 # width : 窗口的宽 # commands : 命令字符串序列 #-------------------------------------------------------------------------- def initialize(width, commands) # 由命令的个数计算出窗口的高 super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) @item = [] self.index = 0 refresh @oldindex = 0 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max if i != self.index draw_item_dis(i) else draw_item_active(i,@item[i]) end end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 # color : 文字色 #-------------------------------------------------------------------------- def draw_item_dis(index) self.contents.font.size -= 2 self.contents.font.color = disabled_color # rect = Rect.new(4+16, 32 * index, self.contents.width - 24, 32) self.contents.fill_rect(rect, Color.new(0, 255, 255, 255)) self.contents.draw_text(rect, @commands[index]) self.contents.font.size += 2 end def draw_item_active(index, type) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index]) if type==1 self.contents.font.color = disabled_color else self.contents.font.color = Color.new(255,238,17,255) end self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index]) end #-------------------------------------------------------------------------- # ● 项目无效化 # index : 项目编号 #-------------------------------------------------------------------------- def disable_item(index) @item[index] = 1 end #-------------------------------------------------------------------------- # ● 刷新方法更新 #-------------------------------------------------------------------------- def update super #——这里使用的刷新方法比直接refresh节约很多内存 if self.index != @oldindex @oldindex = self.index refresh end end end
# ————————————————————————————————————
# 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
# ————————————————————————————————————
#==============================================================================
# 选项动态加强
# 作者:carol3
#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
# 一般的命令选择行窗口。
#==============================================================================
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# width : 窗口的宽
# commands : 命令字符串序列
#--------------------------------------------------------------------------
def initialize(width, commands)
# 由命令的个数计算出窗口的高
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
@item = []
self.index = 0
refresh
@oldindex = 0
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i != self.index
draw_item_dis(i)
else
draw_item_active(i,@item[i])
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
# color : 文字色
#--------------------------------------------------------------------------
def draw_item_dis(index)
self.contents.font.size -= 2
self.contents.font.color = disabled_color #
rect = Rect.new(4+16, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect, Color.new(0, 255, 255, 255))
self.contents.draw_text(rect, @commands[index])
self.contents.font.size += 2
end
def draw_item_active(index, type)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
if type==1
self.contents.font.color = disabled_color
else
self.contents.font.color = Color.new(255,238,17,255)
end
self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index])
end
#--------------------------------------------------------------------------
# ● 项目无效化
# index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
@item[index] = 1
end
#--------------------------------------------------------------------------
# ● 刷新方法更新
#--------------------------------------------------------------------------
def update
super
#——这里使用的刷新方法比直接refresh节约很多内存
if self.index != @oldindex
@oldindex = self.index
refresh
end
end
end
|
|