赞 | 0 |
VIP | 77 |
好人卡 | 306 |
积分 | 1 |
经验 | 85662 |
最后登录 | 2023-11-23 |
在线时间 | 1782 小时 |
Lv1.梦旅人 虱子
- 梦石
- 0
- 星屑
- 121
- 在线时间
- 1782 小时
- 注册时间
- 2010-6-19
- 帖子
- 3597
|
本帖最后由 Wind2010 于 2012-5-26 18:37 编辑
- #==============================================================================
- # ■ Scene_CardBattle
- #------------------------------------------------------------------------------
- # 处理卡片战斗画面的类。
- #==============================================================================
- class Scene_CardBattle
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令光标的初期位置
- # battle_bgm : 战斗BGM
- # background : 战斗背景图片
- # enemy_id : 敌人编号
- #--------------------------------------------------------------------------
- def initialize(enemy_id,background=Bitmap.new("") ,battle_bgm = RPG::AudioFile.new("Audio/BGM/Boss_07", 100, 100))
- # 生成对象
- @battle_bgm = battle_bgm
- @background = background
- @enemy_id = enemy_id
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 播放BGM
- Audio.bgm_play(@battle_bgm)
- # 生成背景位置
- @background.x = 0
- @background.y = 0
- @background.z = 520
- # 生成角色状态
- @actor = $game_party.actors[0]
- @actor_max = @actor.maxhp
- @actor_str = @actor.str
- @actor_dex = @actor.dex
- @actor_int = @actor.int
- @actor_agi = @actor.agi
- @actor_eva = @actor.eva
- @actor_message = Window_CardMessage.new(@actor,@actor_max,@actor_str,@actor_dex,@actor_int,@actor_agi,@actor_eva,0)
- # 生成敌人状态
- @enemy = $data_enemies[@enemy_id]
- @enemy_max = @enemy.maxhp
- @enemy_str = @enemy.str
- @enemy_dex = @enemy.dex
- @enemy_int = @enemy.int
- @enemy_agi = @enemy.agi
- @enemy_eva = @enemy.eva
- @enemy_message = Window_CardMessage.new(@enemy,@enemy_max,@enemy_str,@enemy_dex,@enemy_int,@enemy_agi,@enemy_eva,0)
- # 生成角色战斗图
- @actor_battle = Bitmap.new("Graphics/Battlers" + @actor.battler_name)
- @actor_battle.x = 336
- @actor_battle.y = 32 - @actor_battle.height
- @actor_battle.z = 530
- # 生成敌人战斗图
- @enemy_battle = Bitmap.new("Graphics/Battlers" + @enemy.battler_name)
- @enemy_battle.x = 608 - @enemy_battle.width
- @enemy_battle.y = 448 - @enemy_battle.height
- @enemy_battle.z = 530
- # 生成命令窗口
- s1 = "出牌"
- s2 = "扔牌"
- s3 = "结束回合"
- @command_window = Window_Command.new(160, [s1, s2, s3])
- @command_window.index = 0
- @command_window.back_opacity = 160
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @background.dispose
- @actor_message.dispose
- @enemy_message.dispose
- @actor_battle.dispose
- @enemy_battle.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- end
- end
复制代码 试试这样有没有问题 |
|