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

Project1

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

[已经解决] 新手求助~为什么我的VA菜单不显示人物TP值呢?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-1-23
帖子
46
跳转到指定楼层
1
发表于 2014-10-9 11:43:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
为什么我的VA菜单不显示人物TP值呢?实在是不懂呢,请朋友帮帮忙哩,非常感激哩~

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-1-23
帖子
46
2
 楼主| 发表于 2014-10-9 11:59:18 | 只看该作者
脚本里的绘制TP也正常呀,为什么在菜单里只显示人物的生命和魔法,而没有TP呢?

#--------------------------------------------------------------------------
  # ● 绘制 TP
  #--------------------------------------------------------------------------
  def draw_actor_tp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::tp_a)
    change_color(tp_color(actor))
    draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
  end

点评

默认的脚本菜单界面绘制状态里没有调用这个方法  发表于 2014-10-9 12:08
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
9966
在线时间
5019 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

3
发表于 2014-10-9 12:07:55 | 只看该作者
本帖最后由 VIPArcher 于 2014-10-9 12:35 编辑

https://rpg.blue/thread-365977-1-1.html这里有个高级点的。
使用请注意这里的公告→请务必完整地看一遍公告

要显示TP值的角色特性里面添加上特技专注
  1. class Window_Base < Window
  2.   alias vip_20141009_simple_status draw_actor_simple_status
  3.   #--------------------------------------------------------------------------
  4.   # ● 绘制简单的状态
  5.   #--------------------------------------------------------------------------
  6.   def draw_actor_simple_status(actor, x, y)
  7.     vip_20141009_simple_status(actor, x, y)
  8.     draw_actor_tp(actor, x + 120, y + line_height * 3) if actor.preserve_tp?
  9.   end
  10. end
复制代码
未测试

点评

其实我群组里有一个……  发表于 2014-10-9 12:31

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
269 小时
注册时间
2014-5-9
帖子
127

开拓者

4
发表于 2014-10-9 12:23:32 | 只看该作者
因为默认情况下,TP的最大值固定为100,初始值则在每次开始战斗时随机分配,在菜单中显示了TP也一点意义都没有。

点评

啊,对哦。我改改上面的脚本  发表于 2014-10-9 12:31
泉眼无声惜细流,树阴照水爱晴柔。
小荷才露尖尖角,早有蜻蜓立上头。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
98
在线时间
1617 小时
注册时间
2013-8-15
帖子
4459
5
发表于 2014-10-9 13:25:58 | 只看该作者

  1. #==============================================================================
  2. # ■ Window_Base
  3. #------------------------------------------------------------------------------
  4. #  游戏中所有窗口的父类
  5. #==============================================================================

  6. class Window_Base < Window
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化
  9.   #--------------------------------------------------------------------------
  10.   def initialize(x, y, width, height)
  11.     super
  12.     self.windowskin = Cache.system("Window")
  13.     update_padding
  14.     update_tone
  15.     create_contents
  16.     @opening = @closing = false
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 释放
  20.   #--------------------------------------------------------------------------
  21.   def dispose
  22.     contents.dispose unless disposed?
  23.     super
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 取得行高
  27.   #--------------------------------------------------------------------------
  28.   def line_height
  29.     return 24
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 取得标准的边距尺寸
  33.   #--------------------------------------------------------------------------
  34.   def standard_padding
  35.     return 12
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● 更新边距
  39.   #--------------------------------------------------------------------------
  40.   def update_padding
  41.     self.padding = standard_padding
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● 计算窗口内容的宽度
  45.   #--------------------------------------------------------------------------
  46.   def contents_width
  47.     width - standard_padding * 2
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 计算窗口内容的高度
  51.   #--------------------------------------------------------------------------
  52.   def contents_height
  53.     height - standard_padding * 2
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● 计算窗口显示指定行数时的应用高度
  57.   #--------------------------------------------------------------------------
  58.   def fitting_height(line_number)
  59.     line_number * line_height + standard_padding * 2
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 色调的更新
  63.   #--------------------------------------------------------------------------
  64.   def update_tone
  65.     self.tone.set($game_system.window_tone)
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 生成窗口内容
  69.   #--------------------------------------------------------------------------
  70.   def create_contents
  71.     contents.dispose
  72.     if contents_width > 0 && contents_height > 0
  73.       self.contents = Bitmap.new(contents_width, contents_height)
  74.     else
  75.       self.contents = Bitmap.new(1, 1)
  76.     end
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 帧更新
  80.   #--------------------------------------------------------------------------
  81.   def update
  82.     super
  83.     update_tone
  84.     update_open if @opening
  85.     update_close if @closing
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 打开处理的更新
  89.   #--------------------------------------------------------------------------
  90.   def update_open
  91.     self.openness += 48
  92.     @opening = false if open?
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 关闭处理的更新
  96.   #--------------------------------------------------------------------------
  97.   def update_close
  98.     self.openness -= 48
  99.     @closing = false if close?
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 打开窗口
  103.   #--------------------------------------------------------------------------
  104.   def open
  105.     @opening = true unless open?
  106.     @closing = false
  107.     self
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 关闭窗口
  111.   #--------------------------------------------------------------------------
  112.   def close
  113.     @closing = true unless close?
  114.     @opening = false
  115.     self
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ● 显示窗口
  119.   #--------------------------------------------------------------------------
  120.   def show
  121.     self.visible = true
  122.     self
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 隐藏窗口
  126.   #--------------------------------------------------------------------------
  127.   def hide
  128.     self.visible = false
  129.     self
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 启用窗口
  133.   #--------------------------------------------------------------------------
  134.   def activate
  135.     self.active = true
  136.     self
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 冻结窗口
  140.   #--------------------------------------------------------------------------
  141.   def deactivate
  142.     self.active = false
  143.     self
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 取得文字颜色
  147.   #     n : 文字颜色号数(0..31)
  148.   #--------------------------------------------------------------------------
  149.   def text_color(n)
  150.     windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 取得各种文字颜色
  154.   #--------------------------------------------------------------------------
  155.   def normal_color;      text_color(0);   end;    # 普通
  156.   def system_color;      text_color(16);  end;    # 系统
  157.   def crisis_color;      text_color(17);  end;    # 危险
  158.   def knockout_color;    text_color(18);  end;    # 战斗不能
  159.   def gauge_back_color;  text_color(19);  end;    # 值槽背景
  160.   def hp_gauge_color1;   text_color(20);  end;    # HP 值槽 1
  161.   def hp_gauge_color2;   text_color(21);  end;    # HP 值槽 2
  162.   def mp_gauge_color1;   text_color(22);  end;    # MP 值槽 1
  163.   def mp_gauge_color2;   text_color(23);  end;    # MP 值槽 2
  164.   def mp_cost_color;     text_color(23);  end;    # 消费 TP
  165.   def power_up_color;    text_color(24);  end;    # 能力值提升(变更装备时)
  166.   def power_down_color;  text_color(25);  end;    # 能力值降低(变更装备时)
  167.   def tp_gauge_color1;   text_color(28);  end;    # TP 值槽 1
  168.   def tp_gauge_color2;   text_color(29);  end;    # TP 值槽 2
  169.   def tp_cost_color;     text_color(29);  end;    # 消费 TP
  170.   #--------------------------------------------------------------------------
  171.   # ● 取得保留项目的背景色
  172.   #--------------------------------------------------------------------------
  173.   def pending_color
  174.     windowskin.get_pixel(80, 80)
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 取得半透明描画用的透明度
  178.   #--------------------------------------------------------------------------
  179.   def translucent_alpha
  180.     return 160
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ● 变更内容描画色
  184.   #     enabled : 有效的标帜。false 的时候使用半透明效果描画
  185.   #--------------------------------------------------------------------------
  186.   def change_color(color, enabled = true)
  187.     contents.font.color.set(color)
  188.     contents.font.color.alpha = translucent_alpha unless enabled
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 描画内容
  192.   #     args : 与 Bitmap#draw_text 相同
  193.   #--------------------------------------------------------------------------
  194.   def draw_text(*args)
  195.     contents.draw_text(*args)
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● 取得内容尺寸
  199.   #--------------------------------------------------------------------------
  200.   def text_size(str)
  201.     contents.text_size(str)
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 描画带有控制符的文本内容
  205.   #--------------------------------------------------------------------------
  206.   def draw_text_ex(x, y, text)
  207.     reset_font_settings
  208.     text = convert_escape_characters(text)
  209.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  210.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ● 重置字体设定
  214.   #--------------------------------------------------------------------------
  215.   def reset_font_settings
  216.     change_color(normal_color)
  217.     contents.font.size = Font.default_size
  218.     contents.font.bold = false
  219.     contents.font.italic = false
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ● 进行控制符的事前变换
  223.   #    在实际描画前、将控制符替换为实际的内容。
  224.   #    为了减少歧异,文字「\」会被首先替换为转义符(\e)。
  225.   #--------------------------------------------------------------------------
  226.   def convert_escape_characters(text)
  227.     result = text.to_s.clone
  228.     result.gsub!(/\\/)            { "\e" }
  229.     result.gsub!(/\e\e/)          { "\\" }
  230.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  231.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  232.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  233.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  234.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  235.     result
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● 取得第 n 号角色的名字
  239.   #--------------------------------------------------------------------------
  240.   def actor_name(n)
  241.     actor = n >= 1 ? $game_actors[n] : nil
  242.     actor ? actor.name : ""
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● 取得第 n 号队伍成员的名字
  246.   #--------------------------------------------------------------------------
  247.   def party_member_name(n)
  248.     actor = n >= 1 ? $game_party.members[n - 1] : nil
  249.     actor ? actor.name : ""
  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 "\n"   # 换行
  260.       process_new_line(text, pos)
  261.     when "\f"   # 翻页
  262.       process_new_page(text, pos)
  263.     when "\e"   # 控制符
  264.       process_escape_character(obtain_escape_code(text), text, pos)
  265.     else        # 普通文字
  266.       process_normal_character(c, pos)
  267.     end
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 处理普通文字
  271.   #--------------------------------------------------------------------------
  272.   def process_normal_character(c, pos)
  273.     text_width = text_size(c).width
  274.     draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  275.     pos[:x] += text_width
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 处理换行文字
  279.   #--------------------------------------------------------------------------
  280.   def process_new_line(text, pos)
  281.     pos[:x] = pos[:new_x]
  282.     pos[:y] += pos[:height]
  283.     pos[:height] = calc_line_height(text)
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ● 处理翻页文字
  287.   #--------------------------------------------------------------------------
  288.   def process_new_page(text, pos)
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● 取得控制符的实际形式(这个方法会破坏原始数据)
  292.   #--------------------------------------------------------------------------
  293.   def obtain_escape_code(text)
  294.     text.slice!(/^[\$\.\|\^!><\{\}\\]|^[A-Z]+/i)
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● 取得控制符的参数(这个方法会破坏原始数据)
  298.   #--------------------------------------------------------------------------
  299.   def obtain_escape_param(text)
  300.     text.slice!(/^\[\d+\]/)[/\d+/].to_i rescue 0
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # ● 控制符的处理
  304.   #     code : 控制符的实际形式(比如「\C[1]」是「C」)
  305.   #     text : 描画处理中的字符串缓存(字符串可能会被修改)
  306.   #     pos  : 描画位置 {:x, :y, :new_x, :height}
  307.   #--------------------------------------------------------------------------
  308.   def process_escape_character(code, text, pos)
  309.     case code.upcase
  310.     when 'C'
  311.       change_color(text_color(obtain_escape_param(text)))
  312.     when 'I'
  313.       process_draw_icon(obtain_escape_param(text), pos)
  314.     when '{'
  315.       make_font_bigger
  316.     when '}'
  317.       make_font_smaller
  318.     end
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● 处理控制符指定的图标描画
  322.   #--------------------------------------------------------------------------
  323.   def process_draw_icon(icon_index, pos)
  324.     draw_icon(icon_index, pos[:x], pos[:y])
  325.     pos[:x] += 24
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● 放大字体尺寸
  329.   #--------------------------------------------------------------------------
  330.   def make_font_bigger
  331.     contents.font.size += 8 if contents.font.size <= 64
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ● 缩小字体尺寸
  335.   #--------------------------------------------------------------------------
  336.   def make_font_smaller
  337.     contents.font.size -= 8 if contents.font.size >= 16
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● 计算行高
  341.   #     restore_font_size : 计算完成后是否恢复原本的字体尺寸?
  342.   #--------------------------------------------------------------------------
  343.   def calc_line_height(text, restore_font_size = true)
  344.     result = [line_height, contents.font.size].max
  345.     last_font_size = contents.font.size
  346.     text.slice(/^.*$/).scan(/\e[\{\}]/).each do |esc|
  347.       make_font_bigger  if esc == "\e{"
  348.       make_font_smaller if esc == "\e}"
  349.       result = [result, contents.font.size].max
  350.     end
  351.     contents.font.size = last_font_size if restore_font_size
  352.     result
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● 描画值槽
  356.   #     rate   : 比率(1.0 为满值)
  357.   #     color1 : 渐变色的左端
  358.   #     color2 : 渐变色的右端
  359.   #--------------------------------------------------------------------------
  360.   def draw_gauge(x, y, width, rate, color1, color2)
  361.     fill_w = (width * rate).to_i
  362.     gauge_y = y + line_height - 8
  363.     contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  364.     contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  365. end
  366.   #--------------------------------------------------------------------------
  367.   # ● 描画图标
  368.   #     enabled : 有效的标帜。false 的时候使用半透明效果描画
  369.   #--------------------------------------------------------------------------
  370.   def draw_icon(icon_index, x, y, enabled = true)
  371.     bitmap = Cache.system("Iconset")
  372.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  373.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 描画头像
  377.   #     enabled : 有效的标帜。false 的时候使用半透明效果描画
  378.   #--------------------------------------------------------------------------
  379.   def draw_face(face_name, face_index, x, y, enabled = true)
  380.     bitmap = Cache.face(face_name)
  381.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
  382.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  383.     bitmap.dispose
  384.   end
  385.   #--------------------------------------------------------------------------
  386.   # ● 描画行走图
  387.   #--------------------------------------------------------------------------
  388.   def draw_character(character_name, character_index, x, y)
  389.     return unless character_name
  390.     bitmap = Cache.character(character_name)
  391.     sign = character_name[/^[\!\$]./]
  392.     if sign && sign.include?('$')
  393.       cw = bitmap.width / 3
  394.       ch = bitmap.height / 4
  395.     else
  396.       cw = bitmap.width / 12
  397.       ch = bitmap.height / 8
  398.     end
  399.     n = character_index
  400.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  401.     contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 取得 HP 的文字颜色
  405.   #--------------------------------------------------------------------------
  406.   def hp_color(actor)
  407.     return knockout_color if actor.hp == 0
  408.     return crisis_color if actor.hp < actor.mhp / 4
  409.     return normal_color
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● 取得 MP 的文字颜色
  413.   #--------------------------------------------------------------------------
  414.   def mp_color(actor)
  415.     return crisis_color if actor.mp < actor.mmp / 4
  416.     return normal_color
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● 取得 TP 的文字颜色
  420.   #--------------------------------------------------------------------------
  421.   def tp_color(actor)
  422.     return normal_color
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● 描画角色行走图
  426.   #--------------------------------------------------------------------------
  427.   def draw_actor_graphic(actor, x, y)
  428.     draw_character(actor.character_name, actor.character_index, x, y)
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● 描画角色头像
  432.   #--------------------------------------------------------------------------
  433.   def draw_actor_face(actor, x, y, enabled = true)
  434.     draw_face(actor.face_name, actor.face_index, x, y, enabled)
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ● 描画名字
  438.   #--------------------------------------------------------------------------
  439.   def draw_actor_name(actor, x, y, width = 112)
  440.     change_color(hp_color(actor))
  441.     draw_text(x, y, width, line_height, actor.name)
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● 描画职业
  445.   #--------------------------------------------------------------------------
  446.   def draw_actor_class(actor, x, y, width = 112)
  447.     change_color(normal_color)
  448.     draw_text(x, y, width, line_height, actor.class.name)
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● 描画称号
  452.   #--------------------------------------------------------------------------
  453.   def draw_actor_nickname(actor, x, y, width = 180)
  454.     change_color(normal_color)
  455.     draw_text(x, y, width, line_height, actor.nickname)
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # ● 描画强化/弱化状态的图标
  459.   #--------------------------------------------------------------------------
  460.   def draw_actor_icons(actor, x, y, width = 96)
  461.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  462.     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● 以 当前值/最大值 这样的分数形式描画当前值和最大值
  466.   #     current : 当前值
  467.   #     max     : 最大值
  468.   #     color1  : 当前值的颜色
  469.   #     color2  : 最大值的颜色
  470.   #--------------------------------------------------------------------------
  471.   def draw_current_and_max_values(x, y, width, current, max, color1, color2)
  472.     change_color(color1)
  473.     xr = x + width
  474.     if width < 96
  475.       draw_text(xr - 40, y, 42, line_height, current, 2)
  476.     else
  477.       draw_text(xr - 92, y, 42, line_height, current, 2)
  478.       change_color(color2)
  479.       draw_text(xr - 52, y, 12, line_height, "/", 2)
  480.       draw_text(xr - 42, y, 42, line_height, max, 2)
  481.     end
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● 描画 HP
  485.   #--------------------------------------------------------------------------
  486.   def draw_actor_hp(actor, x, y, width = 230)
  487.     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  488.     change_color(system_color)
  489.     draw_text(x, y, 35, line_height, Vocab::hp_a)
  490.     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  491.       hp_color(actor), normal_color)
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # ● 描画 MP
  495.   #--------------------------------------------------------------------------
  496.   def draw_actor_mp(actor, x, y, width = 230)
  497.     draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  498.     change_color(system_color)
  499.     draw_text(x, y, 35, line_height, Vocab::mp_a)
  500.     draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  501.       mp_color(actor), normal_color)
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ● 描画 TP
  505.   #--------------------------------------------------------------------------
  506.   def draw_actor_tp(actor, x, y, width = 230)
  507.     draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  508.     change_color(system_color)
  509.     draw_text(x, y, 35, line_height, Vocab::tp_a)
  510.     change_color(tp_color(actor))
  511.     draw_text(x + width - 40, y, 40, line_height, actor.tp.to_i, 2)
  512.   end
  513.   #--------------------------------------------------------------------------
  514.   # ● 绘制等级
  515.   #--------------------------------------------------------------------------
  516. module Freya
  517.   ExpGaugeColor1 = Color.new(192,128,255)
  518.   ExpGaugeColor2 = Color.new(204,192,255)
  519. end
  520.   def draw_actor_level(actor, x, y)
  521.     a = actor.next_level_exp - actor.current_level_exp
  522.     b = actor.next_level_exp - actor.exp
  523.     rate = 1 - (b.to_f / a)
  524.     draw_gauge(x, y, 96, rate,Freya::ExpGaugeColor1, Freya::ExpGaugeColor2)
  525.     change_color(system_color)
  526.     draw_text(x, y, 32, line_height, Vocab::level_a)
  527.     change_color(normal_color)
  528.     draw_text(x + 32, y, 24, line_height, actor.level, 2)
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● 绘制简单的状态
  532.   #--------------------------------------------------------------------------
  533.   def draw_actor_simple_status(actor, x, y)
  534.     draw_actor_name(actor, x, y)
  535.     draw_actor_icons(actor, x, y + line_height * 2)
  536.     draw_actor_class(actor, x + 120, y - line_height * 0.5)
  537.     draw_actor_level(actor, x + 120, y + line_height * 0.5)
  538.     draw_actor_hp(actor, x + 120, y + line_height * 1.1) #绘制HP,在原有位置上略调整
  539.     draw_actor_mp(actor, x + 120, y + line_height * 1.7) #绘制MP,在原有位置上略调整
  540.     draw_actor_tp(actor, x + 120, y + line_height * 2.3)  #绘制TP
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # ● 描画能力值
  544.   #--------------------------------------------------------------------------
  545.   def draw_actor_param(actor, x, y, param_id)
  546.     change_color(system_color)
  547.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  548.     change_color(normal_color)
  549.     draw_text(x + 120, y, 36, line_height, actor.param(param_id), 2)
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ● 描画物品名
  553.   #     enabled : 有效的标帜。false 的时候使用半透明效果描画
  554.   #--------------------------------------------------------------------------
  555.   def draw_item_name(item, x, y, enabled = true, width = 172)
  556.     return unless item
  557.     draw_icon(item.icon_index, x, y, enabled)
  558.     change_color(normal_color, enabled)
  559.     draw_text(x + 24, y, width, line_height, item.name)
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # ● 描画货币数值(持有金额之类的)
  563.   #--------------------------------------------------------------------------
  564.   def draw_currency_value(value, unit, x, y, width)
  565.     cx = text_size(unit).width
  566.     change_color(normal_color)
  567.     draw_text(x, y, width - cx - 2, line_height, value, 2)
  568.     change_color(system_color)
  569.     draw_text(x, y, width, line_height, unit, 2)
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ● 取得能力值变化的描画色
  573.   #--------------------------------------------------------------------------
  574.   def param_change_color(change)
  575.     return power_up_color   if change > 0
  576.     return power_down_color if change < 0
  577.     return normal_color
  578.   end
  579. end
复制代码
完全替换Window Base ,内附 EXP功能,TP功能

EXP由芙蕾娅 提供
神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-6 04:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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