|
发表于 2011-7-25 10:32:45
|
显示全部楼层
脚本有个地方出错了。。。因为变量的类型没有转换。。。
替换 def start_phase5
点击下边的复制代码即可
- #--------------------------------------------------------------------------
- # ● 开始结束战斗回合
- #--------------------------------------------------------------------------
- def start_phase5
- # 转移到回合 5
- @phase = 5
- # 演奏战斗结束 ME
- $game_system.me_play($game_system.battle_end_me)
- # 还原为战斗开始前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 初始化 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
-
- if enemy.name.include?("@")
- arr = enemy.name.split('@')
- size = (arr.size - 2) / 3
- size_item = (arr[1]).to_i
- size_tmp = 0
- for ii in 0...size
- break if size_tmp == size_item
- if rand(100) < (arr[4 + ii * 3]).to_i
- size_tmp += 1
- if arr[2 + ii * 3] == 'i'
- treasures.push($data_items[(arr[3 + ii * 3]).to_i])
- end
- if arr[2 + ii * 3] == 'w'
- treasures.push($data_weapons[(arr[3 + ii * 3]).to_i])
- end
- if arr[2 + ii * 3] == 'a'
- treasures.push($data_armors[(arr[3 + ii * 3]).to_i])
- end
- end
- end
- end
-
- end
- end
- # 限制宝物数为 6 个
- #treasures = treasures[0..5]
- # 获得 EXP
- for i in 0...$game_party.actors.size
- actor = $game_party.actors
- 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
复制代码
注意:限制宝物为6个的那条语句,我给变成注释了,也就是不起作用了。。
|
|