| 赞 | 5 |
| VIP | |
| 好人卡 | |
| 积分 | 73 |
| 经验 | |
| 最后登录 | 2026-7-13 |
| 在线时间 | 1244 小时 |
- 梦石
- 0
- 星屑
- 7296
- 在线时间
- 1244 小时
- 注册时间
- 2015-8-15
- 回帖
- 473
|
楼主 |
发表于 2023-3-17 10:54:56
|
显示全部楼层
本帖最后由 金芒芒 于 2023-3-17 10:56 编辑
事件 $scene = Scene_Map1.new
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● 刷新主菜单
- #--------------------------------------------------------------------------
- def update_command
- if Input.trigger?(Input::C)
- Notification.clear
- # 命令窗口的光标位置的分支
- case @command_window.index
- when 0 # new game
- command_new_game
- when 1 # tutorial
- command_tutorial
- when 2 # continue
- command_continue
- when 3 # historyical
- command_historical_battle
- when 4 # custom battle自定义战斗
- command_custom_battle
- when 5 # setting
- command_setting
- when 6 # shutdown
- command_shutdown
- end
-
-
-
-
- end
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 新游戏
- #--------------------------------------------------------------------------
- def command_new_game
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 停止 BGM
- Audio.bgm_stop
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- # 设置初期同伴位置
- $game_party.setup_starting_members
- # 设置初期位置的地图
- $game_map.setup(20)
- # $game_map.setup($data_system.start_map_id)
- # 主角向初期位置移动
- $game_player.moveto(20, 24)
- # $game_player.moveto($data_system.start_x, $data_system.start_y)
- # 刷新主角
- $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- $game_map.autoplay
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 切换地图画面
- $scene = Scene_Map.new
- end
- # $game_party.setup_starting_members
- # 设置初期位置的地图
- # $game_map.setup(5)
- # 主角向初期位置移动
- # $game_player.moveto(6, 4)#修改可视地图大小
- # 刷新主角
- # $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- # $game_map.autoplay
- # 刷新地图 (执行并行事件)
- # $game_map.update
- # 切换地图画面
- # $scene = Scene_Map.new
- #--------------------------------------------------------------------------
- # ● 命令 : 教程
- #--------------------------------------------------------------------------
- def command_tutorial
-
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 停止 BGM
- Audio.bgm_stop
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
-
-
- # 设置初期同伴位置
- $game_party.setup_starting_members
-
-
- $scene = Scene_Load_Bar.new(0,24,27,21)
-
- # 设置初期位置的地图
- $game_map.setup(24)
- # 主角向初期位置移动
- $game_player.moveto(27, 21)
- # 刷新主角
- $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- $game_map.autoplay
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 切换地图画面
- $scene = Scene_Map.new
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 继续
- #--------------------------------------------------------------------------
- def command_continue
- # 继续无效的情况下
- unless @continue_enabled
- # 演奏无效 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到读档画面
- # $scene = Scene_Load_Ex.new
- load_file_initialize
- #if ! @force_back or @force_back == nil
- load_file_main
-
- #p $game_map.id
-
- $scene = Scene_Map.new
-
- Graphics.update
- efs_title_update
-
-
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 历史战役
- #--------------------------------------------------------------------------
- def command_historical_battle#定义命令历史字节
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- #$游戏系统。se播放($数据系统。未指定文件或目录)
- p "historical battle"#历史性战役
- end
-
- #--------------------------------------------------------------------------
- # ● 命令 : 自定义战斗
- #--------------------------------------------------------------------------
- def command_custom_battle#定义命令_自定义战斗
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- #$游戏系统。se播放($数据系统。未指定文件或目录
-
- choose_map_main#选择主地图
- map_info = @map_info#地图信息=@地图信息
- #如果选择随机地图随机士兵
- if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
- make_random_efs_game#生成随机efs_game
- return
- end
- #---------------------------------------------------- ↑↓
- #如果@强制后退或@强制后退==无
- if ! @force_back or @force_back == nil
- #自定义主战场(0,@地图信息[1],@地图信息[2])
- custom_battle_main(0,@map_info[1],@map_info[2])
- #团队选定部队=@选定部队
- team_selected_troops = @selected_units
- #如果@强制后退或@强制后退==无
- if ! @force_back or @force_back == nil
- #自定义主战场(1,@地图信息[1],@地图信息[2])
- custom_battle_main(1,@map_info[1],@map_info[2])
- #敌人选定部队=@选定部队
- enermy_selected_troops = @selected_units
-
- #如果@强制后退或@强制后退==无
- if ! @force_back or @force_back == nil
-
- choose_hero_main#选择英雄主
- selected_hero = @selected_hero#选定的英雄=@选定的英雄
-
- if ! @force_back or @force_back == nil
- team_army = Game_Army_Slg.new(0)
- enermy_army = Game_Army_Slg.new(1)
- team_army.create_empty_army
- enermy_army.create_empty_army
-
- team_army.load_twoD_Array(team_selected_troops,selected_hero)
- enermy_army.load_twoD_Array(enermy_selected_troops)
- # 切换地图画面
- #
- team_army.set_groups_name
- $custom_battle_next_fighter_team = team_army
- $custom_battle_next_fighter_enermy = enermy_army
- $custom_battle_next_map_id = map_info[0]
-
- # 停止 BGM
- Audio.bgm_stop
-
-
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- # 设置初期同伴位置
- $game_party.setup_starting_members
-
-
-
- # 设置初期位置的地图##############1356622
- $game_map.setup(19)
- # 主角向初期位置移动
- $game_player.moveto(0, 0)
- # 刷新主角
- $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- $game_map.autoplay
-
-
-
-
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 切换地图画面
- $scene = Scene_Map.new
-
- # $scene = Scene_Map.new
- #efs_title_main
-
- else # fourth
- @force_back = false
- Graphics.update
- efs_title_update
- end
-
-
- else # third
- @force_back = false
- Graphics.update
- efs_title_update
- end
- else # second
- @force_back = false
- Graphics.update
- efs_title_update
- end
-
- else #1st
- @force_back = false
- Graphics.update
- efs_title_update
- end
-
- end
-
- #--------------------------------------------------------------------------
- # ● 命令 : 设置
- #--------------------------------------------------------------------------
- def command_setting
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- p "setting"
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 退出
- #--------------------------------------------------------------------------
- def command_shutdown
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # BGM、BGS、ME 的淡入淡出
- Audio.bgm_fade(800)
- Audio.bgs_fade(800)
- Audio.me_fade(800)
- # 退出
- $scene = nil
- end
-
-
-
-
-
-
-
-
-
-
-
- #--------------------------------------------------------------------------
- # ● 战斗测试
- #--------------------------------------------------------------------------
- def battle_test
- # 载入数据库 (战斗测试用)
- $data_actors = load_data("Data/BT_Actors.rxdata")
- $data_classes = load_data("Data/BT_Classes.rxdata")
- $data_skills = load_data("Data/BT_Skills.rxdata")
- $data_items = load_data("Data/BT_Items.rxdata")
- $data_weapons = load_data("Data/BT_Weapons.rxdata")
- $data_armors = load_data("Data/BT_Armors.rxdata")
- $data_enemies = load_data("Data/BT_Enemies.rxdata")
- $data_troops = load_data("Data/BT_Troops.rxdata")
- $data_states = load_data("Data/BT_States.rxdata")
- $data_animations = load_data("Data/BT_Animations.rxdata")
- $data_tilesets = load_data("Data/BT_Tilesets.rxdata")
- $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
- $data_system = load_data("Data/BT_System.rxdata")
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- # 设置战斗测试用同伴
- $game_party.setup_battle_test_members
- # 设置队伍 ID、可以逃走标志、战斗背景
- $game_temp.battle_troop_id = $data_system.test_troop_id
- $game_temp.battle_can_escape = true
- $game_map.battleback_name = $data_system.battleback_name
- # 演奏战斗开始 BGM
- $game_system.se_play($data_system.battle_start_se)
- # 演奏战斗 BGM
- $game_system.bgm_play($game_system.battle_bgm)
- # 切换到战斗画面
- $scene = Scene_Battle.new
- end
- end
复制代码- #==============================================================================
- # ■ Window_Title_Command
- #------------------------------------------------------------------------------
- # 标题的主菜单。
- #==============================================================================
- class Window_Title_Command < Window_Base
- attr_reader :index
- attr_reader :slide_over #滚动结束
- #start load option exit
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(index=0)
- @index = index
- #选项背景
- @button_base = Sprite.new
- @button_base.bitmap = RPG::Cache.title("title-base-light")
- @button_base.x = 1200-680+409
- @button_base.y = 56
-
-
- @cur_back = []
- @text_list = []
- @able = []
- #光标
- @item_max = 7
- for i in 0...@item_max
- @able[i] = true
- @cur_back[i] = Sprite.new
- @cur_back[i].bitmap = RPG::Cache.title("title-normal")#+i.to_s)
- @cur_back[i].x = 1200-680+435
- @cur_back[i].y = 81+45*i
- @text_list[i] = Sprite.new
- @text_list[i].bitmap = RPG::Cache.title("index-"+i.to_s)
- @text_list[i].x = 1200-680+435 + 47
- @text_list[i].y = 81+45*i + 9
- end
- @slide_over = false
- super(0, 0, 0, 0)
- self.opacity = 0
- self.active = true
- end
- def origin_x
- return 1200-680+435
- end
- def origin_y
- return 81
- end
- #--------------------------------------------------------------------------
- # ● 一些方法的重载
- #--------------------------------------------------------------------------
- def dispose
- @button_base.dispose
- for i in 0...@item_max
- @cur_back[i].dispose
- @text_list[i].dispose
- end
- super
- end
-
- def z=(z)
- super(z)
- @button_base.z=z
- for i in 0...@item_max
- @cur_back[i].z=z
- @text_list[i].z=z
- end
- end
- def visible=(visible)
- super(visible)
- @button_base.visible = visible
- for i in 0...@item_max
- @cur_back[i].visible = visible
- @text_list[i].visible = visible
- end
- end
- def index=(index)
- @index=index
- end
- def disable_item(i)
- end
- #--------------------------------------------------------------------------
- # ● 光标不被选中状态
- #--------------------------------------------------------------------------
- def back_normal(index)
- if index != -1
- @cur_back[index].bitmap = RPG::Cache.title("title-normal")#+i.to_s)
- @text_list[index].bitmap = RPG::Cache.title("index-"+index.to_s)
- end
- end
- def disable_item(index)
- @cur_back[index].bitmap = RPG::Cache.title("title-pressed")#+i.to_s)
- @able[index] = false
- @text_list[index].bitmap = RPG::Cache.title("index-"+index.to_s+"-black")
- #@cur_back[index].color = Color.new(0,0,0,128)
- end
- #--------------------------------------------------------------------------
- # ● 更新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- # 光标位置不满 0 的情况下
- if @index < 0
- for i in 0...@item_max
- back_normal(i)
- end
- return
- end
- @cur_back[@index].bitmap = RPG::Cache.title("title-highlight")#+i.to_s)
- @text_list[@index].bitmap = RPG::Cache.title("index-"+index.to_s+"-hl")
- =begin
- speed = 40#闪烁速度
- if Graphics.frame_count % speed
- < speed/2
- @cur_back[@index].color = Color.new(255,255,255,100+(Graphics.frame_count%speed)*2)
- else
- @cur_back[@index].color = Color.new(255,255,255,100+(speed-Graphics.frame_count%speed)*2)
- end
- =end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- #@cur_back[i].x = 644#640-188
- @slide_over = true
-
- if self.active
- # 方向键左被按下的情况下
- if Input.repeat?(Input::DOWN)
- $game_system.se_play($data_system.cursor_se)
- back_normal(@index)
- @index = (@index+1)%@item_max
- until @able[@index]
- @index = (@index+1)%@item_max
- end
- end
- # 方向键右被按下的情况下
- if Input.repeat?(Input::UP)
- $game_system.se_play($data_system.cursor_se)
- back_normal(@index)
- @index = (@index+@item_max-1)%@item_max
- until @able[@index]
- @index = (@index+@item_max-1)%@item_max
- end
- end
- end
- # 刷新光标矩形
- update_cursor_rect if @slide_over
- end
-
- end
复制代码 |
|