#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#===============================================================
# ■ Scene_Fei
#------------------------------------------------------------------------------
# 处理传送画面的类。
#===============================================================
class Window_Money < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 415, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 640, 32, "不够钱,不能传送", 0)
end
end
class Window_No < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 415, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 640, 32, "未探索的地方不能传送", 0)
end
end
class Scene_Fei
#include OPACITY_66RPG
#--------------------------------------------------------------------------
# ● 初始化对像
# menu_index : 命令光标的初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
#create_screen
# 生成命令窗口
s1 = "村1 费用:1000金币"
s2 = "村2 费用:1000金币"
s3 = "村3 费用:1000金币"
s4 = "村4 费用:1000金币"
s5 = "村5 费用:2000金币"
s6 = "村6 费用:3000金币"
s7 = "村7 费用:3000金币"
s8 = "村8 费用:5000金币"
s9 = "村9 费用:5000金币"
s10 = "村10 费用:5000金币" # 如果有更多的地图在这里添加按钮.
@command_window = Window_Command.new(320, [s1, s2, s3, s4, s5, s6,s7,s8,s9,s10]) #对应上面
@command_window.index = @menu_index
# 生成不够钱窗口
@money_window = Window_Money.new
@money_window.visible = false
# 生面未探索窗口
@no_window = Window_No.new
@no_window.visible = false
# 生成金钱窗口
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 352
@gold_window.width = 320
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command_window.dispose
@money_window.dispose
@no_window.dispose
@gold_window.dispose
#dispose_screen
end
#--------------------------------------------------------------------------
# ● 传送
#--------------------------------------------------------------------------
def Fei_item(id,money,mapid,x,y)
@id = id
[url=home.php?mod=space&uid=26101]@Money[/url] = money
@mapid = mapid
@x = x
@y = y
if $game_switches[@id] == true #如果觉得开关保贵那就把这句换成 $game_variables[编号] == 数值
if $game_party.gold > @money
$game_system.se_play($data_system.decision_se)
$game_party.gain_gold(-@money)
$game_map.setup(@mapid)
$game_player.moveto(@x,@y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
@money_window.visible = true
@command_window.active = false
end
else
$game_system.se_play($data_system.buzzer_se)
@no_window.visible = true
@command_window.active = false
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@command_window.update
@gold_window.update
# 命令窗口被激活的情况下: 调用 update_command
if @command_window.active
update_command
return
end
if @money_window.visible
update_money
return
end
if @no_window.visible
update_no
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (命令窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_Map.new
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置分支
case @command_window.index
when 0
Fei_item(51,100000,32,9,30) #这里就是传送的函数调用 Fei_item(开关,钱,地图ID,X坐标,Y坐标)
when 1
Fei_item(52,1000,32,9,30)
when 2
Fei_item(53,1000,32,9,30)
when 3
Fei_item(54,1000,32,9,30)
when 4
Fei_item(55,1000,32,9,30)
when 5
Fei_item(56,1000,32,9,30)
when 6
Fei_item(57,1000,32,9,30)
when 7
Fei_item(58,1000,32,9,30)
when 8
Fei_item(59,1000,32,9,30)
when 9
Fei_item(60,1000,32,9,30) #如果上面添加多了按钮,这里也得添加. 相应复制就可以了.
end
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update_money
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@money_window.visible = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.cancel_se)
@money_window.visible = false
@command_window.active = true
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update_no
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@no_window.visible = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.cancel_se)
@no_window.visible = false
@command_window.active = true
return
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================