乐之魂 发表于 2016-5-21 16:48:50

LV破限有问题啊

你好啊,这个破限有个问题,我初期男主角的血是300多,但是进游戏一看是700多,怎么回事?能改回去么

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

#等级可无限提升
#パラメータの算出が適当すぎるので、各自修正が必要かと。
  BASE_FINAL_LEVEL = 9999   #上限レベル(あんまり大きな値を設定するとハングします)
  MAXHP_LIMIT = 99999999    #HP限界値
  MAXSP_LIMIT = 99999999    #SP限界値
  STR_LIMIT   = 999999      #STR限界値
  DEX_LIMIT   = 999999      #DEX限界値
  AGI_LIMIT   = 999999      #AGI限界値
  INT_LIMIT   = 999999      #INT限界値
  NEW_LIMIT_ACTOR = ############bearrpg  突破上限的角色
#######################################################这里是敌人类,没影响但是不能没有。
class Game_Enemy < Game_Battler
  def nla_id?
      return  NEW_LIMIT_ACTOR.include?(self.id)
   end
 def nla_v(p)
   case p
    when 0
      return lv = nla_id? ? BASE_FINAL_LEVEL : 99
    when 1
      return hp = nla_id? ? MAXHP_LIMIT : 99999999
    when 2
      return sp = nla_id? ? MAXSP_LIMIT : 99999999
    when 3
      return str = nla_id? ? STR_LIMIT : 999
    when 4
      return dex = nla_id? ? DEX_LIMIT : 999
    when 5
      return agi = nla_id? ? AGI_LIMIT : 999
    when 6
      return int = nla_id? ? INT_LIMIT : 999
   end
 end
end
####################################################################
class Game_Actor < Game_Battler
  def new_final_level
    lv = BASE_FINAL_LEVEL
    #以下上限LV個別指定用
   # case self.id
   # when 1
   #   lv = 255
   # when 2
   #   lv = 999
   # when 8
   #   lv = 15600
   #end
    return lv
 end
#######################################################################
 def nla_id?
      return  NEW_LIMIT_ACTOR.include?(self.id)
   end
 def nla_v(p)
   case p
    when 0
      return lv = nla_id? ? BASE_FINAL_LEVEL : 99
    when 1
      return hp = nla_id? ? MAXHP_LIMIT : 9999
    when 2
      return sp = nla_id? ? MAXSP_LIMIT : 9999
    when 3
      return str = nla_id? ? STR_LIMIT : 999
    when 4
      return dex = nla_id? ? DEX_LIMIT : 999
    when 5
      return agi = nla_id? ? AGI_LIMIT : 999
    when 6
      return int = nla_id? ? INT_LIMIT : 999
   end
 end
#######################################################################
  #--------------------------------------------------------------------------
  # ● EXP 計算
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list = Array.new(nla_v(0) + 2)
    @exp_list = 0
    pow_i = 2.4 + actor.exp_inflation / 100.0
    for i in 2..nla_v(0) + 1
      if i > nla_v(0)
        @exp_list = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list = @exp_list + Integer(n)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● MaxHP の取得
  #--------------------------------------------------------------------------
  def maxhp
    nhl =
    n = [.max, nla_v(1)].min
    for i in @states
      n *= $data_states.maxhp_rate / 100.0
    end
    n = [.max, nla_v(1)].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxHP の取得
  #--------------------------------------------------------------------------
  def base_maxhp
    n = $data_actors[@actor_id].parameters
    n += $data_actors[@actor_id].parameters * @level
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxSP の取得
  #--------------------------------------------------------------------------
  def base_maxsp
    n = $data_actors[@actor_id].parameters
    n += $data_actors[@actor_id].parameters * @level
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本腕力の取得
  #--------------------------------------------------------------------------
  def base_str
    n = $data_actors[@actor_id].parameters
    n += $data_actors[@actor_id].parameters * @level
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [.max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● 基本器用さの取得
  #--------------------------------------------------------------------------
  def base_dex
    n = $data_actors[@actor_id].parameters
    n += $data_actors[@actor_id].parameters * @level
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [.max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● 基本素早さの取得
  #--------------------------------------------------------------------------
  def base_agi
    n = $data_actors[@actor_id].parameters
    n += $data_actors[@actor_id].parameters * @level
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [.max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● 基本魔力の取得
  #--------------------------------------------------------------------------
  def base_int
    n = $data_actors[@actor_id].parameters
    n += $data_actors[@actor_id].parameters * @level
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [.max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● EXP の変更
  #     exp : 新しい EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    # ★EXPの上限チェックを解除
    @exp = .max
    # レベルアップ
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # スキル習得
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # レベルダウン
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # 現在の HP と SP が最大値を超えていたら修正
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # ● レベルの変更
  #     level : 新しいレベル
  #--------------------------------------------------------------------------
  def level=(level)
    # 上下限チェック
    # ★LV上限をnla_v(0)でチェックするように変更
    level = [.min, 1].max
    # EXP を変更
    self.exp = @exp_list
  end
end
 
 
class Game_Battler
  #--------------------------------------------------------------------------
  # ● MaxSP の取得
  #--------------------------------------------------------------------------
  def maxsp
    n = [.max, nla_v(2)].min
    for i in @states
      n *= $data_states.maxsp_rate / 100.0
    end
    n = [.max, nla_v(2)].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 腕力の取得
  #--------------------------------------------------------------------------
  def str
    n = [.max, nla_v(3)].min
    for i in @states
      n *= $data_states.str_rate / 100.0
    end
    n = [.max, nla_v(3)].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 器用さの取得
  #--------------------------------------------------------------------------
  def dex
    n = [.max, nla_v(3)].min
    for i in @states
      n *= $data_states.dex_rate / 100.0
    end
    n = [.max, nla_v(3)].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 素早さの取得
  #--------------------------------------------------------------------------
  def agi
    n = [.max, nla_v(3)].min
    for i in @states
      n *= $data_states.agi_rate / 100.0
    end
    n = [.max, nla_v(3)].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● 魔力の取得
  #--------------------------------------------------------------------------
  def int
    n = [.max, nla_v(3)].min
    for i in @states
      n *= $data_states.int_rate / 100.0
    end
    n = [.max, nla_v(3)].min
    return n
  end
  #--------------------------------------------------------------------------
  # ● MaxHP の設定
  #     maxhp : 新しい MaxHP
  #--------------------------------------------------------------------------
  def maxhp=(maxhp)
    @maxhp_plus += maxhp - self.maxhp
    @maxhp_plus = [[@maxhp_plus, -nla_v(1)].max, nla_v(1)].min
    @hp = [@hp, self.maxhp].min
  end
  #--------------------------------------------------------------------------
  # ● MaxSP の設定
  #     maxsp : 新しい MaxSP
  #--------------------------------------------------------------------------
  def maxsp=(maxsp)
    @maxsp_plus += maxsp - self.maxsp
    @maxsp_plus = [[@maxsp_plus, -nla_v(2)].max, nla_v(2)].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # ● 腕力の設定
  #     str : 新しい腕力
  #--------------------------------------------------------------------------
  def str=(str)
    @str_plus += str - self.str
    @str_plus = [[@str_plus, -nla_v(3)].max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● 器用さの設定
  #     dex : 新しい器用さ
  #--------------------------------------------------------------------------
  def dex=(dex)
    @dex_plus += dex - self.dex
    @dex_plus = [[@dex_plus, -nla_v(3)].max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● 素早さの設定
  #     agi : 新しい素早さ
  #--------------------------------------------------------------------------
  def agi=(agi)
    @agi_plus += agi - self.agi
    @agi_plus = [[@agi_plus, -nla_v(3)].max, nla_v(3)].min
  end
  #--------------------------------------------------------------------------
  # ● 魔力の設定
  #     int : 新しい魔力
  #--------------------------------------------------------------------------
  def int=(int)
    @int_plus += int - self.int
    @int_plus = [[@int_plus, -nla_v(3)].max, nla_v(3)].min
  end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


代码在这,改哪里捏?

secondsen 发表于 2016-5-21 22:51:20

因为 base_maxhp 和base_maxsp 改变了啊。。。

改成原来的就好了

另外 def maxhp 的第一行

nxx =

可以删掉。
页: [1]
查看完整版本: LV破限有问题啊