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

Project1

 找回密码
 注册会员
搜索
查看: 1784|回复: 0
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
160 小时
注册时间
2010-11-7
帖子
28
跳转到指定楼层
1
发表于 2013-7-24 10:44:55 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

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

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

图书脚本

RUBY 代码复制
  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.  
  24. end
  25.  
  26.  
  27.  
  28. class Window_InforCommand<Window_Command
  29.   def initialize(x,y,name_array,handbook,face,face_index)
  30.     @name_array=name_array
  31.     @handbook=handbook
  32.     @face_visible=face
  33.     @face_index=face_index
  34.     @character_rect=Rect.new(0,0,96,250)
  35.     @now_index=-1
  36.  
  37.    p
  38.     super(x,y)
  39.     if @name_array==[]
  40.       self.visible=false
  41.     else
  42.       @information_window=Window_Information.new(160,50,354,366)
  43.     end
  44.  
  45.  
  46.   end
  47.  
  48.   def make_command_list
  49.     for i in [email]0..@name_array.size[/email]-1
  50.       add_command(@name_array[i],:command)
  51.     end
  52.  
  53.   end
  54.  
  55.   def update
  56.     super
  57.     if @now_index!=self.index
  58.        @now_index=self.index
  59.       if @information_window!=nil
  60.         if @name_array[self.index]!="未解锁"
  61.          @information_window.draw_text_bylines(@handbook[@name_array[self.index]],@name_array[self.index])
  62.          if @face_index[self.index]!=9
  63.          @information_window.draw_face(@face_visible[self.index],@face_index[self.index],0,50)
  64.          else
  65.          @information_window.contents.blt(0,50,Cache.battler(@character[self.index],0),@character_rect)
  66.          end
  67.        else
  68.          @information_window.contents.clear
  69.          @information_window.draw_text(100,0,100,24,"未解锁")
  70.        end
  71.  
  72.      end
  73.    end
  74.  
  75.  
  76.  
  77.  
  78.    end
  79.  
  80.    def set_character(character)
  81.      @character=character
  82.    end
  83.  
  84.  
  85.  
  86. end
  87.  
  88.  
  89.  
  90.  
  91. class Window_MenuCommand
  92.   def add_hand_book_command
  93.     add_command("图鉴",:hand_book)
  94.   end
  95.  
  96.   alias make_command_list_old make_command_list
  97.  
  98.   def make_command_list
  99.     make_command_list_old
  100.     add_hand_book_command
  101.   end
  102.  
  103. end
  104.  
  105. class Scene_Menu
  106.   alias create_command_window_old create_command_window
  107.   def create_command_window
  108.      create_command_window_old
  109.      @command_window.set_handler(:hand_book, method(:command_hand_book))
  110.    end
  111.  
  112.   def command_hand_book
  113.     SceneManager.call(Scene_Information)
  114.   end
  115. end
  116.  
  117.  
  118.  
  119. class Scene_Information<Scene_MenuBase
  120.  
  121.   MAX_ROW_WORDS=9
  122.   def initialize
  123.     super()
  124.     @pages=[]
  125. #--------------------------------------------------------------------------
  126.   # ●以下这是这个脚本关键,按说明填数组中的内容
  127. #--------------------------------------------------------------------------
  128.     name_array=["影魔","剧毒术士","宙斯","幻影长矛手"]
  129.     #说明上面一句是设置npc的名字,名字中不要换行
  130.  
  131.     set_name_switches={0=>1,1=>2,2=>3,3=>4}
  132.     #上面设置每个npc图鉴是否可见所对应的开关,比如把剧毒术士对应7号开关
  133.     #可以这样设置“ 1=>7”左边的1表示7号开关对应名字数组中的1号位置即数组中的
  134.     #第二项。因为数组的0号位置对应数组的第一项,说以以此类推这样设置。
  135.  
  136.     @hand_book={"影魔"=>"我是影魔
  137.     我今天要横扫新手
  138.     场哈p哈哈哈哈","剧毒术士"=>"我是剧毒术士","宙斯"=>"我是宙斯","幻影长矛手"=>"我是幻影长矛手aaaaaa"}
  139.     #以上数组是设置npc的介绍,里面可以换行,如果有英文字母p,则p以后的
  140.     #内容会令起一段。
  141.  
  142.     face=["actor1","actor1","actor1","actor1"]
  143.     #以上是设置npc的头像文件名,在actor文件夹下。可以自己更改
  144.  
  145.  
  146.     face_index=[0,1,2,9]
  147.     #以上是设置每个对应头像的文件中具体头像的编号,应为每个头像文件包含
  148.     #8个头像,所以要设置一下。,如果你不想用默认头像,应自己的图像
  149.  
  150.     character=["asura","bandit","captain","hero_m"]
  151.     #设置人物半身像,半身像文件要放在ballters中,文件名填入以上数组
  152.     #注意半身像文件高度不要超过200,宽度不要超过96.
  153.      #注意以上数组中的项数一定要相同,比如上面填写的数组每个都是4项。
  154. #--------------------------------------------------------------------------
  155.   # ●以上这是这个脚本关键按说明填数组中的内容
  156. #--------------------------------------------------------------------------
  157.  
  158.     @face_visible=[]
  159.     @face_index=[]
  160.     @name_visible_array=[]
  161.     @character_visible=[]
  162.     for i in 0..set_name_switches.size-1
  163.       if $game_switches[set_name_switches[i]]==true
  164.          @name_visible_array.push(name_array[i])
  165.          @face_visible.push(face[i])
  166.          @face_index.push(face_index[i])
  167.          @character_visible.push(character[i])
  168.        else
  169.          @name_visible_array.push("未解锁")
  170.          @face_visible.push("")
  171.          @face_index.push(9)
  172.          @character_visible.push("")
  173.        end
  174.      end
  175.  
  176.      @hand_book.each{|key,value|@hand_book[key]=hand_book_tolines(value)}
  177.  
  178.  
  179.  
  180.   end
  181.  
  182.   def start
  183.     super
  184.     create_title_window
  185.     create_inforcommand_window
  186.   end
  187.  
  188.   def create_title_window
  189.     @title_window=Window_Base.new(0,0,544,50)
  190.     @title_window.draw_text(220,0,100,24,"图鉴")
  191.   end
  192.  
  193.   def create_inforcommand_window
  194.     @inforcommand_window=Window_InforCommand.new(0,50,@name_visible_array, @hand_book,@face_visible,@face_index)
  195.     @inforcommand_window.set_handler(:cancel,    method(:return_scene))
  196.     @inforcommand_window.set_character(@character_visible)
  197.   end
  198.   #下面这个函数是脚本关键部分之一,不理解不影响脚本的使用
  199.   #这里说明一下:这个脚本的想法是把每个图鉴的字符串分按字数分为
  200.   #几个数组,每个数组会画成图鉴窗口的一行字符,9个字为一行,
  201.   #所以这个有个问题,即每个图鉴中的文字最好不要超过60个字,否则多余的字会显示
  202.   #不出来。
  203.   def hand_book_tolines(string)
  204.     @inforlines=[]
  205.     inforline=""
  206.     wordCount=0
  207.     lineCount=0
  208.     string.delete!("\n ")
  209.  
  210.     loop do
  211.       c=string.slice!(/./m)
  212.       if c==nil
  213.         break
  214.       end
  215.  
  216.       if c!="p"
  217.           if wordCount<MAX_ROW_WORDS
  218.             wordCount+=1
  219.           else
  220.             @inforlines.push(inforline)
  221.             wordCount=1
  222.             inforline=""
  223.           end
  224.             inforline+=c
  225.  
  226.       else
  227.           @inforlines.push(inforline)
  228.           wordCount=0
  229.           inforline=""
  230.  
  231.       end
  232.  
  233.     end
  234.     @inforlines.push(inforline)
  235.     return @inforlines
  236.  
  237.   end
  238.  
  239.  
  240. end


加点脚本

RUBY 代码复制
  1. #encoding:utf-8
  2. #=============================================================================
  3. #-----------RMVA加点系统正常向-v1.03---By:救世小树--------转载请注明出处-------
  4. #=============================================================================
  5.  
  6. module Point_Tree
  7.  
  8.   POINT_KIND     = 6       #设定加点种类
  9.   LEVEL_UP_POINT = 3       #每升一级自由属性点增加数
  10.   RESET_ITEM     = 20      #洗点水编号
  11.  
  12.   STR_POINT        = ["体魄","元神","力量","法效","筋骨","灵活","???"]
  13.  
  14.   #分别对应增加       [MHP,MMP,物攻,物防,魔攻,魔防,敏捷,幸运]
  15.   POINT_ADD_PARAM = [[12 ,  0,   0,  0,   0,   0,   0,   0],     #体力
  16.                      [0  , 12,   0,  0,   0,   0,   0,   0],     #精神
  17.                      [0  ,  0,   5,  0,   0,   0,   0,   0],     #力量
  18.                      [0  ,  0,   0,  0,   5,   0,   0,   0],     #魔力
  19.                      [0  ,  0,   0,  3,   0,   2,   0,   1],     #韧性
  20.                      [0  ,  0,   0,  0,   0,   0,   3,   0],     #灵活
  21.  
  22.                      [0,0,0,0,0,0,0,0]]
  23.                      #可以按上面的格式添加下去,不过要改POINT_KIND,STR_ALL,不然加了也白加
  24.  
  25.   #分别对应增加       [物理命中,物理闪避,必杀,必杀闪避,魔法闪避,魔法反射,物理反击,HP再生,Mp再生,Tp再生]
  26.   POINT_ADD_XPARAM = [[0 , 0, 0, 0, 0, 0, 0, 6, 0, 0],
  27.                       [0 , 0, 0, 0, 0, 0, 0, 0, 6, 0],
  28.                       [6 , 6, 0, 0, 0, 0, 0, 0, 0, 0],
  29.                       [0 , 0, 6, 0, 0, 0, 0, 0, 0, 0],
  30.                       [0 , 0, 0, 0, 0, 0, 0, 4, 4, 0],
  31.                       [0 , 6, 0, 6, 6, 0, 0, 0, 0, 0],
  32.  
  33.                       [0,0,0,0,0,0,0,0,0,0]]
  34.                      #这里的单位是万分之一数值也就是0.01%,我随便填了下【别嫌小,够大了,有心情你可以算算看平衡性】
  35.  
  36.   #各种名称
  37.  
  38.   ADDPOINT       = "属性分配"     #菜单中选项
  39.   POINT_NAME     = "属性点"   #未分配点数
  40.  
  41.   XARAM_NAME     = ["物理命中","物理闪避","暴击","暴击闪避","法术闪避","法术反射","物理反击","生命恢复","法力恢复","体力恢复"]
  42.  
  43.  
  44.   def temp_all
  45.     r = 0
  46.     for i in 0 .. POINT_KIND-1
  47.       r+=$temp_point[i]
  48.     end
  49.     return r
  50.   end
  51.  
  52.   def reset(actor_id)
  53.     for i in 1..6
  54.       $game_actors[actor_id].point[0] += $game_actors[actor_id].point[i]
  55.       $game_actors[actor_id].point[i] =0
  56.     end
  57.   end
  58.  
  59. end
  60.  
  61. $temp_point = []
  62. for i in 0 .. Point_Tree::POINT_KIND-1
  63.   $temp_point.push(0)
  64. end
  65.  
  66. class Game_Actor < Game_Battler
  67.   include Point_Tree
  68.   attr_accessor :point
  69.  
  70.   alias setup_tre setup
  71.   def setup(actor_id)
  72.     @point = []
  73.     for i in 0 .. POINT_KIND
  74.       @point.push(0)
  75.     end
  76.     setup_tre(actor_id)
  77.   end
  78.  
  79.  
  80.  
  81.  
  82.   alias level_up_tre level_up
  83.   def level_up
  84.     level_up_tre
  85.     @hp += mhp
  86.     @mp += mmp
  87.     @point[0] += LEVEL_UP_POINT
  88.   end
  89.  
  90.  
  91.  
  92.   def point_plus(param_id)
  93.     r=0
  94.     for i in 1 .. POINT_KIND
  95.       r+=@point[i]*POINT_ADD_PARAM[i-1][param_id]
  96.     end
  97.     return r
  98.   end
  99.  
  100.   alias point_base_param param
  101.  
  102.   def param(param_id)
  103.     value = param_base(param_id) + param_plus(param_id) + point_plus(param_id)
  104.     value *= param_rate(param_id) * param_buff_rate(param_id)
  105.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  106.   end
  107.   def xparam(xparam_id,extra_add = 0)
  108.     xp = super(xparam_id)
  109.     for i in 0 .. POINT_KIND-1
  110.       xp+=(@point[i+1]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  111.     end
  112.     return xp
  113.   end
  114.  
  115.   def item_apply(user, item)
  116.     super(user, item)
  117.     if item.id == RESET_ITEM and item.is_a?(RPG::Item)
  118.       reset(@actor_id)
  119.       self.hp = [self.hp,self.mhp].min
  120.       self.mp = [self.mp,self.mmp].min
  121.     end
  122.   end
  123.  
  124. end
  125.  
  126. class Window_Point_Command < Window_Command
  127.  
  128.   include Point_Tree
  129.   #--------------------------------------------------------------------------
  130.   # ● 初始化指令选择位置(类方法)
  131.   #--------------------------------------------------------------------------
  132.   def self.init_command_position
  133.     @@last_command_symbol = nil
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 初始化对象
  137.   #--------------------------------------------------------------------------
  138.   def initialize(actor)
  139.     @status_window = nil
  140.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  141.     super(0,0)
  142.     select_last
  143.   end
  144.   def actor=(actor)
  145.     return if [url=home.php?mod=space&uid=95897]@actor[/url] == actor
  146.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  147.     refresh
  148.   end
  149.   def status_window=(status_window)
  150.     return if @status_window == status_window
  151.     @status_window = status_window
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● 获取窗口的宽度
  155.   #--------------------------------------------------------------------------
  156.   def window_width
  157.     return 160
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 获取显示行数
  161.   #--------------------------------------------------------------------------
  162.   def visible_line_number
  163.     item_max
  164.   end
  165.   def get_actor_point(index)
  166.     s = @actor.point[index+1].to_s
  167.     return "("+s+")+"+$temp_point[index].to_s
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 生成指令列表
  171.   #--------------------------------------------------------------------------
  172.   def make_command_list
  173.     for i in 0 .. POINT_KIND-1
  174.       add_command(STR_POINT[i]   + get_actor_point(i)  , :point_add  ,add_enabled)
  175.     end
  176.     add_command("确认",  :point_ok)
  177.     add_command("取消",  :point_cancle)
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 按下确定键时的处理
  181.   #--------------------------------------------------------------------------
  182.   def process_ok
  183.     @@last_command_symbol = current_symbol
  184.     super
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 返回最后一个选项的位置
  188.   #--------------------------------------------------------------------------
  189.   def select_last
  190.     select_symbol(@@last_command_symbol)
  191.   end
  192.  
  193.   def add_enabled
  194.     temp_all < @actor.point[0]
  195.   end
  196.  
  197.   def update_help
  198.     @help_window.set_text(self.index+1) if @help_window
  199.     @status_window.index = self.index if @status_window
  200.   end
  201. end
  202.  
  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.  
  225. #角色状态窗口
  226. class Window_Point_Actor < Window_Base
  227.   include Point_Tree
  228.  
  229.  
  230.   def initialize(actor)
  231.     super(160, 0, Graphics.width - 160, Graphics.height)
  232.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  233.     @index = 0
  234.     refresh
  235.   end
  236.   def actor=(actor)
  237.     return if @actor == actor
  238.     @actor = actor
  239.     refresh
  240.   end
  241.   def index=(index)
  242.     return if @index == index
  243.     @index = index
  244.     refresh
  245.   end
  246.   def line_height
  247.     return 24
  248.   end
  249.   def refresh
  250.     contents.clear
  251.     contents.font.size = 24
  252.     draw_actor_name(@actor, 100, 0)
  253.     draw_actor_class(@actor, 240, 0)
  254.     draw_actor_face(@actor, 2, 0)
  255.     contents.font.size = 20
  256.     draw_actor_level(@actor, 102,  24)
  257.     draw_actor_point(100,48)
  258.     contents.font.size = 16
  259.     draw_actor_param_point(8,16 * 6)
  260.     draw_actor_xparam_point(8,16 * 14)
  261.   end
  262.   def draw_actor_point(x,y)
  263.     draw_text(x,y,200,line_height,"  未分配"+POINT_NAME + ":" + @actor.point[0].to_s)
  264.     draw_text(x,y+line_height,200,line_height,"此次分配"+POINT_NAME + ":" + temp_all.to_s)
  265.   end
  266.   def draw_actor_param_point(x,y)
  267.     8.times {|i| draw_actor_param_to_s(x,y,i)}
  268.   end
  269.   def draw_actor_xparam_point(x,y)
  270.     10.times {|i| draw_actor_xparam_to_s(x,y,i)}
  271.   end
  272.  
  273.   def draw_actor_param_to_s(x,y,param_id)
  274.     a=0
  275.     for i in 0 .. POINT_KIND-1
  276.       a+=$temp_point[i]*POINT_ADD_PARAM[i][param_id]
  277.     end
  278.     s1 = Vocab::param(param_id)
  279.     s2 = @actor.param(param_id).to_s
  280.     s3 = (@actor.param(param_id)+a).to_s
  281.     if @index < POINT_KIND
  282.       if POINT_ADD_PARAM[@index][param_id]==0
  283.         s4 = ""
  284.       else
  285.         s4 = "+" + POINT_ADD_PARAM[@index][param_id].to_s
  286.       end
  287.     else
  288.       s4 = ""
  289.     end
  290.  
  291.     change_color(system_color)
  292.     draw_text(x,y+16*param_id,100,line_height,s1)
  293.     change_color(normal_color)
  294.     s2+= " →"
  295.     draw_text(x+82,y+16*param_id,120,line_height,s2,2)
  296.     change_color(system_color)
  297.     draw_text(x+150,y+16*param_id,100,line_height,s3,2)
  298.     change_color(normal_color)
  299.     contents.font.size = 14
  300.     draw_text(x+266,y+16*param_id,100,line_height,s4)
  301.     contents.font.size = 16
  302.   end
  303.   def draw_actor_xparam_to_s(x,y,xparam_id)
  304.     a=0.00
  305.     for i in 0 .. POINT_KIND-1
  306.       a+=($temp_point[i]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  307.     end
  308.     s1 = XARAM_NAME[xparam_id]
  309.     s2 = sprintf("%02.2f%%",@actor.xparam(xparam_id)*100)
  310.     s3 = sprintf("%02.2f%%",(@actor.xparam(xparam_id) + a)*100)
  311.  
  312.     if @index < POINT_KIND
  313.       if POINT_ADD_XPARAM[@index][xparam_id]==0
  314.         s4=""
  315.       else
  316.         s4 = sprintf("+%02.2f%%",POINT_ADD_XPARAM[@index][xparam_id]/100.0)
  317.       end
  318.     else
  319.       s4 = ""
  320.     end
  321.  
  322.     change_color(system_color)
  323.     draw_text(x,y+16*xparam_id,100,line_height,s1)
  324.     change_color(normal_color)
  325.     s2+= " →"
  326.     draw_text(x+82,y+16*xparam_id,120,line_height,s2,2)
  327.     change_color(system_color)
  328.     draw_text(x+150,y+16*xparam_id,100,line_height,s3,2)
  329.     change_color(normal_color)
  330.     contents.font.size = 14
  331.     draw_text(x+266,y+16*xparam_id,100,line_height,s4)
  332.     contents.font.size = 16
  333.  
  334.  
  335.   end
  336. end
  337.  
  338. class Scene_Point < Scene_Base
  339.   include Point_Tree
  340.   def start
  341.     super
  342.     create_background
  343.     @actor = $game_party.menu_actor
  344.     create_command_window
  345.     create_status_window
  346.     create_help_window
  347.     @command_window.activate
  348.   end
  349.   def terminate
  350.     super
  351.     dispose_background
  352.   end
  353.   def create_background
  354.     @background_sprite = Sprite.new
  355.     @background_sprite.bitmap = SceneManager.background_bitmap
  356.     @background_sprite.color.set(16, 16, 16, 128)
  357.   end
  358.   def dispose_background
  359.     @background_sprite.dispose
  360.   end
  361.  
  362.   def create_command_window
  363.     @command_window = Window_Point_Command.new(@actor)
  364.     @command_window.set_handler(:cancel,      method(:return_scene))
  365.     @command_window.set_handler(:pagedown,    method(:next_actor))
  366.     @command_window.set_handler(:pageup,      method(:prev_actor))
  367.     @command_window.set_handler(:point_add,   method(:add_point))
  368.     @command_window.set_handler(:point_ok,    method(:add_ok))
  369.     @command_window.set_handler(:point_cancle,method(:add_cancle))
  370.  
  371.   end
  372.   def return_scene
  373.     add_cancle
  374.     SceneManager.return
  375.   end
  376.   def create_status_window
  377.     @status_window = Window_Point_Actor.new(@actor)
  378.     @command_window.status_window = @status_window
  379.   end
  380.   def create_help_window
  381.     @help_window = Window_Point_Help.new(0,@command_window.height,160,[email]Graphics.height-@command_window.height[/email])
  382.     #(0, 216, 160, 200)
  383.     @help_window.viewport = @viewport
  384.     @command_window.help_window = @help_window
  385.   end
  386.  
  387.   def add_point
  388.     if temp_all >= @actor.point[0]
  389.       @command_window.activate
  390.       return
  391.     end
  392.     $temp_point[@command_window.index] += 1
  393.     @status_window.refresh
  394.     @command_window.refresh
  395.     @command_window.activate
  396.   end
  397.  
  398.  
  399.   def add_ok
  400.     for i in 0 .. POINT_KIND-1
  401.       @actor.point[i+1] += $temp_point[i]
  402.     end
  403.     @actor.point[0]-= temp_all
  404.     add_cancle
  405.   end
  406.  
  407.   def add_cancle
  408.     for i in 0 .. POINT_KIND-1
  409.       $temp_point[i]=0
  410.     end
  411.     @status_window.refresh
  412.     @command_window.refresh
  413.     @command_window.activate
  414.   end
  415.  
  416.  
  417.   def next_actor
  418.     @actor = $game_party.menu_actor_next
  419.     on_actor_change
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 切换到上一个角色
  423.   #--------------------------------------------------------------------------
  424.   def prev_actor
  425.     @actor = $game_party.menu_actor_prev
  426.     on_actor_change
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 切换角色
  430.   #--------------------------------------------------------------------------
  431.   def on_actor_change
  432.     add_cancle
  433.     @status_window.actor = @actor
  434.     @command_window.actor = @actor
  435.     @command_window.activate
  436.   end
  437.  
  438. end
  439.  
  440. class Window_MenuCommand < Window_Command
  441.   alias add_original_commands_old add_original_commands
  442.   def add_original_commands
  443.     add_original_commands_old
  444.     add_command(Point_Tree::ADDPOINT,    :addpoint)
  445.   end
  446. end
  447.  
  448. class Scene_Menu < Scene_MenuBase
  449.   alias create_command_window_old create_command_window
  450.   def create_command_window
  451.     create_command_window_old
  452.     @command_window.set_handler(:addpoint,method(:add_point))
  453.   end
  454.   def add_point
  455.     @status_window.select_last
  456.     @status_window.activate
  457.     @status_window.set_handler(:ok,     method(:on_ok))
  458.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  459.   end
  460.   def on_ok
  461.     SceneManager.call(Scene_Point)
  462.     Window_Point_Command::init_command_position
  463.   end
  464. end
  465.  
  466.  
  467.  
  468. class Scene_ItemBase < Scene_MenuBase
  469.   def item_usable?
  470.     if item.id == Point_Tree::RESET_ITEM and item.is_a?(RPG::Item)
  471.       return true
  472.     end
  473.     user.usable?(item) && item_effects_valid?
  474.   end
  475. end
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482. class Window_Status < Window_Selectable
  483.   include Point_Tree
  484.   alias draw_parameters_old draw_parameters
  485.   def draw_parameters(x, y)
  486.     draw_parameters_old(x,y)
  487.     draw_point(x,y)
  488.   end
  489.   def draw_point(x,y)
  490.     for i in 0..5
  491.       change_color(system_color)
  492.       draw_text(x+100, y+ line_height * i, 80, line_height, STR_POINT[i])
  493.       change_color(normal_color)
  494.       draw_text(x+180, y+ line_height * i, 36, line_height,@actor.point[i+1].to_s, 2)
  495.     end
  496.   end
  497.  
  498. end
  499.  
  500. class Window_Base < Window
  501.   def draw_actor_param(actor, x, y, param_id)
  502.     change_color(system_color)
  503.     draw_text(x-30, y, 80, line_height, Vocab::param(param_id))
  504.     change_color(normal_color)
  505.     draw_text(x+ 50, y, 36, line_height, actor.param(param_id), 2)
  506.   end
  507. end
   
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-26 05:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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