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

Project1

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

[已经过期] 这脚本实在是改不动了!

[复制链接]

Lv1.梦旅人

萌萌的小笼包

梦石
0
星屑
50
在线时间
193 小时
注册时间
2012-4-30
帖子
652
跳转到指定楼层
1
发表于 2012-11-24 09:49:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
蛮老的脚本了,VA的属性介绍,很不常见,我改了很多很多,但是有个BUG最头疼,就是购买道具,或者战斗的时候,选中了物品准备购买,选中了技能,要选择攻击对象的时候这个窗口还在,有时候还会挡住东西

有没有办法做到以下效果?
1:手动控制这个脚本的使用与禁止?比如按O可以开始,按P禁止
2:就是说选中东西后可以清楚掉?
3:手动清除窗口?

求解了,解决这个,这个脚本就很好了!

Lv1.梦旅人

萌萌的小笼包

梦石
0
星屑
50
在线时间
193 小时
注册时间
2012-4-30
帖子
652
2
 楼主| 发表于 2012-11-24 09:50:15 | 只看该作者
本帖最后由 冲啊小笼包 于 2012-11-24 09:51 编辑
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 装备说明增强
  4. #------------------------------------------------------------------------------
  5. #  修改了说明窗口,增强了装备的说明 作者:wyongcan  发布于66RPG   转载请注明
  6. #==============================================================================
  7. module Help
  8.   CODE ={
  9.     11 => "属性抗性",
  10.     12 => "弱化抗性",
  11.     13 => "状态抗性",
  12.     14 => "状态免疫",
  13.     21 => "普通能力",
  14.     22 => "添加能力",
  15.     23 => "特殊能力",
  16.     31 => "攻击附带属性",
  17.     32 => "攻击附带状态",
  18.     33 => "攻击速度",
  19.     34 => "添加攻击次数",
  20.     41 => "添加技能类型",
  21.     42 => "禁用技能类型",
  22.     43 => "添加技能",
  23.     44 => "禁用技能",
  24.     51 => "可装备武器类型",
  25.     52 => "可装备护甲类型",
  26.     53 => "固定装备",
  27.     54 => "禁用装备",
  28.     55 => "装备风格",
  29.     61 => "行动次数",
  30.     62 => "特殊标志",
  31.     63 => "消失效果",
  32.     64 => "队伍能力"}
  33.   #特殊标志
  34.   FLAG ={
  35.                 0 => "自动战斗",
  36.                 1 => "擅长防御",
  37.                 2 => "保护弱者",
  38.                 3 => "特技专注"}
  39.   #普通能力
  40.         PARAM ={
  41.                 0 => "生命上限",
  42.                 1 => "魔法上限",
  43.                 2 => "物理攻击",
  44.                 3 => "物理防御",
  45.                 4 => "魔法攻击",
  46.                 5 => "魔法防御",
  47.                 6 => "敏 捷 值",
  48.                 7 => "幸 运 值"}
  49.   #添加能力
  50.         XPARAM ={
  51.                 0 => "物理命中:",
  52.                 1 => "物理闪避几率:",
  53.                 2 => "必杀几率:",
  54.                 3 => "必杀闪避几率:",
  55.                 4 => "魔法闪避几率:",
  56.                 5 => "魔法反射几率:",
  57.                 6 => "物理反击几率:",
  58.                 7 => "体力值再生速度:",
  59.                 8 => "魔力值再生速度:",
  60.                 9 => "特技值再生速度:"}
  61.   #特殊能力
  62.         SPARAM ={
  63.                 0 => "受到攻击的几率",
  64.                 1 => "防御效果比率",
  65.                 2 => "恢复效果比率",
  66.                 3 => "药理知识",
  67.                 4 => "MP消耗率",
  68.                 5 => "TP消耗率",
  69.                 6 => "物理伤害加成",
  70.                 7 => "魔法伤害加成",
  71.                 8 => "地形伤害加成",
  72.                 9 => "经验加成"}
  73.    #效果范围
  74. #         SCOPE ={
  75. #                 0 => "特殊",
  76. #                 1 => "单个敌人",
  77. #                 2 => "全体敌人" ,
  78. #                 3 => "一个随机敌人",
  79. #                 4 => "两个随机敌人",
  80. #                 5 => "三个随机敌人",
  81. #                 6 => "四个随机敌人",
  82. #                 7 => "单个队友",
  83. #                 8 => "全体队友",
  84. #                 9 => "单个队友(无法战斗)",
  85. #                 10 => "全体队友(无法战斗)",
  86. #                 11 => "使用者"}
  87.         @队伍能力 ={
  88.                 0 => "遇敌几率减半",
  89.                 1 => "野外不遇敌",
  90.                 2 => "敌人偷袭无效",
  91.                 3 => "先制攻击几率上升",
  92.                 4 => "获得金钱双倍",
  93.                 5 => "物品掉落几率双倍"}
  94.   def self.ready
  95.     @状态 = {}
  96.     @武器类型 = {}
  97.     @防具类型 = {}
  98.     @属性 = {}
  99.     $data_states.each{|x| @状态[x.id] = x.name if x != nil}
  100.     elements = $data_system.elements
  101.     weapon_types = $data_system.weapon_types
  102.     armor_types = $data_system.armor_types
  103.     elements.each_with_index{|x,y| @属性[y] = x if x != ""}
  104.     weapon_types.each_with_index{|x,y| @武器类型[y] = x if x != ""}
  105.     armor_types.each_with_index{|x,y| @防具类型[y] = x if x != ""}
  106.   end
  107.   def self.getequiphelp(equip)
  108.     ready if @状态 == nil
  109.     help = ""
  110.     param = []
  111.     equip.params.each_with_index{|x,y| param.push([PARAM[y],x])}
  112.     param = param.select{|x| x[1] != 0}
  113.     param.each{|x| help += x[0] + ":" + x[1].to_s + "\n"}
  114.     features = equip.features
  115.     features.select{|x| x.code == 55}.each{|x| help += CODE[x.code] + ":双持武器" + "\n"}
  116.     features.select{|x| x.code == 11}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "X" + x.value.to_s + "\n"}
  117.     features.select{|x| x.code == 12}.each{|x| help += CODE[x.code] + ":" + PARAM[x.data_id] + "X" + x.value.to_s + "\n"}
  118.     features.select{|x| x.code == 13}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "X" + x.value.to_s + "\n"}
  119.     features.select{|x| x.code == 14}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "\n"}
  120.     features.select{|x| x.code == 31}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "\n"}
  121.     features.select{|x| x.code == 32}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "+" + x.value.to_s + "\n"}
  122.     features.select{|x| x.code == 33}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
  123.     features.select{|x| x.code == 34}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
  124.     features.select{|x| x.code == 41}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
  125.     features.select{|x| x.code == 42}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
  126.     features.select{|x| x.code == 43}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
  127.     features.select{|x| x.code == 44}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
  128.     features.select{|x| x.code == 51}.each{|x| help += CODE[x.code] + ":" + @武器类型[x.data_id]  + "\n"}
  129.     features.select{|x| x.code == 52}.each{|x| help += CODE[x.code] + ":" + @防具类型[x.data_id]  + "\n"}
  130.     features.select{|x| x.code == 61}.each{|x| help += CODE[x.code] + ":" + x.value.to_s  + "\n"}
  131.     features.select{|x| x.code == 62}.each{|x| help += CODE[x.code] + ":" + FLAG[x.data_id]  + "\n"}
  132.     features.select{|x| x.code == 64}.each{|x| help += CODE[x.code] + ":" + @队伍能力[x.data_id]  + "\n"}
  133.     featuresparam = []
  134.     featuresparam.push features.select{|x| x.code == 21}
  135.     featuresparam.push features.select{|x| x.code == 22}
  136.     featuresparam.push features.select{|x| x.code == 23}
  137.     featuresparam[0].each{|x| help += PARAM[x.data_id] + "X" + x.value.to_s + "\n"}
  138.     featuresparam[1].each{|x| help += XPARAM[x.data_id] + x.value.to_s + "\n"}
  139.     featuresparam[2].each{|x| help += SPARAM[x.data_id] + "X" + x.value.to_s + "\n"}
  140.     help
  141.   end
  142.   def self.getline(text,maxtext)
  143.     xtext = []
  144.     line = 2 #修改长度的地方(10)
  145.     text.each_line{|x| xtext.push x.sub(/\n/){}}
  146.     xtext.each{|x| x.size % maxtext != 0 ? line += x.size / maxtext + 1 : line += x.size / maxtext}
  147.     line
  148.   end
  149. end
  150. #==============================================================================
  151. # ■ Window_Help
  152. #------------------------------------------------------------------------------
  153. #  显示特技和物品等的说明、以及角色状态的窗口
  154. #==============================================================================

  155. class Window_Help < Window_Base
  156.   #--------------------------------------------------------------------------
  157.   # ● 初始化对象
  158.   #--------------------------------------------------------------------------
  159.   def initialize(line_number = 100)
  160.     super(0, 0, 260, 0) #(0, 0, 260, 0)
  161.     self.z = 150
  162.     contents.font.size = 14#(14)
  163.     hide
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ● 设置内容
  167.   #--------------------------------------------------------------------------
  168.   def set_text(text)
  169.     if text != @text
  170.       @text = text
  171.       refresh
  172.     end
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● 清除
  176.   #--------------------------------------------------------------------------
  177.   def clear
  178.     set_text("")
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● 更新帮助位置
  182.   #--------------------------------------------------------------------------
  183.   def uppos(index,rect,window)
  184.     self.height = fitting_height2(Help.getline(@xtext,13))
  185.     create_contents
  186.     contents.font.size =  16 #字体大小(16)
  187.     rect.x -= window.ox
  188.     rect.y -= window.oy
  189.     ax = rect.x + rect.width + 10
  190.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
  191.     ax += window.x
  192.     ax = 0 if ax < 0
  193.     ay = rect.y + rect.height
  194.     ay = rect.y - self.height if ay + self.height > window.height
  195.     ay += window.y
  196.     ay = 0 if ay < 0
  197.     self.x = ax
  198.     self.y = ay
  199.     set_text(@xtext)
  200.     show
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 设置物品
  204.   #     item : 技能、物品等
  205.   #--------------------------------------------------------------------------
  206.   def set_item(item)
  207.     if item == nil
  208.       set_text("")
  209.       return
  210.     end
  211.     @xtext =  ""
  212.     @xtext =  "名称:" + item.name + "\n"
  213.     @xtext += "简介:" + item.description + "\n"
  214.     @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
  215.     @xtext += Help.getequiphelp(item) if item.is_a?(RPG::EquipItem)
  216.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 刷新
  220.   #--------------------------------------------------------------------------
  221.   def refresh
  222.     contents.clear
  223.     hide if @text == ""
  224.     draw_text_ex(2, 2, @text,width,5,false)
  225.   end
  226. end

  227. class Window_Base < Window
  228.   #--------------------------------------------------------------------------
  229.   # ● 计算窗口显示指定行数时的应用高度2
  230.   #--------------------------------------------------------------------------
  231.   def fitting_height2(line_number)
  232.     line_number * contents.font.size + standard_padding * 2
  233.   end
  234. #~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  235.   #--------------------------------------------------------------------------
  236.   # ● 绘制带有控制符的文本内容
  237.   #   如果传递了width参数的话,会自动换行
  238.   #--------------------------------------------------------------------------
  239.   def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)
  240.     reset_font_settings if normalfont == true
  241.     text = convert_escape_characters(text)
  242.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  243.     if width != nil
  244.       pos[:height] = contents.font.size
  245.       pos[:width] = width
  246.       pos[:textwidth] = textwidth
  247.     end
  248.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ● 文字的处理
  252.   #     c    : 文字
  253.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  254.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  255.   #--------------------------------------------------------------------------
  256.   def process_character(c, text, pos)
  257.     case c
  258.     when "\r"   # 回车
  259.       return
  260.     when "\n"   # 换行
  261.       process_new_line(text, pos)
  262.     when "\f"   # 翻页
  263.       process_new_page(text, pos)
  264.     when "\e"   # 控制符
  265.       process_escape_character(obtain_escape_code(text), text, pos)
  266.     else        # 普通文字
  267.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
  268.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
  269.         process_new_line(text, pos)
  270.       end
  271.       process_normal_character(c, pos)
  272.     end
  273.   end
  274. end

  275. class Window_ItemList < Window_Selectable
  276.   #--------------------------------------------------------------------------
  277.   # ● 更新帮助内容
  278.   #--------------------------------------------------------------------------
  279.   def update_help
  280.     @help_window.set_item(item)
  281.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  282.   end
  283. end

  284. class Window_SkillList < Window_Selectable
  285.   #--------------------------------------------------------------------------
  286.   # ● 更新帮助内容
  287.   #--------------------------------------------------------------------------
  288.   def update_help
  289.     @help_window.set_item(item)
  290.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  291.   end
  292. end

  293. class Window_ShopBuy < Window_Selectable
  294.   #--------------------------------------------------------------------------
  295.   # ● 更新帮助内容
  296.   #--------------------------------------------------------------------------
  297.   def update_help
  298.     @help_window.set_item(item) if @help_window
  299.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
  300.     @status_window.item = item if @status_window
  301.   end
  302. end

  303. class Window_EquipSlot < Window_Selectable
  304.   #--------------------------------------------------------------------------
  305.   # ● 更新帮助内容
  306.   #--------------------------------------------------------------------------
  307.   def update_help
  308.     super
  309.     @help_window.set_item(item) if @help_window
  310.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
  311.     @status_window.set_temp_actor(nil) if @status_window
  312.   end
  313. end

  314. class Scene_Shop < Scene_MenuBase
  315.         alias on_sell_ok_old on_sell_ok
  316.         def on_sell_ok
  317.                 on_sell_ok_old
  318.                 @help_window.hide
  319.         end
  320.         alias on_buy_ok_old on_buy_ok
  321.         def on_buy_ok
  322.                 on_buy_ok_old
  323.                 @help_window.hide
  324.         end
  325.         alias on_number_ok_old on_number_ok
  326.         def on_number_ok
  327.                 on_number_ok_old
  328.     @help_window.refresh
  329.                 @help_window.show
  330.         end
  331.         alias on_number_cancel_old on_number_cancel
  332.         def on_number_cancel
  333.                 on_number_cancel_old
  334.     @help_window.refresh
  335.                 @help_window.show
  336.         end
  337. end

  338. class Scene_Title < Scene_Base
  339.   alias start_old start
  340.   def start
  341.     start_old
  342.     Help.ready
  343.   end
  344. end
  345. class Window_Base < Window
  346.         alias old_process_new_line process_new_line
  347.         def process_new_line(text, pos)
  348.     old_process_new_line(text, pos)
  349.                 pos[:height] = contents.font.size if pos[:width] != nil
  350.         end
  351. end
  352. class Scene_ItemBase < Scene_MenuBase
  353.         alias old_on_actor_cancel on_actor_cancel
  354.   def on_actor_cancel
  355.     old_on_actor_cancel
  356.         @help_window.refresh
  357.   end
  358.         alias old_on_actor_ok on_actor_ok
  359.   def on_actor_ok
  360.     old_on_actor_ok
  361.         @help_window.refresh
  362.   end
  363. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

萌萌的小笼包

梦石
0
星屑
50
在线时间
193 小时
注册时间
2012-4-30
帖子
652
3
 楼主| 发表于 2012-11-24 09:52:06 | 只看该作者
需要的同学不要截取啊,这个BUG不解决没法用的=.=以后会整合出来的!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

萌萌的小笼包

梦石
0
星屑
50
在线时间
193 小时
注册时间
2012-4-30
帖子
652
4
 楼主| 发表于 2012-11-25 14:39:23 | 只看该作者
没有人会?只好联系作者了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 17:59

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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