#============================================================================== # 角色创建脚本 # # 原作者:不详 # 整合:bb崽 亿万星辰 #============================================================================== # ■ Scene_Create #------------------------------------------------------------------------------ # 自定义创建一个新角色 #============================================================================== class Scene_Create #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main # 生成索引 [url=home.php?mod=space&uid=370741]@Index[/url] = 0 # 生成窗口 @create_window = Window_Create.new @create_window.index = 0 # 执行过渡 Graphics.transition # 主循环 loop do Graphics.frame_reset # 刷新游戏画面 Graphics.update # 刷新输入情报 Input.update # 刷新画面 update # 如果画面被切换的话就中断循环 if $scene != self break end end # 准备过渡 Graphics.freeze # 释放窗口 @create_window.dispose end #-------------------------------------------------------------------------- # ● 选择退出 #-------------------------------------------------------------------------- def on_cancel # 播放取消SE $game_system.se_play($data_system.cancel_se) # 切换画面 $scene = Scene_Title.new end #-------------------------------------------------------------------------- # ● 改变角色名称 #-------------------------------------------------------------------------- def change_name if Input.trigger?(Input::C) Sound.play_decision # 下面包含了三种起名的方法 # 方式一是RMXP默认的选字起名 # 方式二是通过外挂dll来实现用系统的输入法来输入名称 # 方式三则是用BB崽和亿万星辰一同开发的RM输入法来实现名称输入 # 三种方式只能选一种哦! #$game_temp.name_actor_id = 1 # 角色ID #$game_temp.name_max_char = 16 # 名字长度 #$scene = Scene_Name.new # 起名方式1 #$game_temp.name_actor_id = 1 # 起名方式2 #ActorNameInput(1) # 起名方式2 $game_temp.name_actor_id = 1 # 角色ID $game_temp.name_max_char = 16 # 名字长度 $scene = Scene_Name_CHN.new # 起名方式3 end end #-------------------------------------------------------------------------- # ● 改变角色性别 #-------------------------------------------------------------------------- def change_gender if Input.trigger?(Input::LEFT) Sound.play_cursor $gender = "男" RPG::GRAPHIC.new $game_actors[1].style_id = 0 return elsif Input.trigger?(Input::RIGHT) Sound.play_cursor $gender = "女" RPG::GRAPHIC.new $game_actors[1].style_id = 0 return end end #-------------------------------------------------------------------------- # ● 改变角色职业 #-------------------------------------------------------------------------- def change_class if Input.trigger?(Input::LEFT) Sound.play_cursor $game_actors[1].class_id -= 1 $game_actors[1].style_id = 0 return elsif Input.trigger?(Input::RIGHT) Sound.play_cursor $game_actors[1].class_id += 1 $game_actors[1].style_id = 0 return end end #-------------------------------------------------------------------------- # ● 改变角色样式 #-------------------------------------------------------------------------- def change_style if Input.trigger?(Input::LEFT) Sound.play_cursor $game_actors[1].style_id -= 1 return elsif Input.trigger?(Input::RIGHT) Sound.play_cursor $game_actors[1].style_id += 1 return end end #-------------------------------------------------------------------------- # ● 创建完毕 #-------------------------------------------------------------------------- def create if Input.trigger?(Input::C) Sound.play_decision $game_actors[1].style_id = $game_actors[1].style_id for s in $game_actors[1].skills $game_actors[1].forget_skill(s) end for s in $data_classes[$game_actors[1].class_id].learnings if s.level == 1 $game_actors[1].learn_skill(s.skill_id) end end $scene = Scene_Map.new end end #-------------------------------------------------------------------------- # ● 控制处理 #-------------------------------------------------------------------------- def update_commands if Input.trigger?(Input::B) on_cancel elsif Input.trigger?(Input::UP) Sound.play_cursor [url=home.php?mod=space&uid=370741]@Index[/url] = (@index + 4) % 5 @create_window.index = @index return elsif Input.trigger?(Input::DOWN) Sound.play_cursor @index = (@index + 1) % 5 @create_window.index = @index return end end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def update case @index when 0 change_name when 1 change_gender when 2 change_class when 3 change_style when 4 create end update_commands @create_window.update end end
529.57 KB, 下载次数: 130
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |