查看: 2127|回复: 0

[已经过期] 又是插件脚本冲突!!!

[复制链接]
梦石
0
星屑
1461
在线时间
815 小时
注册时间
2013-8-3
回帖
355
发表于 2017-9-19 00:41:47 | 显示全部楼层 |阅读模式

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

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

×
帮我看看这两个脚本,第一个XXX插件(还没起名字)和加点脚本冲突了!!
当第一个插件放在加点脚本前面就会失效,放在加点脚本后面可生效,但会导致加点脚本加点后确认时无法增加相应的能力点数,名义上加了点,实际上没有附加到角色身上。
帮忙解决:在不改变第一个插件的性质上,解决第二个脚本加点无法附加的问题。
第一个插件
  1. class Game_Actor < Game_Battler
  2.   def initialize(actor_id)
  3.     super()
  4.     setup(actor_id)
  5.     @last_skill = Game_BaseItem.new
  6.     $game_variables[self.id] = equips[0].params[2] if equips[0] != nil
  7.   end
  8.   def param(param_id)
  9.     if param_id == 2
  10.       value = param_base(param_id)
  11.       if equips[0] != nil
  12.         $game_variables[self.id + 190] = equips[0].params[2]
  13.         value = param_base(param_id) + param_plus(param_id) - equips[0].params[2]
  14.       else
  15.         $game_variables[self.id + 190] = 0
  16.         value = param_base(param_id) + param_plus(param_id)
  17.       end
  18.     else
  19.       value = param_base(param_id) + param_plus(param_id)
  20.     end
  21.     value *= param_rate(param_id) * param_buff_rate(param_id)
  22.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  23.   end
  24. end
复制代码

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

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

  51.   
  52.   def temp_all
  53.     r = 0
  54.     for i in 0 .. POINT_KIND-1
  55.       r+=$temp_point[i]
  56.     end
  57.     return r
  58.   end
  59.   
  60.   def reset(actor_id)
  61.     for i in 1..6
  62.       $game_actors[actor_id].point[0] += $game_actors[actor_id].point[i]
  63.       $game_actors[actor_id].point[i] =0
  64.     end
  65.   end
  66.   
  67. end

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

  72. class Game_Actor < Game_Battler
  73.   include Point_Tree
  74.   attr_accessor :point
  75.   
  76.   alias setup_tre setup
  77.   def setup(actor_id)
  78.     @point = []
  79.     for i in 0 .. POINT_KIND
  80.       @point.push(0)
  81.     end
  82.     setup_tre(actor_id)
  83.   end
  84.   
  85.   
  86.   
  87.   
  88.   alias level_up_tre level_up
  89.   def level_up
  90.     level_up_tre
  91.     @hp += mhp
  92.     @mp += mmp
  93.     @point[0] += LEVEL_UP_POINT
  94.   end
  95.   

  96.   
  97.   def point_plus(param_id)
  98.     r=0
  99.     for i in 1 .. POINT_KIND
  100.       r+=@point[i]*POINT_ADD_PARAM[i-1][param_id]
  101.     end
  102.     return r
  103.   end

  104.   alias point_base_param param
  105.   
  106.   def param(param_id)
  107.     value = param_base(param_id) + param_plus(param_id) + point_plus(param_id)
  108.     value *= param_rate(param_id) * param_buff_rate(param_id)
  109.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  110.   end
  111.   def xparam(xparam_id,extra_add = 0)
  112.     xp = super(xparam_id)
  113.     for i in 0 .. POINT_KIND-1
  114.       xp+=(@point[i+1]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  115.     end
  116.     return xp
  117.   end

  118.   def item_apply(user, item)
  119.     super(user, item)
  120.     if item.id == RESET_ITEM and item.is_a?(RPG::Item)
  121.       reset(@actor_id)
  122.       self.hp = [self.hp,self.mhp].min
  123.       self.mp = [self.mp,self.mmp].min
  124.     end
  125.   end
  126.   
  127. end

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

  198.   def update_help
  199.     @help_window.set_text(self.index+1) if @help_window
  200.     @status_window.index = self.index if @status_window
  201.   end
  202. end

  203. #帮助窗口
  204. class Window_Point_Help < Window_Base
  205.   include Point_Tree
  206.   def initialize(x,y,w,h)
  207.     super(x, y, w, h)
  208.    
  209.    
  210.   end
  211.   def set_text(id)
  212.     contents.clear
  213.     if id <= POINT_KIND
  214.       text = "\\}提升一点该属性"
  215.     elsif id == POINT_KIND+1
  216.       text = "\\}确认此次加点分配"
  217.     elsif  id == POINT_KIND+2
  218.       text = "\\}取消此次加点分配"
  219.     end
  220.     draw_text_ex(8, 8, text)
  221.   end
  222. end


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

  309.     if @index < POINT_KIND
  310.       if POINT_ADD_XPARAM[@index][xparam_id]==0
  311.         s4=""
  312.       else
  313.         s4 = sprintf("+%02.2f%%",POINT_ADD_XPARAM[@index][xparam_id]/100.0)
  314.       end
  315.     else
  316.       s4 = ""
  317.     end
  318.    
  319.     change_color(system_color)
  320.     draw_text(x,y+16*xparam_id,100,line_height,s1)
  321.     change_color(normal_color)
  322.     s2+= " →"
  323.     draw_text(x+82,y+16*xparam_id,120,line_height,s2,2)
  324.     change_color(system_color)
  325.     draw_text(x+160,y+16*xparam_id,100,line_height,s3,2)
  326.     change_color(normal_color)
  327.     contents.font.size = 14
  328.     draw_text(x+276,y+16*xparam_id,100,line_height,s4)
  329.     contents.font.size = 16
  330.    
  331.    
  332.   end
  333. end

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

  394.   def add_ok
  395.     for i in 0 .. POINT_KIND-1
  396.       @actor.point[i+1] += $temp_point[i]
  397.     end
  398.     @actor.point[0]-= temp_all
  399.     add_cancle
  400.   end
  401.   
  402.   def add_cancle
  403.     for i in 0 .. POINT_KIND-1
  404.       $temp_point[i]=0
  405.     end
  406.     @status_window.refresh
  407.     @command_window.refresh
  408.     @command_window.activate
  409.   end
  410.   
  411.   
  412.   def next_actor
  413.     @actor = $game_party.menu_actor_next
  414.     on_actor_change
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ● 切换到上一个角色
  418.   #--------------------------------------------------------------------------
  419.   def prev_actor
  420.     @actor = $game_party.menu_actor_prev
  421.     on_actor_change
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 切换角色
  425.   #--------------------------------------------------------------------------
  426.   def on_actor_change
  427.     add_cancle
  428.     @status_window.actor = @actor
  429.     @command_window.actor = @actor
  430.     @command_window.activate
  431.   end
  432.   
  433. end

  434. class Window_MenuCommand < Window_Command
  435.   alias add_original_commands_old add_original_commands
  436.   def add_original_commands
  437.     add_original_commands_old
  438.     add_command(Point_Tree::ADDPOINT,    :addpoint)
  439.   end
  440. end

  441. class Scene_Menu < Scene_MenuBase
  442.   alias create_command_window_old create_command_window
  443.   def create_command_window
  444.     create_command_window_old
  445.     @command_window.set_handler(:addpoint,method(:add_point))
  446.   end
  447.   def add_point
  448.     @status_window.select_last
  449.     @status_window.activate
  450.     @status_window.set_handler(:ok,     method(:on_ok))
  451.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  452.   end
  453.   def on_ok
  454.     SceneManager.call(Scene_Point)
  455.     Window_Point_Command::init_command_position
  456.   end
  457. end



  458. class Scene_ItemBase < Scene_MenuBase
  459.   def item_usable?
  460.     if item.id == Point_Tree::RESET_ITEM and item.is_a?(RPG::Item)
  461.       return true
  462.     end
  463.     user.usable?(item) && item_effects_valid?
  464.   end
  465. end






  466. class Window_Status < Window_Selectable
  467.   include Point_Tree
  468.   alias draw_parameters_old draw_parameters
  469.   def draw_parameters(x, y)
  470.     draw_parameters_old(x,y)
  471.     draw_point(x,y)
  472.   end
  473.   def draw_point(x,y)
  474.     for i in 0..5
  475.       change_color(system_color)
  476.       draw_text(x+100, y+ line_height * i, 80, line_height, STR_POINT[i])
  477.       change_color(normal_color)
  478.       draw_text(x+180, y+ line_height * i, 36, line_height,@actor.point[i+1].to_s, 2)
  479.     end
  480.   end
  481.   
  482. end

  483. class Window_Base < Window
  484.   def draw_actor_param(actor, x, y, param_id)
  485.     change_color(system_color)
  486.     draw_text(x-30, y, 80, line_height, Vocab::param(param_id))
  487.     change_color(normal_color)
  488.     draw_text(x+ 50, y, 36, line_height, actor.param(param_id), 2)
  489.   end
  490. end
复制代码

【同人游戏】勇者斗恶龙TG
欢迎加入游戏测试群333599798
如有需私聊请加QQ:516425000
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部