查看: 2340|回复: 0

[已经解决] 求助关于脚本冲突 level too deep

[复制链接]
梦石
0
星屑
50
在线时间
160 小时
注册时间
2010-11-7
回帖
16
发表于 2013-7-24 10:44:55 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 394178110 于 2013-7-24 12:41 编辑

这有个图书脚本 目前在菜单里和手动加点脚本冲突 显示 level too deep 哪位大神有空 帮我看看这两个脚本怎样才能同时使用。非常感谢!

图书脚本

  1. #此脚本的关键之处已做了注释,
  2. #请务必仔细阅读
  3. class Window_Information<Window_Base
  4.   TEXTHEIGHT=24                        #信息窗口中文字行高
  5.   
  6.   
  7.   def initialize(x,y,width,height)
  8.     super(x,y,width,height)
  9.   end
  10.   
  11.   def draw_text_bylines(lines,name)
  12.     text_x=100
  13.     text_y=24
  14.     self.contents.clear
  15.     self.contents.draw_text(150,0,354,24,name)
  16.     for i in 0..lines.size-1
  17.       self.contents.draw_text(text_x,text_y,354,24,lines[i])
  18.       text_y+=24
  19.     end
  20.    
  21.   end
  22.   

  23. end



  24. class Window_InforCommand<Window_Command
  25.   def initialize(x,y,name_array,handbook,face,face_index)
  26.     @name_array=name_array
  27.     @handbook=handbook
  28.     @face_visible=face
  29.     @face_index=face_index
  30.     @character_rect=Rect.new(0,0,96,250)
  31.     @now_index=-1
  32.   
  33.    p
  34.     super(x,y)
  35.     if @name_array==[]
  36.       self.visible=false
  37.     else
  38.       @information_window=Window_Information.new(160,50,354,366)
  39.     end
  40.    
  41.    
  42.   end
  43.   
  44.   def make_command_list
  45.     for i in [email]0..@name_array.size[/email]-1
  46.       add_command(@name_array[i],:command)
  47.     end
  48.    
  49.   end
  50.   
  51.   def update
  52.     super
  53.     if @now_index!=self.index
  54.        @now_index=self.index
  55.       if @information_window!=nil
  56.         if @name_array[self.index]!="未解锁"
  57.          @information_window.draw_text_bylines(@handbook[@name_array[self.index]],@name_array[self.index])
  58.          if @face_index[self.index]!=9
  59.          @information_window.draw_face(@face_visible[self.index],@face_index[self.index],0,50)
  60.          else
  61.          @information_window.contents.blt(0,50,Cache.battler(@character[self.index],0),@character_rect)
  62.          end
  63.        else
  64.          @information_window.contents.clear
  65.          @information_window.draw_text(100,0,100,24,"未解锁")
  66.        end
  67.      
  68.      end
  69.    end
  70.    
  71.   

  72.   
  73.    end
  74.    
  75.    def set_character(character)
  76.      @character=character
  77.    end
  78.    
  79.   
  80.    
  81. end




  82. class Window_MenuCommand
  83.   def add_hand_book_command
  84.     add_command("图鉴",:hand_book)
  85.   end
  86.   
  87.   alias make_command_list_old make_command_list
  88.   
  89.   def make_command_list
  90.     make_command_list_old
  91.     add_hand_book_command
  92.   end
  93.   
  94. end

  95. class Scene_Menu
  96.   alias create_command_window_old create_command_window
  97.   def create_command_window
  98.      create_command_window_old
  99.      @command_window.set_handler(:hand_book, method(:command_hand_book))
  100.    end
  101.    
  102.   def command_hand_book
  103.     SceneManager.call(Scene_Information)
  104.   end
  105. end



  106. class Scene_Information<Scene_MenuBase
  107.   
  108.   MAX_ROW_WORDS=9
  109.   def initialize
  110.     super()
  111.     @pages=[]
  112. #--------------------------------------------------------------------------
  113.   # ●以下这是这个脚本关键,按说明填数组中的内容
  114. #--------------------------------------------------------------------------
  115.     name_array=["影魔","剧毒术士","宙斯","幻影长矛手"]
  116.     #说明上面一句是设置npc的名字,名字中不要换行
  117.    
  118.     set_name_switches={0=>1,1=>2,2=>3,3=>4}
  119.     #上面设置每个npc图鉴是否可见所对应的开关,比如把剧毒术士对应7号开关
  120.     #可以这样设置“ 1=>7”左边的1表示7号开关对应名字数组中的1号位置即数组中的
  121.     #第二项。因为数组的0号位置对应数组的第一项,说以以此类推这样设置。
  122.    
  123.     @hand_book={"影魔"=>"我是影魔
  124.     我今天要横扫新手
  125.     场哈p哈哈哈哈","剧毒术士"=>"我是剧毒术士","宙斯"=>"我是宙斯","幻影长矛手"=>"我是幻影长矛手aaaaaa"}
  126.     #以上数组是设置npc的介绍,里面可以换行,如果有英文字母p,则p以后的
  127.     #内容会令起一段。
  128.    
  129.     face=["actor1","actor1","actor1","actor1"]
  130.     #以上是设置npc的头像文件名,在actor文件夹下。可以自己更改
  131.    
  132.    
  133.     face_index=[0,1,2,9]
  134.     #以上是设置每个对应头像的文件中具体头像的编号,应为每个头像文件包含
  135.     #8个头像,所以要设置一下。,如果你不想用默认头像,应自己的图像
  136.    
  137.     character=["asura","bandit","captain","hero_m"]
  138.     #设置人物半身像,半身像文件要放在ballters中,文件名填入以上数组
  139.     #注意半身像文件高度不要超过200,宽度不要超过96.
  140.      #注意以上数组中的项数一定要相同,比如上面填写的数组每个都是4项。
  141. #--------------------------------------------------------------------------
  142.   # ●以上这是这个脚本关键按说明填数组中的内容
  143. #--------------------------------------------------------------------------
  144.    
  145.     @face_visible=[]
  146.     @face_index=[]
  147.     @name_visible_array=[]
  148.     @character_visible=[]
  149.     for i in 0..set_name_switches.size-1
  150.       if $game_switches[set_name_switches[i]]==true
  151.          @name_visible_array.push(name_array[i])
  152.          @face_visible.push(face[i])
  153.          @face_index.push(face_index[i])
  154.          @character_visible.push(character[i])
  155.        else
  156.          @name_visible_array.push("未解锁")
  157.          @face_visible.push("")
  158.          @face_index.push(9)
  159.          @character_visible.push("")
  160.        end
  161.      end
  162.      
  163.      @hand_book.each{|key,value|@hand_book[key]=hand_book_tolines(value)}
  164.      


  165.   end
  166.   
  167.   def start
  168.     super
  169.     create_title_window
  170.     create_inforcommand_window
  171.   end
  172.   
  173.   def create_title_window
  174.     @title_window=Window_Base.new(0,0,544,50)
  175.     @title_window.draw_text(220,0,100,24,"图鉴")
  176.   end
  177.   
  178.   def create_inforcommand_window
  179.     @inforcommand_window=Window_InforCommand.new(0,50,@name_visible_array, @hand_book,@face_visible,@face_index)
  180.     @inforcommand_window.set_handler(:cancel,    method(:return_scene))
  181.     @inforcommand_window.set_character(@character_visible)
  182.   end
  183.   #下面这个函数是脚本关键部分之一,不理解不影响脚本的使用
  184.   #这里说明一下:这个脚本的想法是把每个图鉴的字符串分按字数分为
  185.   #几个数组,每个数组会画成图鉴窗口的一行字符,9个字为一行,
  186.   #所以这个有个问题,即每个图鉴中的文字最好不要超过60个字,否则多余的字会显示
  187.   #不出来。
  188.   def hand_book_tolines(string)
  189.     @inforlines=[]
  190.     inforline=""
  191.     wordCount=0
  192.     lineCount=0
  193.     string.delete!("\n ")
  194.    
  195.     loop do
  196.       c=string.slice!(/./m)
  197.       if c==nil
  198.         break
  199.       end
  200.       
  201.       if c!="p"
  202.           if wordCount<MAX_ROW_WORDS
  203.             wordCount+=1
  204.           else
  205.             @inforlines.push(inforline)
  206.             wordCount=1
  207.             inforline=""
  208.           end
  209.             inforline+=c
  210.         
  211.       else
  212.           @inforlines.push(inforline)
  213.           wordCount=0
  214.           inforline=""
  215.         
  216.       end
  217.    
  218.     end
  219.     @inforlines.push(inforline)
  220.     return @inforlines
  221.   
  222.   end
  223.   

  224. end
复制代码


加点脚本

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

  5. module Point_Tree
  6.   
  7.   POINT_KIND     = 6       #设定加点种类
  8.   LEVEL_UP_POINT = 3       #每升一级自由属性点增加数
  9.   RESET_ITEM     = 20      #洗点水编号
  10.   
  11.   STR_POINT        = ["体魄","元神","力量","法效","筋骨","灵活","???"]
  12.   
  13.   #分别对应增加       [MHP,MMP,物攻,物防,魔攻,魔防,敏捷,幸运]
  14.   POINT_ADD_PARAM = [[12 ,  0,   0,  0,   0,   0,   0,   0],     #体力
  15.                      [0  , 12,   0,  0,   0,   0,   0,   0],     #精神
  16.                      [0  ,  0,   5,  0,   0,   0,   0,   0],     #力量
  17.                      [0  ,  0,   0,  0,   5,   0,   0,   0],     #魔力
  18.                      [0  ,  0,   0,  3,   0,   2,   0,   1],     #韧性
  19.                      [0  ,  0,   0,  0,   0,   0,   3,   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, 6, 0, 0],
  26.                       [0 , 0, 0, 0, 0, 0, 0, 0, 6, 0],
  27.                       [6 , 6, 0, 0, 0, 0, 0, 0, 0, 0],
  28.                       [0 , 0, 6, 0, 0, 0, 0, 0, 0, 0],
  29.                       [0 , 0, 0, 0, 0, 0, 0, 4, 4, 0],
  30.                       [0 , 6, 0, 6, 6, 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.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  133.     super(0,0)
  134.     select_last
  135.   end
  136.   def actor=(actor)
  137.     return if [url=home.php?mod=space&uid=95897]@actor[/url] == actor
  138.     [url=home.php?mod=space&uid=95897]@actor[/url] = 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.     [url=home.php?mod=space&uid=95897]@actor[/url] = 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,[email]Graphics.height-@command_window.height[/email])
  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
复制代码
   
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部