Project1

标题: 夜想曲脚本出错问题 [打印本页]

作者: 千年狐狸精    时间: 2008-2-9 06:44
标题: 夜想曲脚本出错问题

这是怎么回事?
[LINE]1,#dddddd[/LINE]帖子已被修改,详情请看版规

作者: 零下八度    时间: 2008-2-9 06:49
提示: 作者被禁止或删除 内容自动屏蔽
作者: 千年狐狸精    时间: 2008-2-9 06:51
class Game_Skill
  # 每个技能升级的经验
  
  # 技能ID => [升到1级需要的经验, .....]
  SKILL_EXP = {
    1 => [40,60,80,120,200,280,350,500,800,1000],
    2 => [35,45,78,110,150,200,280,400,600,800],
    3 => [35,45,78,110,150,200,280,400,600,800],
    4 => [35,45,78,110,150,200,280,400,600,800],
    5 => [35,45,78,110,150,200,280,400,600,800],
    6 => [35,45,78,110,150,200,280,400,600,800],
    7 => [35,45,78,110,150,200,280,400,600,800],
    8 => [35,45,78,110,150,200,280,400,600,800],
    9 => [35,45,78,110,150,200,280,400,600,800],  
    10 => [35,45,78,110,150,200,280,400,600,800],
    11 => [35,45,78,110,150,200,280,400,600,800],
    12 => [35,45,78,110,150,200,280,400,600,800],
    13 => [35,45,78,110,150,200,280,400,600,800],
    14 => [35,45,78,110,150,200,280,400,600,800],
    15 => [35,45,78,110,150,200,280,400,600,800],
    16 => [35,45,78,110,150,200,280,400,600,800],
    }
  #--------------------------------------------------------------------------
  # ● 定义实例变量
  #--------------------------------------------------------------------------
  attr_accessor :id
  attr_accessor :name
  attr_accessor :icon_name
  attr_accessor :description
  attr_accessor :scope
  attr_accessor :occasion
  attr_accessor :animation1_id
  attr_accessor :animation2_id
  attr_accessor :menu_se
  attr_accessor :common_event_id
  attr_accessor :sp_cost
  attr_accessor :power
  attr_accessor :atk_f
  attr_accessor :eva_f
  attr_accessor :str_f
  attr_accessor :dex_f
  attr_accessor :agi_f
  attr_accessor :int_f
  attr_accessor :hit
  attr_accessor :pdef_f
  attr_accessor :mdef_f
  attr_accessor :variance
  attr_accessor :element_set
  attr_accessor :plus_state_set
  attr_accessor :minus_state_set
  attr_accessor :exp
  attr_accessor :level
  attr_accessor :dop?
  attr_accessor :time
  attr_accessor :rang
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     skill_id : 特技 ID
  #--------------------------------------------------------------------------
  def initialize(skill_id)
    super()
    setup(skill_id)
  end
  #--------------------------------------------------------------------------
  # ● 设置
  #     skill_id : 特技 ID
  #--------------------------------------------------------------------------
  def setup(skill_id)
    skill = $data_skills[skill_id]
    @id = skill.id
    @name = skill.name
    @icon_name = skill.icon_name
    @description = skill.description
    @scope = skill.scope
    @occasion = skill.occasion
    @animation1_id = skill.animation1_id
    @animation2_id = skill.animation2_id
    @menu_se = skill.menu_se
    @common_event_id = skill.common_event_id
    @sp_cost = skill.sp_cost
    @power = skill.power
    @atk_f = skill.atk_f
    @eva_f = skill.eva_f
    @str_f = skill.str_f
    @dex_f = skill.dex_f
    @agi_f = skill.agi_f
    @int_f = skill.int_f
    @hit = skill.hit
    @pdef_f = skill.pdef_f
    @mdef_f = skill.mdef_f
    @variance = skill.variance
    @element_set = skill.element_set
    @plus_state_set = skill.plus_state_set
    @minus_state_set = skill.minus_state_set
    @time = skill.time
    @rang = skill.rang
    @exp = 0
    @level = 0
    @dop = skill.dop?
  end
  def power
    return @power.to_i
  end
  def sp_cost
    return @sp_cost.to_i
  end
  def dop?
    return @dop
  end
  def level_exp(level)
    return SKILL_EXP[@id][@level]
  end
  def exp=(val)
    return if @level >= 9
    @exp = val
    if @exp > SKILL_EXP[@id][@level]
      @level += 1
      @exp = 0
      @power *= 1.5
      @sp_cost *= 1.5
      
      up_rate = 1.3
      
      if @plus_state_set.size > 0
        if $data_states[@plus_state_set[0]].maxhp_rate > 100
          $data_states[@plus_state_set[0]].maxhp_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].maxsp_rate  > 100
          $data_states[@plus_state_set[0]].maxsp_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].str_rate > 100
          $data_states[@plus_state_set[0]].str_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].dex_rate > 100
          $data_states[@plus_state_set[0]].dex_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].agi_rate > 100
          $data_states[@plus_state_set[0]].int_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].int_rate > 100
          $data_states[@plus_state_set[0]].int_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].atk_rate > 100
          $data_states[@plus_state_set[0]].atk_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].pdef_rate > 100
          $data_states[@plus_state_set[0]].pdef_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].mdef_rate > 100
          $data_states[@plus_state_set[0]].mdef_rate *= up_rate
        end
        if $data_states[@plus_state_set[0]].eva > 100
          $data_states[@plus_state_set[0]].eva *= up_rate
        end
       $data_states[@plus_state_set[0]].hold_turn *= up_rate
      end
      Mess_Text.write("#{@name}等级提升")
      $refresh["skill"] = true
    end
  end
  def exp
    return @exp
  end
end














并没有特殊的操作




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