| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 13512 |  
| 最后登录 | 2022-5-16 |  
| 在线时间 | 140 小时 |  
 Lv1.梦旅人 茄孓  
	梦石0 星屑72 在线时间140 小时注册时间2007-5-29帖子956 | 
3楼
 
 
 楼主|
发表于 2008-2-14 17:26:37
|
只看该作者 
| #==============================================================================# ■ Scene_RPG
 #------------------------------------------------------------------------------
 #  处理查看画面的类。
 #==============================================================================
 
 class Scene_RPG
 def initialize
 @a = 0
 end
 
 
 #--------------------------------------------------------------------------
 # ● 主处理
 #--------------------------------------------------------------------------
 def main
 # 生成窗口
 @spriteset = Spriteset_Map.new
 @vs = Sprite.new
 @vs.bitmap = RPG::Cache.title("VS")
 @vs.x = 330
 @vs.y = 65
 @hero = Window_Hero.new
 @hero.x -= 40
 @hero.y -= 7
 @key = Window_Key.new
 @key.x -= 40
 @key.y += 200
 @font = Window_Font.new
 @font.x -= 40
 @font.y += 270
 @RPG_battle = Window_RPG.new
 @RPG_battle.x -= 80
 @RPG_battle.y += 30
 @actor = Window_Actor.new
 @actor.x = 470
 @actor.y = 78
 @enemy = Window_Enemy.new
 @enemy.x = 240
 @enemy.y = 78
 # 执行过渡
 Graphics.transition
 # 主循环
 loop do
 # 刷新游戏画面
 Graphics.update
 # 刷新输入情报
 Input.update
 # 刷新画面
 update
 # 如果画面切换的话就中断循环
 if $scene != self
 break
 end
 end
 
 # 准备过渡
 Graphics.freeze
 # 释放窗口
 @spriteset.dispose
 @vs.dispose
 @vs.bitmap.dispose
 @RPG_battle.dispose
 @actor.dispose
 @enemy.dispose
 @hero.dispose
 @key.dispose
 @font.dispose
 # 如果在标题画面切换中的情况下
 if $scene.is_a?(Scene_Title)
 # 淡入淡出画面
 Graphics.transition
 Graphics.freeze
 end
 end
 #--------------------------------------------------------------------------
 # ● 刷新画面
 #--------------------------------------------------------------------------
 def update
 
 # 获取地图ID
 newid = $game_map.map_id
 # 如果现在的地图的ID不是刚才显示的地图ID则开始显示
 if newid != @id
 @id = newid
 end
 @a += 1
 if @a == 10  #自行修改
 # 自动攻击
 $game_variables[4500] -= $game_variables[2]
 $game_system.se_play($data_system.battle_bgm)
 @wait_count = 10
 $game_variables[1]-= $game_variables[4600]
 @wait_count = 10
 if $game_variables[4500] <= 0 or $game_variables[1] <= 0
 $scene = Scene_Map.new
 end
 @a = 0
 end
 # 刷新窗口
 @RPG_battle.update
 @actor.update
 @enemy.update
 @hero.update
 @key.update
 @font.update
 # 按下 B 键的情况下
 if Input.trigger?(Input::B) and $game_variables[4500] <= 0
 # 演奏取消 SE
 $game_system.se_play($data_system.cancel_se)
 # 切换到菜单画面
 $scene = Scene_Map.new
 return
 else
 @RPG_battle.update
 end
 # 按下 C 键的场合下
 if Input.trigger?(Input::C)
 return
 end
 end
 end
 | 
 |