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

Project1

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

[已经过期] 能力值改成百分比显示或者小数

[复制链接]

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
跳转到指定楼层
1
发表于 2014-1-16 01:44:41 | 显示全部楼层 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
先上图吧


命中1  回避5  会心49   可不不可以用百分比显示呀?1%    5%     49%   


或者小数显示 0.01     0.05     4.9


整数着实不好看呀。。。。。




点评

在描绘能力值的地方加个%号不就可以了!  发表于 2014-1-16 07:39

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
2
 楼主| 发表于 2014-1-16 14:07:30 | 显示全部楼层
令狐林 发表于 2014-1-16 09:35
试试这个脚本,或者从这里提供思路改一下你的脚本

我不会改这个外站脚本,感谢回答!
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
3
 楼主| 发表于 2014-1-16 14:08:45 | 显示全部楼层
白痴地问一句在哪里改呀?我是脚本盲。。。。。。说个大概的位置

点评

请问您要改的是什么?  发表于 2014-1-16 14:37
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
4
 楼主| 发表于 2014-1-16 15:55:58 | 显示全部楼层
流浪杰哥 发表于 2014-1-16 14:08
白痴地问一句在哪里改呀?我是脚本盲。。。。。。说个大概的位置

那啥命中率 回避率  必杀率   改成用小数显示,不用整数显示   ,我想配合那个装备说明增强脚本。。。。。

点评

请先附上你使用的装备说明增强脚本……  发表于 2014-1-16 18:58
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
5
 楼主| 发表于 2014-1-17 22:37:07 | 显示全部楼层
流浪杰哥 发表于 2014-1-16 15:55
那啥命中率 回避率  必杀率   改成用小数显示,不用整数显示   ,我想配合那个装备说明增强脚本。。。。 ...
  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 = 0 #修改长度的地方
  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 = 0)
  160.     super(0, 0, 270, 0)
  161.     self.z = 150
  162.     contents.font.size = 18
  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 =  18 #字体大小
  187.     change_color(Color.new(100, -55, 205))
  188.     rect.x -= window.ox
  189.     rect.y -= window.oy
  190.     ax = rect.x + rect.width + 14
  191.     ax = rect.x - self.width + 0 if ax + self.width > window.width + 10
  192.     ax += window.x
  193.     ax = 0 if ax < 0
  194.     ay = rect.y + rect.height
  195.     ay = rect.y - self.height if ay + self.height > window.height
  196.     ay += window.y
  197.     ay = 0 if ay < 0
  198.     self.x = ax
  199.     self.y = ay
  200.     set_text(@xtext)
  201.     show
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 设置物品
  205.   #     item : 技能、物品等
  206.   #--------------------------------------------------------------------------
  207.   def set_item(item)
  208.     if item == nil
  209.       set_text("")
  210.       return
  211.     end
  212.     @xtext = ""
  213.     @xtext = "名称:" + item.name + "\n"
  214.     @xtext += "品质:" + item.description + "\n"
  215.     @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
  216.     @xtext += Help.getequiphelp(item) if item.is_a?(RPG::EquipItem)
  217.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 刷新
  221.   #--------------------------------------------------------------------------
  222.   def refresh
  223.     contents.clear
  224.     hide if @text == ""
  225.     draw_text_ex(2, 2, @text,width,5,false)
  226.   end
  227. end

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

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

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

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

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

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

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
6
 楼主| 发表于 2014-1-17 22:41:48 | 显示全部楼层
流浪杰哥 发表于 2014-1-16 15:55
那啥命中率 回避率  必杀率   改成用小数显示,不用整数显示   ,我想配合那个装备说明增强脚本。。。。 ...

用了装备说明增强脚本,这个脚本在显示必杀率,闪避率,都是用小数显示的,能不能弄成整数显示呀?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7757
在线时间
1348 小时
注册时间
2012-6-6
帖子
345
7
 楼主| 发表于 2019-2-21 23:10:37 | 显示全部楼层
流浪杰哥 发表于 2014-1-16 15:55
那啥命中率 回避率  必杀率   改成用小数显示,不用整数显示   ,我想配合那个装备说明增强脚本。。。。 ...

我现在回复你不算晚哪。。。。。。皮一下
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-10 12:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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