设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2359|回复: 10

[已经过期] 图书馆的加属性点脚本 怎么加不上去啊

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1899
在线时间
208 小时
注册时间
2009-11-10
帖子
234
发表于 2019-10-28 15:13:32 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
求教 这个是找的图书馆的脚本  点了确定属性点 却没有加上去 。 求前辈们指教啊 谢谢。


#encoding:utf-8
#=============================================================================
#-----------RMVA加点系统正常向-v1.03---By:救世小树--------转载请注明出处-------
#=============================================================================

module Point_Tree
  
  POINT_KIND     = 6       #设定加点种类
  LEVEL_UP_POINT = 2       #每升一级自由属性点增加数
  RESET_ITEM     = 78      #洗点水编号
  
  STR_POINT        = ["筋骨","元气","力量","灵性","防御","敏捷"]
  
  #分别对应增加       [MHP,MMP,物攻,物防,魔攻,魔防,身法,幸运]
  POINT_ADD_PARAM = [[5  ,  0,   0,  0,   0,   0,   0,   0],     #筋骨
                     [0  ,  3,   0,  0,   0,   1,   0,   0],     #元气
                     [1  ,  0,   1,  0,   0,   0,   0,   0],     #力量
                     [0  ,  1,   0,  0,   1,   0,   0,   0],     #灵性
                     [0  ,  0,   0,  1,   0,   1,   0,   0],     #防御
                     [0  ,  0,   0,  0,   0,   0,   1,   0],     #敏捷
                     
                     [0,0,0,0,0,0,0,0]]
                     #可以按上面的格式添加下去,不过要改POINT_KIND,STR_ALL,不然加了也白加
  
  #分别对应增加       [物理命中,物理闪避,必杀,必杀闪避,魔法闪避,魔法反射,物理反击,HP再生,Mp再生,Tp再生]
  POINT_ADD_XPARAM = [[0 , 0, 0, 0, 0, 0, 0, 1, 0, 0],
                      [0 , 0, 0, 0, 0, 0, 0, 0, 1, 0],
                      [0 , 0, 0, 0, 0, 0, 1, 0, 0, 0],
                      [0 , 0, 0, 0, 1, 1, 0, 0, 0, 0],
                      [0 , 0, 0, 0, 0, 0, 1, 0, 0, 0],
                      [1 , 1, 1, 0, 0, 0, 0, 0, 0, 0],
                     
                      [0,0,0,0,0,0,0,0,0,0]]
                     #这里的单位是万分之一数值也就是0.01%,我随便填了下【别嫌小,够大了,有心情你可以算算看平衡性】
  
  #各种名称
  
  ADDPOINT       = "加点"     #菜单中选项
  POINT_NAME     = "属性点"   #未分配点数
  
  XARAM_NAME     = ["物理命中","物理闪避","必杀","必杀闪避","魔法闪避","魔法反射","物理反击","生命再生","魔法再生","真气再生"]

  
  def temp_all
    r = 0
    for i in 0 .. POINT_KIND-1
      r+=$temp_point[i]
    end
    return r
  end
  
  def reset(actor_id)
    for i in 1..6
      $game_actors[actor_id].point[0] += $game_actors[actor_id].point[i]
      $game_actors[actor_id].point[i] =0
    end
  end
  
end

$temp_point = []
for i in 0 .. Point_Tree::POINT_KIND-1
  $temp_point.push(0)
end

class Game_Actor < Game_Battler
  include Point_Tree
  attr_accessor :point
  
  alias setup_tre setup
  def setup(actor_id)
    @point = []
    for i in 0 .. POINT_KIND
      @point.push(0)
    end
    setup_tre(actor_id)
  end
  
  
  
  
  alias level_up_tre level_up
  def level_up
    level_up_tre
    @hp += mhp
    @mp += mmp
    @point[0] += LEVEL_UP_POINT
  end
  

  
  def point_plus(param_id)
    r=0
    for i in 1 .. POINT_KIND
      r+=@point[i]*POINT_ADD_PARAM[i-1][param_id]
    end
    return r
  end

  alias point_base_param param
  
  def param(param_id)
    value = param_base(param_id) + param_plus(param_id) + point_plus(param_id)
    value *= param_rate(param_id) * param_buff_rate(param_id)
    [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  end
  def xparam(xparam_id,extra_add = 0)
    xp = super(xparam_id)
    for i in 0 .. POINT_KIND-1
      xp+=(@point[i+1]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
    end
    return xp
  end

  def item_apply(user, item)
    super(user, item)
    if item.id == RESET_ITEM and item.is_a?(RPG::Item)
      reset(@actor_id)
      self.hp = [self.hp,self.mhp].min
      self.mp = [self.mp,self.mmp].min
    end
  end
  
end

class Window_Point_Command < Window_Command
  
  include Point_Tree
  #--------------------------------------------------------------------------
  # ● 初始化指令选择位置(类方法)
  #--------------------------------------------------------------------------
  def self.init_command_position
    @@last_command_symbol = nil
  end
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(actor)
    @status_window = nil
    @actor = actor
    super(0,0)
    select_last
  end
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  def status_window=(status_window)
    return if @status_window == status_window
    @status_window = status_window
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # ● 获取显示行数
  #--------------------------------------------------------------------------
  def visible_line_number
    item_max
  end
  def get_actor_point(index)
    s = @actor.point[index+1].to_s
    return "("+s+")+"+$temp_point[index].to_s
  end
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
    for i in 0 .. POINT_KIND-1
      add_command(STR_POINT[i]   + get_actor_point(i)  , :point_add  ,add_enabled)
    end
    add_command("确认",  :point_ok)
    add_command("取消",  :point_cancle)
  end
  #--------------------------------------------------------------------------
  # ● 按下确定键时的处理
  #--------------------------------------------------------------------------
  def process_ok
    @@last_command_symbol = current_symbol
    super
  end
  #--------------------------------------------------------------------------
  # ● 返回最后一个选项的位置
  #--------------------------------------------------------------------------
  def select_last
    select_symbol(@@last_command_symbol)
  end
  
  def add_enabled
    temp_all < @actor.point[0]
  end

  def update_help
    @help_window.set_text(self.index+1) if @help_window
    @status_window.index = self.index if @status_window
  end
end

#帮助窗口
class Window_Point_Help < Window_Base
  include Point_Tree
  def initialize(x,y,w,h)
    super(x, y, w, h)
   
   
  end
  def set_text(id)
    contents.clear
    if id <= POINT_KIND
      text = "\\}提升一点该属性"
    elsif id == POINT_KIND+1
      text = "\\}确认此次加点分配"
    elsif  id == POINT_KIND+2
      text = "\\}取消此次加点分配"
    end
    draw_text_ex(8, 8, text)
  end
end


#角色状态窗口
class Window_Point_Actor < Window_Base
  include Point_Tree
  
  
  def initialize(actor)
    super(160, 0, Graphics.width - 160, Graphics.height)
    @actor = actor
    @index = 0
    refresh
  end
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  def index=(index)
    return if @index == index
    @index = index
    refresh
  end
  def line_height
    return 24
  end
  def refresh
    contents.clear
    contents.font.size = 24
    draw_actor_name(@actor, 100, 0)
    draw_actor_class(@actor, 240, 0)
    draw_actor_face(@actor, 2, 0)
    contents.font.size = 20
    draw_actor_level(@actor, 102,  24)
    draw_actor_point(100,48)
    contents.font.size = 16
    draw_actor_param_point(8,16 * 6)
    draw_actor_xparam_point(8,16 * 14)
  end
  def draw_actor_point(x,y)
    draw_text(x,y,200,line_height,"  未分配"+POINT_NAME + ":" + @actor.point[0].to_s)
    draw_text(x,y+line_height,200,line_height,"此次分配"+POINT_NAME + ":" + temp_all.to_s)
  end
  def draw_actor_param_point(x,y)
    8.times {|i| draw_actor_param_to_s(x,y,i)}
  end
  def draw_actor_xparam_point(x,y)
    10.times {|i| draw_actor_xparam_to_s(x,y,i)}
  end
  
  def draw_actor_param_to_s(x,y,param_id)
    a=0
    for i in 0 .. POINT_KIND-1
      a+=$temp_point[i]*POINT_ADD_PARAM[i][param_id]
    end
    s1 = Vocab::param(param_id)
    s2 = @actor.param(param_id).to_s
    s3 = (@actor.param(param_id)+a).to_s
    if @index < POINT_KIND
      if POINT_ADD_PARAM[@index][param_id]==0
        s4 = ""
      else
        s4 = "+" + POINT_ADD_PARAM[@index][param_id].to_s
      end
    else
      s4 = ""
    end
   
    change_color(system_color)
    draw_text(x,y+16*param_id,100,line_height,s1)
    change_color(normal_color)
    s2+= " →"
    draw_text(x+82,y+16*param_id,120,line_height,s2,2)
    change_color(system_color)
    draw_text(x+150,y+16*param_id,100,line_height,s3,2)
    change_color(normal_color)
    contents.font.size = 14
    draw_text(x+266,y+16*param_id,100,line_height,s4)
    contents.font.size = 16
  end
  def draw_actor_xparam_to_s(x,y,xparam_id)
    a=0.00
    for i in 0 .. POINT_KIND-1
      a+=($temp_point[i]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
    end
    s1 = XARAM_NAME[xparam_id]
    s2 = sprintf("%02.2f%%",@actor.xparam(xparam_id)*100)
    s3 = sprintf("%02.2f%%",(@actor.xparam(xparam_id) + a)*100)

    if @index < POINT_KIND
      if POINT_ADD_XPARAM[@index][xparam_id]==0
        s4=""
      else
        s4 = sprintf("+%02.2f%%",POINT_ADD_XPARAM[@index][xparam_id]/100.0)
      end
    else
      s4 = ""
    end
   
    change_color(system_color)
    draw_text(x,y+16*xparam_id,100,line_height,s1)
    change_color(normal_color)
    s2+= " →"
    draw_text(x+82,y+16*xparam_id,120,line_height,s2,2)
    change_color(system_color)
    draw_text(x+150,y+16*xparam_id,100,line_height,s3,2)
    change_color(normal_color)
    contents.font.size = 14
    draw_text(x+266,y+16*xparam_id,100,line_height,s4)
    contents.font.size = 16
   
   
  end
end

class Scene_Point < Scene_Base
  include Point_Tree
  def start
    super
    create_background
    @actor = $game_party.menu_actor
    create_command_window
    create_status_window
    create_help_window
    @command_window.activate
  end
  def terminate
    super
    dispose_background
  end
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 128)
  end
  def dispose_background
    @background_sprite.dispose
  end
  
  def create_command_window
    @command_window = Window_Point_Command.new(@actor)
    @command_window.set_handler(:cancel,      method(:return_scene))
    @command_window.set_handler(:pagedown,    method(:next_actor))
    @command_window.set_handler(:pageup,      method(:prev_actor))
    @command_window.set_handler(:point_add,   method(:add_point))
    @command_window.set_handler(:point_ok,    method(:add_ok))
    @command_window.set_handler(:point_cancle,method(:add_cancle))
   
  end
  def return_scene
    add_cancle
    SceneManager.return
  end
  def create_status_window
    @status_window = Window_Point_Actor.new(@actor)
    @command_window.status_window = @status_window
  end
  def create_help_window
    @help_window = Window_Point_Help.new(0,@command_window.height,160,Graphics.height-@command_window.height)
    #(0, 216, 160, 200)
    @help_window.viewport = @viewport
    @command_window.help_window = @help_window
  end
  
  def add_point
    if temp_all >= @actor.point[0]
      @command_window.activate
      return
    end
    $temp_point[@command_window.index] += 1
    @status_window.refresh
    @command_window.refresh
    @command_window.activate
  end
  

  def add_ok
    for i in 0 .. POINT_KIND-1
      @actor.point[i+1] += $temp_point[i]
    end
    @actor.point[0]-= temp_all
    add_cancle
  end
  
  def add_cancle
    for i in 0 .. POINT_KIND-1
      $temp_point[i]=0
    end
    @status_window.refresh
    @command_window.refresh
    @command_window.activate
  end
  
  
  def next_actor
    @actor = $game_party.menu_actor_next
    on_actor_change
  end
  #--------------------------------------------------------------------------
  # ● 切换到上一个角色
  #--------------------------------------------------------------------------
  def prev_actor
    @actor = $game_party.menu_actor_prev
    on_actor_change
  end
  #--------------------------------------------------------------------------
  # ● 切换角色
  #--------------------------------------------------------------------------
  def on_actor_change
    add_cancle
    @status_window.actor = @actor
    @command_window.actor = @actor
    @command_window.activate
  end
  
end

class Window_MenuCommand < Window_Command
  alias add_original_commands_old add_original_commands
  def add_original_commands
    add_original_commands_old
    add_command(Point_Tree::ADDPOINT,    :addpoint)
  end
end

class Scene_Menu < Scene_MenuBase
  alias create_command_window_old create_command_window
  def create_command_window
    create_command_window_old
    @command_window.set_handler(:addpoint,method(:add_point))
  end
  def add_point
    @status_window.select_last
    @status_window.activate
    @status_window.set_handler(:ok,     method(:on_ok))
    @status_window.set_handler(:cancel, method(:on_personal_cancel))
  end
  def on_ok
    SceneManager.call(Scene_Point)
    Window_Point_Command::init_command_position
  end
end



class Scene_ItemBase < Scene_MenuBase
  def item_usable?
    if item.id == Point_Tree::RESET_ITEM and item.is_a?(RPG::Item)
      return true
    end
    user.usable?(item) && item_effects_valid?
  end
end






class Window_Status < Window_Selectable
  include Point_Tree
  alias draw_parameters_old draw_parameters
  def draw_parameters(x, y)
    draw_parameters_old(x,y)
    draw_point(x,y)
  end
  def draw_point(x,y)
    for i in 0..5
      change_color(system_color)
      draw_text(x+100, y+ line_height * i, 80, line_height, STR_POINT[i])
      change_color(normal_color)
      draw_text(x+180, y+ line_height * i, 36, line_height,@actor.point[i+1].to_s, 2)
    end
  end
  
end

class Window_Base < Window
  def draw_actor_param(actor, x, y, param_id)
    change_color(system_color)
    draw_text(x-30, y, 80, line_height, Vocab::param(param_id))
    change_color(normal_color)
    draw_text(x+ 50, y, 36, line_height, actor.param(param_id), 2)
  end
end

Lv3.寻梦者

梦石
0
星屑
1899
在线时间
208 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2019-10-28 15:14:06 | 显示全部楼层
  1. #encoding:utf-8
  2. #=============================================================================
  3. #-----------RMVA加点系统正常向-v1.03---By:救世小树--------转载请注明出处-------
  4. #=============================================================================

  5. module Point_Tree
  6.   
  7.   POINT_KIND     = 6       #设定加点种类
  8.   LEVEL_UP_POINT = 2       #每升一级自由属性点增加数
  9.   RESET_ITEM     = 78      #洗点水编号
  10.   
  11.   STR_POINT        = ["筋骨","元气","力量","灵性","防御","敏捷"]
  12.   
  13.   #分别对应增加       [MHP,MMP,物攻,物防,魔攻,魔防,身法,幸运]
  14.   POINT_ADD_PARAM = [[5  ,  0,   0,  0,   0,   0,   0,   0],     #筋骨
  15.                      [0  ,  3,   0,  0,   0,   1,   0,   0],     #元气
  16.                      [1  ,  0,   1,  0,   0,   0,   0,   0],     #力量
  17.                      [0  ,  1,   0,  0,   1,   0,   0,   0],     #灵性
  18.                      [0  ,  0,   0,  1,   0,   1,   0,   0],     #防御
  19.                      [0  ,  0,   0,  0,   0,   0,   1,   0],     #敏捷
  20.                      
  21.                      [0,0,0,0,0,0,0,0]]
  22.                      #可以按上面的格式添加下去,不过要改POINT_KIND,STR_ALL,不然加了也白加
  23.   
  24.   #分别对应增加       [物理命中,物理闪避,必杀,必杀闪避,魔法闪避,魔法反射,物理反击,HP再生,Mp再生,Tp再生]
  25.   POINT_ADD_XPARAM = [[0 , 0, 0, 0, 0, 0, 0, 1, 0, 0],
  26.                       [0 , 0, 0, 0, 0, 0, 0, 0, 1, 0],
  27.                       [0 , 0, 0, 0, 0, 0, 1, 0, 0, 0],
  28.                       [0 , 0, 0, 0, 1, 1, 0, 0, 0, 0],
  29.                       [0 , 0, 0, 0, 0, 0, 1, 0, 0, 0],
  30.                       [1 , 1, 1, 0, 0, 0, 0, 0, 0, 0],
  31.                      
  32.                       [0,0,0,0,0,0,0,0,0,0]]
  33.                      #这里的单位是万分之一数值也就是0.01%,我随便填了下【别嫌小,够大了,有心情你可以算算看平衡性】
  34.   
  35.   #各种名称
  36.   
  37.   ADDPOINT       = "加点"     #菜单中选项
  38.   POINT_NAME     = "属性点"   #未分配点数
  39.   
  40.   XARAM_NAME     = ["物理命中","物理闪避","必杀","必杀闪避","魔法闪避","魔法反射","物理反击","生命再生","魔法再生","真气再生"]

  41.   
  42.   def temp_all
  43.     r = 0
  44.     for i in 0 .. POINT_KIND-1
  45.       r+=$temp_point[i]
  46.     end
  47.     return r
  48.   end
  49.   
  50.   def reset(actor_id)
  51.     for i in 1..6
  52.       $game_actors[actor_id].point[0] += $game_actors[actor_id].point[i]
  53.       $game_actors[actor_id].point[i] =0
  54.     end
  55.   end
  56.   
  57. end

  58. $temp_point = []
  59. for i in 0 .. Point_Tree::POINT_KIND-1
  60.   $temp_point.push(0)
  61. end

  62. class Game_Actor < Game_Battler
  63.   include Point_Tree
  64.   attr_accessor :point
  65.   
  66.   alias setup_tre setup
  67.   def setup(actor_id)
  68.     @point = []
  69.     for i in 0 .. POINT_KIND
  70.       @point.push(0)
  71.     end
  72.     setup_tre(actor_id)
  73.   end
  74.   
  75.   
  76.   
  77.   
  78.   alias level_up_tre level_up
  79.   def level_up
  80.     level_up_tre
  81.     @hp += mhp
  82.     @mp += mmp
  83.     @point[0] += LEVEL_UP_POINT
  84.   end
  85.   

  86.   
  87.   def point_plus(param_id)
  88.     r=0
  89.     for i in 1 .. POINT_KIND
  90.       r+=@point[i]*POINT_ADD_PARAM[i-1][param_id]
  91.     end
  92.     return r
  93.   end

  94.   alias point_base_param param
  95.   
  96.   def param(param_id)
  97.     value = param_base(param_id) + param_plus(param_id) + point_plus(param_id)
  98.     value *= param_rate(param_id) * param_buff_rate(param_id)
  99.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  100.   end
  101.   def xparam(xparam_id,extra_add = 0)
  102.     xp = super(xparam_id)
  103.     for i in 0 .. POINT_KIND-1
  104.       xp+=(@point[i+1]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  105.     end
  106.     return xp
  107.   end

  108.   def item_apply(user, item)
  109.     super(user, item)
  110.     if item.id == RESET_ITEM and item.is_a?(RPG::Item)
  111.       reset(@actor_id)
  112.       self.hp = [self.hp,self.mhp].min
  113.       self.mp = [self.mp,self.mmp].min
  114.     end
  115.   end
  116.   
  117. end

  118. class Window_Point_Command < Window_Command
  119.   
  120.   include Point_Tree
  121.   #--------------------------------------------------------------------------
  122.   # ● 初始化指令选择位置(类方法)
  123.   #--------------------------------------------------------------------------
  124.   def self.init_command_position
  125.     @@last_command_symbol = nil
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● 初始化对象
  129.   #--------------------------------------------------------------------------
  130.   def initialize(actor)
  131.     @status_window = nil
  132.     @actor = actor
  133.     super(0,0)
  134.     select_last
  135.   end
  136.   def actor=(actor)
  137.     return if @actor == actor
  138.     @actor = actor
  139.     refresh
  140.   end
  141.   def status_window=(status_window)
  142.     return if @status_window == status_window
  143.     @status_window = status_window
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 获取窗口的宽度
  147.   #--------------------------------------------------------------------------
  148.   def window_width
  149.     return 160
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 获取显示行数
  153.   #--------------------------------------------------------------------------
  154.   def visible_line_number
  155.     item_max
  156.   end
  157.   def get_actor_point(index)
  158.     s = @actor.point[index+1].to_s
  159.     return "("+s+")+"+$temp_point[index].to_s
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ● 生成指令列表
  163.   #--------------------------------------------------------------------------
  164.   def make_command_list
  165.     for i in 0 .. POINT_KIND-1
  166.       add_command(STR_POINT[i]   + get_actor_point(i)  , :point_add  ,add_enabled)
  167.     end
  168.     add_command("确认",  :point_ok)
  169.     add_command("取消",  :point_cancle)
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 按下确定键时的处理
  173.   #--------------------------------------------------------------------------
  174.   def process_ok
  175.     @@last_command_symbol = current_symbol
  176.     super
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● 返回最后一个选项的位置
  180.   #--------------------------------------------------------------------------
  181.   def select_last
  182.     select_symbol(@@last_command_symbol)
  183.   end
  184.   
  185.   def add_enabled
  186.     temp_all < @actor.point[0]
  187.   end

  188.   def update_help
  189.     @help_window.set_text(self.index+1) if @help_window
  190.     @status_window.index = self.index if @status_window
  191.   end
  192. end

  193. #帮助窗口
  194. class Window_Point_Help < Window_Base
  195.   include Point_Tree
  196.   def initialize(x,y,w,h)
  197.     super(x, y, w, h)
  198.    
  199.    
  200.   end
  201.   def set_text(id)
  202.     contents.clear
  203.     if id <= POINT_KIND
  204.       text = "\\}提升一点该属性"
  205.     elsif id == POINT_KIND+1
  206.       text = "\\}确认此次加点分配"
  207.     elsif  id == POINT_KIND+2
  208.       text = "\\}取消此次加点分配"
  209.     end
  210.     draw_text_ex(8, 8, text)
  211.   end
  212. end


  213. #角色状态窗口
  214. class Window_Point_Actor < Window_Base
  215.   include Point_Tree
  216.   
  217.   
  218.   def initialize(actor)
  219.     super(160, 0, Graphics.width - 160, Graphics.height)
  220.     @actor = actor
  221.     @index = 0
  222.     refresh
  223.   end
  224.   def actor=(actor)
  225.     return if @actor == actor
  226.     @actor = actor
  227.     refresh
  228.   end
  229.   def index=(index)
  230.     return if @index == index
  231.     @index = index
  232.     refresh
  233.   end
  234.   def line_height
  235.     return 24
  236.   end
  237.   def refresh
  238.     contents.clear
  239.     contents.font.size = 24
  240.     draw_actor_name(@actor, 100, 0)
  241.     draw_actor_class(@actor, 240, 0)
  242.     draw_actor_face(@actor, 2, 0)
  243.     contents.font.size = 20
  244.     draw_actor_level(@actor, 102,  24)
  245.     draw_actor_point(100,48)
  246.     contents.font.size = 16
  247.     draw_actor_param_point(8,16 * 6)
  248.     draw_actor_xparam_point(8,16 * 14)
  249.   end
  250.   def draw_actor_point(x,y)
  251.     draw_text(x,y,200,line_height,"  未分配"+POINT_NAME + ":" + @actor.point[0].to_s)
  252.     draw_text(x,y+line_height,200,line_height,"此次分配"+POINT_NAME + ":" + temp_all.to_s)
  253.   end
  254.   def draw_actor_param_point(x,y)
  255.     8.times {|i| draw_actor_param_to_s(x,y,i)}
  256.   end
  257.   def draw_actor_xparam_point(x,y)
  258.     10.times {|i| draw_actor_xparam_to_s(x,y,i)}
  259.   end
  260.   
  261.   def draw_actor_param_to_s(x,y,param_id)
  262.     a=0
  263.     for i in 0 .. POINT_KIND-1
  264.       a+=$temp_point[i]*POINT_ADD_PARAM[i][param_id]
  265.     end
  266.     s1 = Vocab::param(param_id)
  267.     s2 = @actor.param(param_id).to_s
  268.     s3 = (@actor.param(param_id)+a).to_s
  269.     if @index < POINT_KIND
  270.       if POINT_ADD_PARAM[@index][param_id]==0
  271.         s4 = ""
  272.       else
  273.         s4 = "+" + POINT_ADD_PARAM[@index][param_id].to_s
  274.       end
  275.     else
  276.       s4 = ""
  277.     end
  278.    
  279.     change_color(system_color)
  280.     draw_text(x,y+16*param_id,100,line_height,s1)
  281.     change_color(normal_color)
  282.     s2+= " →"
  283.     draw_text(x+82,y+16*param_id,120,line_height,s2,2)
  284.     change_color(system_color)
  285.     draw_text(x+150,y+16*param_id,100,line_height,s3,2)
  286.     change_color(normal_color)
  287.     contents.font.size = 14
  288.     draw_text(x+266,y+16*param_id,100,line_height,s4)
  289.     contents.font.size = 16
  290.   end
  291.   def draw_actor_xparam_to_s(x,y,xparam_id)
  292.     a=0.00
  293.     for i in 0 .. POINT_KIND-1
  294.       a+=($temp_point[i]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  295.     end
  296.     s1 = XARAM_NAME[xparam_id]
  297.     s2 = sprintf("%02.2f%%",@actor.xparam(xparam_id)*100)
  298.     s3 = sprintf("%02.2f%%",(@actor.xparam(xparam_id) + a)*100)

  299.     if @index < POINT_KIND
  300.       if POINT_ADD_XPARAM[@index][xparam_id]==0
  301.         s4=""
  302.       else
  303.         s4 = sprintf("+%02.2f%%",POINT_ADD_XPARAM[@index][xparam_id]/100.0)
  304.       end
  305.     else
  306.       s4 = ""
  307.     end
  308.    
  309.     change_color(system_color)
  310.     draw_text(x,y+16*xparam_id,100,line_height,s1)
  311.     change_color(normal_color)
  312.     s2+= " →"
  313.     draw_text(x+82,y+16*xparam_id,120,line_height,s2,2)
  314.     change_color(system_color)
  315.     draw_text(x+150,y+16*xparam_id,100,line_height,s3,2)
  316.     change_color(normal_color)
  317.     contents.font.size = 14
  318.     draw_text(x+266,y+16*xparam_id,100,line_height,s4)
  319.     contents.font.size = 16
  320.    
  321.    
  322.   end
  323. end

  324. class Scene_Point < Scene_Base
  325.   include Point_Tree
  326.   def start
  327.     super
  328.     create_background
  329.     @actor = $game_party.menu_actor
  330.     create_command_window
  331.     create_status_window
  332.     create_help_window
  333.     @command_window.activate
  334.   end
  335.   def terminate
  336.     super
  337.     dispose_background
  338.   end
  339.   def create_background
  340.     @background_sprite = Sprite.new
  341.     @background_sprite.bitmap = SceneManager.background_bitmap
  342.     @background_sprite.color.set(16, 16, 16, 128)
  343.   end
  344.   def dispose_background
  345.     @background_sprite.dispose
  346.   end
  347.   
  348.   def create_command_window
  349.     @command_window = Window_Point_Command.new(@actor)
  350.     @command_window.set_handler(:cancel,      method(:return_scene))
  351.     @command_window.set_handler(:pagedown,    method(:next_actor))
  352.     @command_window.set_handler(:pageup,      method(:prev_actor))
  353.     @command_window.set_handler(:point_add,   method(:add_point))
  354.     @command_window.set_handler(:point_ok,    method(:add_ok))
  355.     @command_window.set_handler(:point_cancle,method(:add_cancle))
  356.    
  357.   end
  358.   def return_scene
  359.     add_cancle
  360.     SceneManager.return
  361.   end
  362.   def create_status_window
  363.     @status_window = Window_Point_Actor.new(@actor)
  364.     @command_window.status_window = @status_window
  365.   end
  366.   def create_help_window
  367.     @help_window = Window_Point_Help.new(0,@command_window.height,160,Graphics.height-@command_window.height)
  368.     #(0, 216, 160, 200)
  369.     @help_window.viewport = @viewport
  370.     @command_window.help_window = @help_window
  371.   end
  372.   
  373.   def add_point
  374.     if temp_all >= @actor.point[0]
  375.       @command_window.activate
  376.       return
  377.     end
  378.     $temp_point[@command_window.index] += 1
  379.     @status_window.refresh
  380.     @command_window.refresh
  381.     @command_window.activate
  382.   end
  383.   

  384.   def add_ok
  385.     for i in 0 .. POINT_KIND-1
  386.       @actor.point[i+1] += $temp_point[i]
  387.     end
  388.     @actor.point[0]-= temp_all
  389.     add_cancle
  390.   end
  391.   
  392.   def add_cancle
  393.     for i in 0 .. POINT_KIND-1
  394.       $temp_point[i]=0
  395.     end
  396.     @status_window.refresh
  397.     @command_window.refresh
  398.     @command_window.activate
  399.   end
  400.   
  401.   
  402.   def next_actor
  403.     @actor = $game_party.menu_actor_next
  404.     on_actor_change
  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # ● 切换到上一个角色
  408.   #--------------------------------------------------------------------------
  409.   def prev_actor
  410.     @actor = $game_party.menu_actor_prev
  411.     on_actor_change
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● 切换角色
  415.   #--------------------------------------------------------------------------
  416.   def on_actor_change
  417.     add_cancle
  418.     @status_window.actor = @actor
  419.     @command_window.actor = @actor
  420.     @command_window.activate
  421.   end
  422.   
  423. end

  424. class Window_MenuCommand < Window_Command
  425.   alias add_original_commands_old add_original_commands
  426.   def add_original_commands
  427.     add_original_commands_old
  428.     add_command(Point_Tree::ADDPOINT,    :addpoint)
  429.   end
  430. end

  431. class Scene_Menu < Scene_MenuBase
  432.   alias create_command_window_old create_command_window
  433.   def create_command_window
  434.     create_command_window_old
  435.     @command_window.set_handler(:addpoint,method(:add_point))
  436.   end
  437.   def add_point
  438.     @status_window.select_last
  439.     @status_window.activate
  440.     @status_window.set_handler(:ok,     method(:on_ok))
  441.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  442.   end
  443.   def on_ok
  444.     SceneManager.call(Scene_Point)
  445.     Window_Point_Command::init_command_position
  446.   end
  447. end



  448. class Scene_ItemBase < Scene_MenuBase
  449.   def item_usable?
  450.     if item.id == Point_Tree::RESET_ITEM and item.is_a?(RPG::Item)
  451.       return true
  452.     end
  453.     user.usable?(item) && item_effects_valid?
  454.   end
  455. end






  456. class Window_Status < Window_Selectable
  457.   include Point_Tree
  458.   alias draw_parameters_old draw_parameters
  459.   def draw_parameters(x, y)
  460.     draw_parameters_old(x,y)
  461.     draw_point(x,y)
  462.   end
  463.   def draw_point(x,y)
  464.     for i in 0..5
  465.       change_color(system_color)
  466.       draw_text(x+100, y+ line_height * i, 80, line_height, STR_POINT[i])
  467.       change_color(normal_color)
  468.       draw_text(x+180, y+ line_height * i, 36, line_height,@actor.point[i+1].to_s, 2)
  469.     end
  470.   end
  471.   
  472. end

  473. class Window_Base < Window
  474.   def draw_actor_param(actor, x, y, param_id)
  475.     change_color(system_color)
  476.     draw_text(x-30, y, 80, line_height, Vocab::param(param_id))
  477.     change_color(normal_color)
  478.     draw_text(x+ 50, y, 36, line_height, actor.param(param_id), 2)
  479.   end
  480. end
复制代码
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
10
星屑
6940
在线时间
637 小时
注册时间
2017-1-9
帖子
578

我没有哭开拓者

发表于 2019-10-29 09:32:07 | 显示全部楼层
本帖最后由 世界第一中二 于 2019-10-29 09:33 编辑

so?更详细的问题描述呢?
仅凭目前的一句话完全不清楚楼主遇到的具体问题
这个B天天摸鱼,快点来个谁把他从被窝里拖出来
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1899
在线时间
208 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2019-10-29 10:57:19 | 显示全部楼层
世界第一中二 发表于 2019-10-29 09:32
so?更详细的问题描述呢?
仅凭目前的一句话完全不清楚楼主遇到的具体问题 ...

我选择了加的属性 也选了 确定。  但是属性没有变化。  就和选了取消一个效果。谢谢。

点评

我试过,没有问题,你是不是没有先升级一下,升级之后才会有点数可以使用的  发表于 2019-10-29 20:32
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4881
在线时间
425 小时
注册时间
2019-10-22
帖子
666
发表于 2019-10-29 22:50:38 | 显示全部楼层
出了bug让我们来全员debug  也得有更详细的  例如有没有用其他脚本等等。。。 别人无法重现你的问题
















回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1899
在线时间
208 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2019-11-17 16:54:24 | 显示全部楼层
我已经说的很清楚 加了点之后 按确定 数字又变回原来的数字 。 看人物的属性确实没有变化。 就想知道脚本是不是有什么问题。谢谢

点评

如何希望别更容易帮你解决问题,建议做一个能复现出bug的范例在帖子中。  发表于 2019-11-17 17:45
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1899
在线时间
208 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2019-12-6 09:57:43 | 显示全部楼层
好 我知道了
回复 支持 反对

使用道具 举报

Lv6.析梦学徒

老鹰

梦石
39
星屑
33313
在线时间
6543 小时
注册时间
2012-5-26
帖子
3176

极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

发表于 2019-12-6 10:45:50 | 显示全部楼层
简单看了下,你是新开的存档进行测试的吗?

按照这个脚本的写法,旧存档中的数据可能无法额外保存加点……
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1899
在线时间
208 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2020-2-4 10:04:52 | 显示全部楼层
百里_飞柳 发表于 2019-12-6 10:45
简单看了下,你是新开的存档进行测试的吗?

按照这个脚本的写法,旧存档中的数据可能无法额外保存加点…… ...

谢谢 ,我再试试看
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 22:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表