Project1

标题: 请问经验要怎么重新开始累积 [打印本页]

作者: 问题专家    时间: 2007-8-2 11:09
提示: 作者被禁止或删除 内容自动屏蔽
作者: 问题专家    时间: 2007-8-2 11:09
提示: 作者被禁止或删除 内容自动屏蔽
作者: 亿万星辰    时间: 2007-8-2 14:15
用现有的经验减去上一级的经验
作者: 问题专家    时间: 2007-8-2 21:31
提示: 作者被禁止或删除 内容自动屏蔽
作者: 问题专家    时间: 2007-8-2 22:44
提示: 作者被禁止或删除 内容自动屏蔽
作者: 问题专家    时间: 2007-8-2 22:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: 柳柳    时间: 2007-8-2 23:43
实际上是积累,只是显示的时候显示运算减法之后的状态就行了。

首先next_exp_s函数描绘了下一等级所需经验,那么我们类似地制作now_exp_s描绘本等级经验差值,dif_exp_s描绘本等级所需经验:

Game_Actor中,约346行,找到  def next_exp_s这个函数。在这个函数后面添加:
  #--------------------------------------------------------------------------
  # ● 获取 EXP 字符串
  #--------------------------------------------------------------------------
  def now_exp_s
    return @exp_list[@level+1] > 0 ? (@exp-@exp_list[@level]).to_s : "------"
  end
  
  
  #--------------------------------------------------------------------------
  # ● 获取下一等级的 EXP 字符串
  #--------------------------------------------------------------------------
  def dif_exp_s
    return @exp_list[@level+1] > 0 ? (@exp_list[@level+1]-@exp_list[@level]).to_s : "------"
  end  

然后在Window_Base找到def draw_actor_exp,做微小修改:
  #--------------------------------------------------------------------------
  # ● 描画 EXP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 24, 32, "E")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 24, y, 84, 32, actor.now_exp_s, 2)
    self.contents.draw_text(x + 108, y, 12, 32, "/", 1)
    self.contents.draw_text(x + 120, y, 84, 32, actor.dif_exp_s)
  end

完毕。范例工程:http://rpg.blue/UP_PIC/200707/更改EXP描绘范例工程.rar
作者: 柳柳    时间: 2007-8-2 23:48
这补一句,下次找我的帖子请到应援区发。
作者: 问题专家    时间: 2007-8-3 04:45
提示: 作者被禁止或删除 内容自动屏蔽




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