赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 8411 |
最后登录 | 2023-12-8 |
在线时间 | 85 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 90
- 在线时间
- 85 小时
- 注册时间
- 2012-5-27
- 帖子
- 148
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 退屈£无聊 于 2012-7-2 08:55 编辑
- ################################################################################
- # 《超级命令窗口》
- # 说句实话,我一直在考虑做不做这个脚本,因为这个脚本跟菜单真的很像,最后
- #还是做了!既然做了,那就来稍微讲一讲特点吧!这是一款完全教学脚本,可以用了自己
- #做参考学习,我在下面的每一个脚本都进行了详细的讲解,如果你要改,你可以很清楚的
- #知道改哪里!所以在这我就不说使用方法了,因为我实在是太累了!~~
- #
- #
- # 制作人;STUPID ANT 制作组;STUPID PIG
- #
- ###############################################################################
- ##########################《使用声明》#########################################
- #本脚本由STUPID PIG工作室自行研制,其制作权归本工作室所有,当然大家可以尽情的
- #使用,但是所有的备注都不能删除,呵呵~~就算你加密,我们也不怕,很轻松就能看到!
- #在使用过程中如果有什么漏洞或新的想法,可以联系我们,QQ;1660618519
- #当然,我不经常在线,所以你们还可以打我手机;13977375101
- #祝你们做游戏愉快!~~~~
- ################################################################################
- #-------------------------------------------------------------------------------
- # 《电子书脚本》
- #其主要用途就是用来介绍怪物、我方、建设和地图,当然也可以做养成RPG的每月杂志!
- #制作者;STUPID ANT
- #QQ;1660618519
- ###############################################################################
- ##########################《使用说明》#########################################
- #本脚本由STUPID PIG工作室自行研制,其制作权归本工作室所有,当然大家可以尽情的
- #使用,但是所有的备注都不能删除,呵呵~~就算你加密,我们也不怕,很轻松就能看到!
- #在使用过程中如果有什么漏洞或新的想法,可以联系我们,QQ;1660618519
- #当然,我不经常在线,所以你们还可以打我手机;13977375101
- #祝你们做游戏愉快!~~~~
- #########################《使用方法》##########################################
- #在地图中建立一个事件,在事件编辑中,添加脚本,写上$scene = Scene_Book.new,就可以打开
- #如果想添加更多的页码,请在30行、31行、98行进行编辑!
- #-------------------------------------------------------------------------------
- class Scene_Book
- ############################################################################
- ####################《第一部分的总处理》####################################
- ############################################################################
- def main #主要的处理
- #---------《封面处理》-------------------------------------
- @sprite = Sprite.new #生成新的图片
- @sprite.bitmap = RPG::Cache.title("封面" ) #这里你可以更改。
- #-----------《页码选择处理;中级》--------------------------
- s1 = "第一页"#这里你可以改名称
- s2 = "第二页"#这里你可以改名称
- s3 = "第三页"#这里你可以改名称
- s4 = "第四页"#这里你可以改名称
- #你可以再加S5、S6、S7等,不过下面的也有两处要跟着改
- @command_window = Window_Command.new(192, [s1, s2, s3, s4])
- #上面的 @command_window当你加了S5、S6等时,要改的第一处,加[s1, s2, s3, s4,s5,s6],写多少加多少!!
- @command_window.back_opacity = 255#透明度
- @command_window.x = 320 - @command_window.width / 2#x坐标
- @command_window.y = 288#y坐标
- @command_window.visible = false #一开始页码状态为关闭状态
- @command_window.active = false #一开始页码状态为关闭状态
- #----------《音乐处理》-------------------------------------
- Audio.se_play("Audio/BGM/001_色は匂へど散りぬるを.mp3") #这里是处理音乐的,可以更改!
- #----------《显示的图片位置处理》---------------------------
- @sprite.x = (640 - @sprite.bitmap.width) / 2 #这是X坐标
- @sprite.y = (480 - @sprite.bitmap.height) / 2 #这是Y坐标
- #----------《图片的主处理》---------------------------------
- @sprite.opacity = 255 #透明度,255为不透明,0是完全透明。
- #----------《必要的场景处理》-------------------------------
- Graphics.transition # 执行过渡
- loop do # 主循环
- Graphics.update # 刷新游戏画面
- Input.update # 刷新输入信息
- update # 刷新画面
- if $scene != self # 如果画面被切换就中断循环
- break
- end
- end
- #-------------《过渡及图片释放的必要处理》------------------
- Graphics.freeze # 准备过渡
- @sprite.bitmap.dispose #释放图形
- @sprite.dispose #释放图形处理
- @command_window.dispose #释放窗口
- end
- ############################################################################
- ####################《第二部分;刷新》######################################
- ############################################################################
- def update #刷新
- #------------------《页码窗口的终极处理》--------------------
- if Input.trigger?(Input::A) #当按下Shift键时发生以下事件
- @update_phase = 2
- Audio.se_play("Audio/SE/028-Door05") #播放SE
- @command_window.visible = true #页码窗口打开
- @command_window.active = true #正式打开
- end
- @command_window.update #窗口刷新
- @command_window.update #窗口刷新
- if Input.trigger?(Input::B) #当按下ESC键时发生以下事件
- $game_system.se_play($data_system.cancel_se) #播放系统SE
- @command_window.visible = false #窗口关闭
- @command_window.active = false #窗口关闭
- @update_phase = 1
- @command_window.index = 0 #窗口的计数回到0
- end
- if Input.trigger?(Input::C) #当按下ESC键时发生以下事件
- case @command_window.index #这个我也说不清~~
- when 0 #选择S1
- $game_system.se_play($data_system.cancel_se)#播放选择系统SE
- @sprite.bitmap.clear #清除所有图片
- @sprite = Sprite.new #显示新的图片
- @sprite.bitmap = RPG::Cache.title("1" ) #图片名称
- @command_window.visible = false #窗口关闭
- @command_window.active = false #窗口关闭
- @update_phase = 3
- when 1
- #这里你就自己写
- when 2
- #这里你就自己写
- when 3
- #这里你就自己写
- #when
- #当你改了S1、S2那些东西时,这里就是要改的第二处,看到when了吗?
- #你加了的话就再加一个when,减就减一个when!~~
- end
-
- end
- #-----------------------《退出电子书的处理》------------------------
- if Input.trigger?(Input::L) #当按下Q键时就发生以下事件
- Graphics.freeze #图片过渡
- Graphics.transition(20) #过渡时间
- Audio.se_stop #所有音乐停止
- $scene = Scene_Map.new #返回地图
- end
- end
- end
- ##############################################################################
- #STUPID PIG工作室,里面的人不是笨猪,而是一群充满梦想的年轻人!~~~~
- ##############################################################################
- #==============================================================================
- # ■ Scene_Map*新
- #------------------------------------------------------------------------------
- # 稍微改了一下,就是在地图中按下F5打开《超级命令窗口》!~~~
- #==============================================================================
- class Scene_Map #这是一个场景的建立!
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- #-------------------《生成的主处理》---------------------------------------
- @spriteset = Spriteset_Map.new # 生成活动块,这个你不需要知道!因为它在Spriteset_Map里
- @message_window = Window_Message.new# 生成谈话窗口,当触发谈话事件时才会打开!
- #-------------------《过渡的处理》-----------------------------------------
- Graphics.transition# 执行过渡
- loop do # 主循环
- Graphics.update# 刷新游戏画面
- Input.update# 刷新输入信息
- update # 刷新画面
- if $scene != self # 如果画面切换的话就中断循环
- break
- end
- end
- Graphics.freeze# 准备过渡
- #----------------------《释放的处理》-------------------------------------
- @spriteset.dispose# 释放活动块
- @message_window.dispose# 释放信息窗口
- if $scene.is_a?(Scene_Title)# 标题画面切换中的情况下
- Graphics.transition# 淡入淡出画面
- Graphics.freeze
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update #变量(刷新)
- #-----------------《在地图中按键的处理》-----------------------------------
- if Input.press?(Input::F5) #当按下F5时,就打开《超级命令窗口》
- $scene = Scene_High.new #场景转换的意思,因为《超级命令窗口》是Scene_High!
- end
- if Input.trigger?(Input::B) #当按下Esc时打开菜单!
- unless $game_system.map_interpreter.running? or #不是在事件执行中或菜单禁止中
- $game_system.menu_disabled
- # 设置菜单调用标志以及 SE 演奏
- $game_temp.menu_calling = true
- $game_temp.menu_beep = true
- end
- end
-
- if $DEBUG and Input.press?(Input::F9) # 调试模式为 ON 并且按下 F9 键的情况就打开调试画面!~~
- $game_temp.debug_calling = true # 设置调用调试标志
- end
- #----------《循环处理;简洁类》----------------------------------------------
- loop do # 循环
- # 按照地图、实例、主角的顺序刷新
- # (本更新顺序不会在满足事件的执行条件下成为给予角色瞬间移动
- # 的机会的重要因素)
- #-----------《刷新处理》-----------------------------------------------------
- $game_map.update
- $game_system.map_interpreter.update
- $game_player.update
- $game_system.update
- $game_screen.update
- unless $game_temp.player_transferring # 如果主角在场所移动中就中断循环
- break
- end
- transfer_player# 执行场所移动
- if $game_temp.transition_processing# 处理过渡中的情况下、中断循环
- break
- end
- end
- # 刷新活动块
- @spriteset.update
- # 刷新信息窗口
- @message_window.update
- # 游戏结束的情况下
- if $game_temp.gameover
- # 切换的游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 返回标题画面的情况下
- if $game_temp.to_title
- # 切换到标题画面
- $scene = Scene_Title.new
- return
- end
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除过渡处理中标志
- $game_temp.transition_processing = false
- # 执行过渡
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- # 显示信息窗口中的情况下
- if $game_temp.message_window_showing
- return
- end
- # 遇敌计数为 0 且、且遇敌列表不为空的情况下
- if $game_player.encounter_count == 0 and $game_map.encounter_list != []
- # 不是在事件执行中或者禁止遇敌中
- unless $game_system.map_interpreter.running? or
- $game_system.encounter_disabled
- # 确定队伍
- n = rand($game_map.encounter_list.size)
- troop_id = $game_map.encounter_list[n]
- # 队伍有效的话
- if $data_troops[troop_id] != nil
- # 设置调用战斗标志
- $game_temp.battle_calling = true
- $game_temp.battle_troop_id = troop_id
- $game_temp.battle_can_escape = true
- $game_temp.battle_can_lose = false
- $game_temp.battle_proc = nil
- end
- end
- end
-
-
- # 不在主角移动中的情况下
- unless $game_player.moving?
- # 执行各种画面的调用
- if $game_temp.battle_calling
- call_battle
- elsif $game_temp.shop_calling
- call_shop
- elsif $game_temp.name_calling
- call_name
- elsif $game_temp.menu_calling
- call_menu
- elsif $game_temp.save_calling
- call_save
- elsif $game_temp.debug_calling
- call_debug
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 调用战斗
- #--------------------------------------------------------------------------
- def call_battle
- # 清除战斗调用标志
- $game_temp.battle_calling = false
- # 清除菜单调用标志
- $game_temp.menu_calling = false
- $game_temp.menu_beep = false
- # 生成遇敌计数
- $game_player.make_encounter_count
- # 记忆地图 BGM 、停止 BGM
- $game_temp.map_bgm = $game_system.playing_bgm
- $game_system.bgm_stop
- # 演奏战斗开始 SE
- $game_system.se_play($data_system.battle_start_se)
- # 演奏战斗 BGM
- $game_system.bgm_play($game_system.battle_bgm)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到战斗画面
- $scene = Scene_Battle.new
- end
- #--------------------------------------------------------------------------
- # ● 调用商店
- #--------------------------------------------------------------------------
- def call_shop
- # 清除商店调用标志
- $game_temp.shop_calling = false
- # 矫正主角姿势
- $game_player.straighten
- # 切换到商店画面
- $scene = Scene_Shop.new
- end
- #--------------------------------------------------------------------------
- # ● 调用名称输入
- #--------------------------------------------------------------------------
- def call_name
- # 清除调用名称输入标志
- $game_temp.name_calling = false
- # 矫正主角姿势
- $game_player.straighten
- # 切换到名称输入画面
- $scene = Scene_Name.new
- end
- #--------------------------------------------------------------------------
- # ● 调用菜单
- #--------------------------------------------------------------------------
- def call_menu
- # 清除菜单调用标志
- $game_temp.menu_calling = false
- # 已经设置了菜单 SE 演奏标志的情况下
- if $game_temp.menu_beep
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 清除菜单演奏 SE 标志
- $game_temp.menu_beep = false
- end
- # 矫正主角姿势
- $game_player.straighten
- # 切换到菜单画面
- $scene = Scene_Menu.new
- end
- #--------------------------------------------------------------------------
- # ● 调用存档
- #--------------------------------------------------------------------------
- def call_save
- # 矫正主角姿势
- $game_player.straighten
- # 切换到存档画面
- $scene = Scene_Save.new
- end
- #--------------------------------------------------------------------------
- # ● 调用调试
- #--------------------------------------------------------------------------
- def call_debug
- # 清除调用调试标志
- $game_temp.debug_calling = false
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到调试画面
- $scene = Scene_Debug.new
- end
- #--------------------------------------------------------------------------
- # ● 主角的场所移动
- #--------------------------------------------------------------------------
- def transfer_player
- # 清除主角场所移动调试标志
- $game_temp.player_transferring = false
- # 移动目标与现在的地图有差异的情况下
- if $game_map.map_id != $game_temp.player_new_map_id
- # 设置新地图
- $game_map.setup($game_temp.player_new_map_id)
- end
- # 设置主角位置
- $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
- # 设置主角朝向
- case $game_temp.player_new_direction
- when 2 # 下
- $game_player.turn_down
- when 4 # 左
- $game_player.turn_left
- when 6 # 右
- $game_player.turn_right
- when 8 # 上
- $game_player.turn_up
- end
- # 矫正主角姿势
- $game_player.straighten
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 在生成活动块
- @spriteset.dispose
- @spriteset = Spriteset_Map.new
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除过渡处理中标志
- $game_temp.transition_processing = false
- # 执行过渡
- Graphics.transition(20)
- end
- # 执行地图设置的 BGM、BGS 的自动切换
- $game_map.autoplay
- # 设置画面
- Graphics.frame_reset
- # 刷新输入信息
- Input.update
- end
- end
- #==============================================================================
- # ■ Window_PlayTime*新
- #------------------------------------------------------------------------------
- # 新的游戏时间窗口,其实就是改了下宽,因为下面要用到!~~~~~
- #==============================================================================
- class Window_PlayTime < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 240, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, "所玩游戏时间")
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, text, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- #==============================================================================
- # ■ Window_Steps
- #------------------------------------------------------------------------------
- # 菜单画面显示步数的窗口。
- #==============================================================================
- class Window_Steps < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 240, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, "总的行走步数")
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2)
- end
- end
- #==============================================================================
- # ■ Window_Gold
- #------------------------------------------------------------------------------
- # 显示金钱的窗口。
- #==============================================================================
- class Window_Gold < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 240, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- cx = contents.text_size($data_system.words.gold).width
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
- end
- end
- class Scene_High
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # 第一项 : 命令光标的初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- def main
- s1 = "打开加点处理面板"
- s2 = "打开专用猎人导书"
- s3 = "打开二号存档画面"
- s4 = "打开二号读档画面"
- s5 = "去往猎人之家地图"
- s6 = "打开结束游戏窗口"
- @command_window = Window_Command.new(240, [s1, s2, s3, s4, s5, s6])
- @command_window.index = @menu_index
-
- @sprite = Sprite.new
- @sprite.bitmap = RPG::Cache.title("介绍.png" )
- @sprite.x = 200
- @sprite.y = 0
- # 生成游戏时间窗口
- @playtime_window = Window_PlayTime.new
- @playtime_window.x = 0
- @playtime_window.y = 224
- # 生成步数窗口
- @steps_window = Window_Steps.new
- @steps_window.x = 0
- @steps_window.y = 320
- # 生成金钱窗口
- @gold_window = Window_Gold.new
- @gold_window.x = 0
- @gold_window.y = 416
- # 透明度(0为完全透明)
- @sprite.opacity = 255
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面被切换就中断循环
- if $scene != self
- break
- end
- end
- # 装备过渡
- Graphics.freeze
- # 释放标题图形
- @sprite.bitmap.dispose
- @sprite.dispose
- @command_window.dispose
- @playtime_window.dispose
- @steps_window.dispose
- @gold_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- @playtime_window.update
- @steps_window.update
- @gold_window.update
- # 命令窗口被激活的情况下: 调用 update_command
- if @command_window.active
- update_command
- return
- end
- # 状态窗口被激活的情况下: 调用 update_status
- if @status_window.active
- update_status
- 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)
- # 同伴人数为 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
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_Lvup.new
- when 1
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_Book.new
- when 2
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_Save2.new
- when 3
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_Load2.new
- when 4
- $game_system.se_play($data_system.buzzer_se)
- $game_map.setup(6)
- # 主角向初期位置移动
- a = rand(20)
- b = rand(15)
- $game_player.moveto(a, b)
- # 刷新主角
- $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- $game_map.autoplay
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 切换地图画面
- $scene = Scene_Map.new
- when 5 # 游戏结束
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到游戏结束画面
- $scene = Scene_End.new
- end
- return
- end
- end
- end
-
- #==============================================================================
- # ■ Scene_Save
- #------------------------------------------------------------------------------
- # 处理存档画面的类。
- #==============================================================================
- class Scene_Save2 < Scene_File
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super("要保存到这个文件吗?")
- end
- #--------------------------------------------------------------------------
- # ● 确定时的处理
- #--------------------------------------------------------------------------
- def on_decision(filename)
- # 演奏存档 SE
- $game_system.se_play($data_system.save_se)
- # 写入存档数据
- file = File.open(filename, "wb")
- write_save_data(file)
- file.close
- # 如果被事件调用
- if $game_temp.save_calling
- # 清除存档调用标志
- $game_temp.save_calling = false
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- # 切换到菜单画面
- $scene = Scene_High.new(3)
- end
- #--------------------------------------------------------------------------
- # ● 取消时的处理
- #--------------------------------------------------------------------------
- def on_cancel
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 如果被事件调用
- if $game_temp.save_calling
- # 清除存档调用标志
- $game_temp.save_calling = false
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- # 切换到菜单画面
- $scene = Scene_High.new(3)
- end
- #--------------------------------------------------------------------------
- # ● 写入存档数据
- # file : 写入用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def write_save_data(file)
- # 生成描绘存档文件用的角色图形
- characters = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- # 写入描绘存档文件用的角色数据
- Marshal.dump(characters, file)
- # 写入测量游戏时间用画面计数
- Marshal.dump(Graphics.frame_count, file)
- # 增加 1 次存档次数
- $game_system.save_count += 1
- # 保存魔法编号
- # (将编辑器保存的值以随机值替换)
- $game_system.magic_number = $data_system.magic_number
- # 写入各种游戏对像
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- end
- end
- #==============================================================================
- # ■ Scene_Load
- #------------------------------------------------------------------------------
- # 处理读档画面的类。
- #==============================================================================
- class Scene_Load2 < Scene_File
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- # 再生成临时对像
- $game_temp = Game_Temp.new
- # 选择存档时间最新的文件
- $game_temp.last_file_index = 0
- latest_time = Time.at(0)
- for i in 0..3
- filename = make_filename(i)
- if FileTest.exist?(filename)
- file = File.open(filename, "r")
- if file.mtime > latest_time
- latest_time = file.mtime
- $game_temp.last_file_index = i
- end
- file.close
- end
- end
- super("要载入哪个文件?")
- end
- #--------------------------------------------------------------------------
- # ● 确定时的处理
- #--------------------------------------------------------------------------
- def on_decision(filename)
- # 文件不存在的情况下
- unless FileTest.exist?(filename)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏读档 SE
- $game_system.se_play($data_system.load_se)
- # 写入存档数据
- file = File.open(filename, "rb")
- read_save_data(file)
- file.close
- # 还原 BGM、BGS
- $game_system.bgm_play($game_system.playing_bgm)
- $game_system.bgs_play($game_system.playing_bgs)
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 切换到地图画面
- $scene = Scene_Map.new
- end
- #--------------------------------------------------------------------------
- # ● 取消时的处理
- #--------------------------------------------------------------------------
- def on_cancel
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到标题画面
- $scene = Scene_High.new
- end
- #--------------------------------------------------------------------------
- # ● 读取存档数据
- # file : 读取用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def read_save_data(file)
- # 读取描绘存档文件用的角色数据
- characters = Marshal.load(file)
- # 读取测量游戏时间用画面计数
- Graphics.frame_count = Marshal.load(file)
- # 读取各种游戏对像
- $game_system = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_screen = Marshal.load(file)
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Marshal.load(file)
- $game_map = Marshal.load(file)
- $game_player = Marshal.load(file)
- # 魔法编号与保存时有差异的情况下
- # (加入编辑器的编辑过的数据)
- if $game_system.magic_number != $data_system.magic_number
- # 重新装载地图
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- # 刷新同伴成员
- $game_party.refresh
- end
- end
- #==============================================================================
- #菜单人物行走的处理
- # 初级篇
- #==============================================================================
- WALK_REFRESH_FRAME_SPEED = 10 # 刷新的速度,越大越慢~~~··
- #==============================================================================
- # Window_Base
- #==============================================================================
- class Window_Base < Window
- #《初始化的定义》---------------------------------------------------------------
- alias initialize_walk initialize
- def initialize(x, y, width, height)
- initialize_walk(x, y, width, height)
- @start_walk = false
- @turn_index = 0
- @turn_phase = 0
- end
- #--------------------------------------------------------------------------
- # 角色行走图
- # actor : 角色
- # x : 描绘的 X 坐标
- # y : 描绘的 Y 坐标
- #--------------------------------------------------------------------------
- def draw_walk_actor_graphic(actor, x, y)
- bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
- cw = bitmap.width / 4
- ch = bitmap.height / 4
- @start_turn = true
- case @turn_phase
- when 0
- x_x = 0
- when 1
- x_x = cw
- when 2
- x_x = cw * 2
- when 3
- x_x = cw * 3
- end
- src_rect = Rect.new(x_x, 0, cw, ch)
- self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
- end
- #--------------------------------------------------------------------------
- # 角色转向图
- # actor : 角色
- # x : 描绘的 X 坐标
- # y : 描绘的 Y 坐标
- #--------------------------------------------------------------------------
- def draw_turn_actor_graphic(actor, x, y)
- bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
- cw = bitmap.width / 4
- ch = bitmap.height / 4
- @start_turn = true
- case @turn_phase
- when 0
- x_x = 0
- when 1
- x_x = ch
- when 2
- x_x = ch * 3
- when 3
- x_x = ch * 2
- end
- src_rect = Rect.new(0, x_x, cw, ch)
- self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
- end
- #--------------------------------------------------------------------------
- # 更新(可别使用刷新,玩命耗费内存= =)
- #--------------------------------------------------------------------------
- alias walk_update update
- def update
- walk_update
- if @start_turn == true
- @turn_index += 1
- if @turn_index == WALK_REFRESH_FRAME_SPEED
- refresh
- @turn_index = 0
- @turn_phase = (@turn_phase+1)%4
- end
- end
- end
- end
- #==============================================================================
- # Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # 把原有静态图改为动态走步图
- #--------------------------------------------------------------------------
- def draw_actor_graphic(actor, x, y)
- draw_walk_actor_graphic(actor, x, y)
- end
- end
- # 脚本使用设定:
- LEVEL_UP_POINT = rand(5) + 1 # 每升一级所增加的点数
- LEVEL_UP_VARIABLE = 5 # 储存角色点数的变量编号与角色id编号的差值
-
- #==============================================================================
- # ■ Window_Command
- #------------------------------------------------------------------------------
- # 一般的命令选择行窗口。(追加定义)
- #==============================================================================
- class Window_Command < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 项目有效化
- # index : 项目编号
- #--------------------------------------------------------------------------
- def able_item(index)
- draw_item(index, normal_color)
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。(再定义)
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 更改 EXP
- # exp : 新的 EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- @exp = [[exp, 9999999].min, 0].max
- # 升级
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- # 增加4点可自由分配的点数
- $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
- # 学会特技
- for j in $data_classes[@class_id].learnings
- if j.level == @level
- learn_skill(j.skill_id)
- end
- end
- end
- # 降级
- while @exp < @exp_list[@level]
- @level -= 1
- end
- # 修正当前的 HP 与 SP 超过最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- end
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中全部窗口的超级类(追加定义)
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘 HP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_hp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
- if $temp_hp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
- else
- maxhp = actor.maxhp + $temp_hp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_hp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘 SP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_sp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
- if $temp_sp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
- else
- maxsp = actor.maxsp + $temp_sp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_sp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # type : 能力值种类 (0~4)
- #--------------------------------------------------------------------------
- def draw_actor_lvup(actor, x, y, type)
- # 定义数字颜色
- lvup = normal_color
- upcolor = Color.new(255, 128, 128, 255)
- self.contents.font.color = normal_color
- case type
- when 0
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- parameter_value_temp = parameter_value + $temp_str
- if $temp_str != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_str >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 1
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- parameter_value_temp = parameter_value + $temp_dex
- if $temp_dex != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_dex >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 2
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- parameter_value_temp = parameter_value + $temp_agi
- if $temp_agi != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_agi >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 3
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- parameter_value_temp = parameter_value + $temp_int
- if $temp_int != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_int >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 4
- parameter_name = "剩余点数"
- parameter_value = $point
- if $point != 0
- lvup = upcolor
- end
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)
- if type != 4
- self.contents.draw_text(x + 150, y, 36, 32, "→")
- end
- self.contents.font.color = lvup
- self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
- self.contents.font.color = normal_color
- end
- end
- #==============================================================================
- # ■ Window_lvup
- #------------------------------------------------------------------------------
- # 显示升级状态窗口。
- #==============================================================================
- class Window_Lvup < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 512, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_graphic(@actor, 40, 112)
- draw_actor_name(@actor, 4, 0)
- draw_actor_class(@actor, 4 + 144, 0)
- draw_actor_level(@actor, 96, 32)
- draw_actor_state(@actor, 96, 64)
- draw_actor_hp_lvup(@actor, 96+128, 32)
- draw_actor_sp_lvup(@actor, 96+128, 64)
- draw_actor_lvup(@actor, 96, 128, 0)
- draw_actor_lvup(@actor, 96, 160, 1)
- draw_actor_lvup(@actor, 96, 192, 2)
- draw_actor_lvup(@actor, 96, 224, 3)
- draw_actor_lvup(@actor, 96, 256, 4)
- end
- end
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 特技及物品的说明、角色的状态显示的窗口。
- #==============================================================================
- class Window_Lvup_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 320, 640, 160)
- self.contents = Bitmap.new(width - 32, height - 32)
- @test = "" #——这个东西用来检测,节约内存专用
- end
- #--------------------------------------------------------------------------
- # ● 设置文本
- #--------------------------------------------------------------------------
- def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
- if @test != text1
- @test = text1
- else
- return
- end
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, self.width - 40, 32, text1)
- if text2 != nil
- self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
- end
- self.contents.font.size -= 4
- if text3 != nil
- self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
- end
- if text4 != nil
- self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
- end
- self.contents.font.size += 4
- end
- end
- #==============================================================================
- # ■ Scene_lvup
- #------------------------------------------------------------------------------
- # 处理升级画面的类。
- #==============================================================================
- class Scene_Lvup
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- # menu_index : 选项起始位置
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0 , menu_index = 0)
- @actor_index = actor_index
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- s1 = "增加体力"
- s2 = "增加"+$data_system.words.str
- s3 = "增加"+$data_system.words.dex
- s4 = "增加"+$data_system.words.agi
- s5 = "增加"+$data_system.words.int
- s6 = "确认加点"
- s7 = "点数重置"
- @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
- @command_window.index = @menu_index
- # 获取角色
- @actor = $game_party.actors[@actor_index]
- # 将角色的剩余点数带入
- $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
- # 初始化临时量
- $temp_str = 0
- $temp_dex = 0
- $temp_agi = 0
- $temp_int = 0
- $temp_hp = 0
- $temp_sp = 0
- #=========================================================================
- # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
- # (各种编程语言都有这种意外),建议还是使用整数,正负不限
- #=========================================================================
- # 每提升一次力量,提升多少附加能力
- #=========================================================================
- @str_hp = 2 # 每提升一次力量附加提升多少HP
- @str_sp = 2 # 每提升一次力量附加提升多少SP
- @str_dex = 1 # 每提升一次力量附加提升多少灵巧
- @str_agi = 1 # 每提升一次力量附加提升多少速度
- @str_int = 0 # 每提升一次力量附加提升多少魔力
- @str_str = 5 # 每提升一次力量附加提升多少力量
- #=========================================================================
- # 每提升一次灵巧,提升多少附加能力
- #=========================================================================
- @dex_hp = 3 # 每提升一次灵巧附加提升多少HP
- @dex_sp = 2 # 每提升一次灵巧附加提升多少SP
- @dex_str = 1 # 每提升一次灵巧附加提升多少力量
- @dex_agi = 1 # 每提升一次灵巧附加提升多少速度
- @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
- @dex_dex = 5 # 每提升一次灵巧附加提升多少灵巧
- #=========================================================================
- # 每提升一次速度,提升多少附加能力
- #=========================================================================
- @agi_hp = 3 # 每提升一次速度附加提升多少HP
- @agi_sp = 2 # 每提升一次速度附加提升多少SP
- @agi_str = 1 # 每提升一次速度附加提升多少力量
- @agi_dex = 1 # 每提升一次速度附加提升多少灵巧
- @agi_int = 0 # 每提升一次速度附加提升多少魔力
- @agi_agi = 2 # 每提升一次速度附加提升多少速度
- #=========================================================================
- # 每提升一次魔力,提升多少附加能力
- #=========================================================================
- @int_hp = 1 # 每提升一次魔力附加提升多少HP
- @int_sp = 10 # 每提升一次魔力附加提升多少SP
- @int_str = -1 # 每提升一次魔力附加提升多少力量
- @int_dex = -1 # 每提升一次魔力附加提升多少灵巧
- @int_agi = -1 # 每提升一次魔力附加提升多少速度
- @int_int = 4 # 每提升一次魔力附加提升多少魔力
- #=========================================================================
- # 每提升一次体力,提升多少附加能力
- #=========================================================================
- @hp = 15 # 每提升一次体力提升多少HP
- @sp = 10 # 每提升一次体力提升多少SP
- @hp_str = -1 # 每提升一次体力提升多少力量
- @hp_dex = -1 # 每提升一次体力提升多少速度
- @hp_agi = -1 # 每提升一次体力提升多少灵巧
- @hp_int = -1 # 每提升一次体力提升多少魔力
- # 定义说明文字
- @text_hp_sc = "体力可以增加生存的能力,可以延长生存的时间!"
- @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
- @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和必杀!"
- @text_agi_sc = $data_system.words.agi + "可以提高回避、命中、逃跑成功率!"
- @text_int_sc = $data_system.words.int + "可以提高魔法的效果,可以增加1点魔法!"
- @text_save = "保存分配情况并返回游戏"
- @text_reset= "重新分配能力点数"
- @text_2 = "每增加一次此项能力值,可以提升能力值"
- @text_hp = "最大" + $data_system.words.hp + "值"
- @text_sp = "最大" + $data_system.words.sp + "值"
- @text_str = "最大" + $data_system.words.str + "值"
- @text_dex = "最大" + $data_system.words.dex + "值"
- @text_agi = "最大" + $data_system.words.agi + "值"
- @text_int = "最大" + $data_system.words.int + "值"
- s_disable
- # 生成状态窗口
- @lvup_window = Window_Lvup.new(@actor)
- @lvup_window.x = 128
- @lvup_window.y = 0
- # 生成帮助窗口并初始化帮助文本
- @help_window = Window_Lvup_Help.new
- # 执行过渡
- Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- @lvup_window.dispose
- @help_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- s_disable
- @lvup_window.update
- #=============================================================
- # 按下 B 键的情况下
- #=============================================================
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到地图画面
- $scene = Scene_High.new
- return
- end
- #=============================================================
- # 按下 C 键的情况下
- #=============================================================
- if Input.trigger?(Input::C)
- if @command_window.index == 5
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 将角色的剩余点数带回
- $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
- # 将角色点数实际加上
- @actor.str += $temp_str
- @actor.dex += $temp_dex
- @actor.agi += $temp_agi
- @actor.int += $temp_int
- @actor.maxhp += $temp_hp
- @actor.maxsp += $temp_sp
- # 切换到地图画面
- $scene = Scene_High.new
- return
- end
- if @command_window.index == 6
- # 演奏确定 SE
- $game_system.se_play($data_system.cancel_se)
- # 将角色的剩余点数带入
- $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
- # 初始化临时量
- $temp_str = 0
- $temp_dex = 0
- $temp_agi = 0
- $temp_int = 0
- $temp_hp = 0
- $temp_sp = 0
- @lvup_window.refresh
- return
- end
- if $point == 0
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- case @command_window.index
- when 0
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_hp += @hp
- $temp_sp += @sp
- $temp_str += @hp_str
- $temp_dex += @hp_dex
- $temp_agi += @hp_agi
- $temp_int += @hp_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 1
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_str += @str_str
- $temp_hp += @str_hp
- $temp_sp += @str_sp
- $temp_dex += @str_dex
- $temp_agi += @str_agi
- $temp_int += @str_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 2
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_dex += @dex_dex
- $temp_hp += @dex_hp
- $temp_sp += @dex_sp
- $temp_str += @dex_str
- $temp_agi += @dex_agi
- $temp_int += @dex_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 3
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_agi += @agi_agi
- $temp_hp += @agi_hp
- $temp_sp += @agi_sp
- $temp_str += @agi_str
- $temp_dex += @agi_dex
- $temp_int += @agi_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 4
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_int += @int_int
- $temp_hp += @int_hp
- $temp_sp += @int_sp
- $temp_str += @int_str
- $temp_dex += @int_dex
- $temp_agi += @int_agi
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- end
- end
- #=============================================================
- # 什么都没有按下的情况
- #=============================================================
- case @command_window.index
- when 0 # 增加体力
- temptext1 = @text_hp + @hp.to_s + "点 " + @text_str + @hp_str.to_s + "点 " + @text_dex + @hp_dex.to_s + "点"
- temptext2 = @text_sp + @sp.to_s + "点 " + @text_agi + @hp_agi.to_s + "点 " + @text_int + @hp_int.to_s + "点"
- @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
- when 1 # 增加力量
- temptext1 = @text_hp + @str_hp.to_s + "点 " + @text_str + @str_str.to_s + "点 " + @text_dex + @str_dex.to_s + "点"
- temptext2 = @text_sp + @str_sp.to_s + "点 " + @text_agi + @str_agi.to_s + "点 " + @text_int + @str_int.to_s + "点"
- @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
- when 2 # 增加灵巧
- temptext1 = @text_hp + @dex_hp.to_s + "点 " + @text_str + @dex_agi.to_s + "点 " + @text_dex + @dex_dex.to_s + "点"
- temptext2 = @text_sp + @dex_sp.to_s + "点 " + @text_agi + @dex_agi.to_s + "点 " + @text_int + @dex_int.to_s + "点"
- @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
- when 3 # 增加速度
- temptext1 = @text_hp + @agi_hp.to_s + "点 " + @text_str + @agi_str.to_s + "点 " + @text_dex + @agi_dex.to_s + "点"
- temptext2 = @text_sp + @agi_sp.to_s + "点 " + @text_agi + @agi_agi.to_s + "点 " + @text_int + @agi_int.to_s + "点"
- @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
- when 4 # 增加魔力
- temptext1 = @text_hp + @int_hp.to_s + "点 " + @text_str + @int_str.to_s + "点 " + @text_dex + @int_dex.to_s + "点"
- temptext2 = @text_sp + @int_sp.to_s + "点 " + @text_agi + @int_agi.to_s + "点 " + @text_int + @int_int.to_s + "点"
- @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
- when 5 # 保存设定
- @help_window.lvup_text(@text_save)
- when 6 # 点数重置
- @help_window.lvup_text(@text_reset)
- end
- #=============================================================
- # 按下R与L换人的情况
- #=============================================================
- if Input.trigger?(Input::R)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至下一位角色
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 切换到别的状态画面
- $scene = Scene_Lvup.new(@actor_index , @command_window.index)
- return
- end
- # 按下 L 键的情况下
- if Input.trigger?(Input::L)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至上一位角色
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 切换到别的状态画面
- $scene = Scene_Lvup.new(@actor_index , @command_window.index)
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 选项明暗判断
- #--------------------------------------------------------------------------
- def s_disable
- # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
- if $point == 0
- @command_window.disable_item(0)
- @command_window.disable_item(1)
- @command_window.disable_item(2)
- @command_window.disable_item(3)
- @command_window.disable_item(4)
- else
- @command_window.able_item(0)
- @command_window.able_item(1)
- @command_window.able_item(2)
- @command_window.able_item(3)
- @command_window.able_item(4)
- end
- end
- end
- #==============================================================================
- # *以上是升级加点的处理~~~
- #==============================================================================
复制代码 |
|