Project1

标题: 装备等级和双倍 [打印本页]

作者: lkgyp56    时间: 2009-1-11 03:06
提示: 作者被禁止或删除 内容自动屏蔽
作者: 风花雪月    时间: 2009-1-11 03:18
好吧,正好把最近写的脚本给你(双倍经验)
  1. class Game_Actor < Game_Battler
  2. attr_accessor :add_exp #############
  3. def initialize(actor_id)
  4.    super()
  5.    setup(actor_id)
  6.    @add_exp = false #############
  7. end
  8. end
  9. class Scene_Battle
  10. def start_phase5
  11.    @phase = 5
  12.    $game_system.me_play($game_system.battle_end_me)
  13.    $game_system.bgm_play($game_temp.map_bgm)
  14.    exp = 0
  15.    gold = 0
  16.    treasures = []
  17.    for enemy in $game_troop.enemies
  18.      unless enemy.hidden
  19.        exp += enemy.exp
  20.        gold += enemy.gold
  21.        if rand(100) < enemy.treasure_prob
  22.          if enemy.item_id > 0
  23.            treasures.push($data_items[enemy.item_id])
  24.          end
  25.          if enemy.weapon_id > 0
  26.            treasures.push($data_weapons[enemy.weapon_id])
  27.          end
  28.          if enemy.armor_id > 0
  29.            treasures.push($data_armors[enemy.armor_id])
  30.          end
  31.        end
  32.      end
  33.    end
  34.    treasures = treasures[0..5]
  35.    for i in 0...$game_party.actors.size
  36.      actor = $game_party.actors[i]
  37.      if actor.cant_get_exp? == false
  38.        last_level = actor.level
  39.        if actor.add_exp == true
  40.        exp = exp*2
  41.        actor.exp += exp
  42.      else
  43.        actor.exp += exp
  44.        end
  45.        if actor.level > last_level
  46.          @status_window.level_up(i)
  47.        end
  48.      end
  49.    end
  50.    $game_party.gain_gold(gold)
  51.    for item in treasures
  52.      case item
  53.      when RPG::Item
  54.        $game_party.gain_item(item.id, 1)
  55.      when RPG::Weapon
  56.        $game_party.gain_weapon(item.id, 1)
  57.      when RPG::Armor
  58.        $game_party.gain_armor(item.id, 1)
  59.      end
  60.    end
  61.    @result_window = Window_BattleResult.new(exp, gold, treasures)
  62.    @phase5_wait_count = 100
  63. end
  64. end
复制代码

开启双倍经验的方法是:$game_actors[x].add_exp = true/false,x是角色的编号
----------------------------------------
装备的等级限制是:http://rpg.blue/web/htm/news429.htm [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: lkgyp56    时间: 2009-1-11 17:18
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1