赞 | 2 |
VIP | 335 |
好人卡 | 3 |
积分 | 1 |
经验 | 14077 |
最后登录 | 2020-1-28 |
在线时间 | 264 小时 |
Lv1.梦旅人 冰
- 梦石
- 0
- 星屑
- 142
- 在线时间
- 264 小时
- 注册时间
- 2006-11-22
- 帖子
- 1057
|
寻找相应的方法贴上取代。
Scene_Map
- #--------------------------------------------------------------------------
- # ● 呼叫战斗
- #--------------------------------------------------------------------------
- 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
- Audio.bgm_play("Audio/BGM/" + $game_system.playing_bgm.name, ★★设音量, 100)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到战斗画面
- $scene = Scene_Battle.new
- end
复制代码
Scene_Battle1
- #--------------------------------------------------------------------------
- # ● 胜负判定
- #--------------------------------------------------------------------------
- def judge
- # 全灭判定是真、并且同伴人数为 0 的情况下
- if $game_party.all_dead? or $game_party.actors.size == 0
- # 允许失败的情况下
- if $game_temp.battle_can_lose
- # 还原为战斗开始前的 BGM
- Audio.bgm_play("Audio/BGM/" + $game_temp.map_bgm.name, 100, 100)
- # 战斗结束
- battle_end(2)
- # 返回 true
- return true
- end
- # 设定游戏结束标志
- $game_temp.gameover = true
- # 返回 true
- return true
- end
- # 如果存在任意 1 个敌人就返回 false
- for enemy in $game_troop.enemies
- if enemy.exist?
- return false
- end
- end
- # 开始结束战斗回合 (胜利)
- start_phase5
- # 返回 true
- return true
- end
复制代码
Scene_Battle2
- #--------------------------------------------------------------------------
- # ● 开始结束战斗回合
- #--------------------------------------------------------------------------
- def start_phase5
- # 转移到回合 5
- @phase = 5
- # 演奏战斗结束 ME
- $game_system.me_play($game_system.battle_end_me)
- # 还原为战斗开始前的 BGM
- Audio.bgm_play("Audio/BGM/" + $game_temp.map_bgm.name, 100, 100)
- # 初始化 EXP、金钱、宝物
- exp = 0
- gold = 0
- treasures = []
- # 循环
- for enemy in $game_troop.enemies
- # 敌人不是隐藏状态的情况下
- unless enemy.hidden
- # 获得 EXP、增加金钱
- exp += enemy.exp
- gold += enemy.gold
- # 出现宝物判定
- if rand(100) < enemy.treasure_prob
- if enemy.item_id > 0
- treasures.push($data_items[enemy.item_id])
- end
- if enemy.weapon_id > 0
- treasures.push($data_weapons[enemy.weapon_id])
- end
- if enemy.armor_id > 0
- treasures.push($data_armors[enemy.armor_id])
- end
- end
- end
- end
- # 限制宝物数为 6 个
- treasures = treasures[0..5]
- # 获得 EXP
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- if actor.cant_get_exp? == false
- last_level = actor.level
- actor.exp += exp
- if actor.level > last_level
- @status_window.level_up(i)
- end
- end
- end
- # 获得金钱
- $game_party.gain_gold(gold)
- # 获得宝物
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- # 产生战斗结果窗口
- @result_window = Window_BattleResult.new(exp, gold, treasures)
- # 设定等待计数
- @phase5_wait_count = 100
- end
复制代码 |
|