查看: 3205|回复: 1

[已经解决] VA 如何在菜单里显示经验条

[复制链接]
梦石
0
星屑
50
在线时间
12 小时
注册时间
2012-11-16
回帖
1
发表于 2012-11-16 19:51:52 | 显示全部楼层 |阅读模式

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

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

×
VA 如何在菜单里显示经验条
梦石
0
星屑
50
在线时间
63 小时
注册时间
2009-3-25
回帖
28
发表于 2012-11-16 19:54:36 | 显示全部楼层
  1. #  ●設定區域
  2. #===================================

  3. module WD
  4. module Exp_Gauge
  5.   #EXP條COLOR,請修改成TEXT文字
  6.   EXP_GAUGE_COLOR1 = 6
  7.   EXP_GAUGE_COLOR2 = 14

  8.   #EXP條文字顯示設定,true為打開,false為關閉
  9.   EXP_TEXT_DISPLAY = false
  10. end
  11. end

  12. #==============================================================================
  13. # ■ Window_Base
  14. #------------------------------------------------------------------------------
  15. #  ゲーム中の全てのウィンドウのスーパークラスです。
  16. #==============================================================================

  17. class Window_Base < Window
  18.   include WD::Exp_Gauge

  19.   def exp_gauge_color1;   text_color(EXP_GAUGE_COLOR1);  end;    # EXP ゲージ 1
  20.   def exp_gauge_color2;   text_color(EXP_GAUGE_COLOR2);  end;    # EXP ゲージ 2

  21.   #--------------------------------------------------------------------------
  22.   # ● シンプルなステータスの描画
  23.   #--------------------------------------------------------------------------
  24.   def draw_actor_simple_status(actor, x, y)
  25.     draw_actor_name(actor, x, y + line_height * 0.5)
  26.     draw_actor_level(actor, x, y - line_height * 0.5)
  27.     draw_actor_icons(actor, x, y + line_height * 1.5)
  28.     draw_actor_class(actor, x + 120, y - line_height * 0.5)
  29.     draw_actor_hp(actor, x + 120, y + line_height * 0.5)
  30.     draw_actor_mp(actor, x + 120, y + line_height * 1.5)
  31.     draw_actor_exp(actor, x, y + line_height * 2.5, EXP_TEXT_DISPLAY)
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● EXP の描画
  35.   #--------------------------------------------------------------------------
  36.   def draw_actor_exp(actor, x, y, display = true, width = 244)
  37.     this_level = actor.exp - actor.past_level_exp
  38.     next_level = actor.next_level_exp - actor.past_level_exp
  39.     draw_gauge(x, y, width, actor.exp_rate, exp_gauge_color1, exp_gauge_color2)
  40.     change_color(system_color)
  41.     if display
  42.       draw_text(x, y, 30, line_height, "EXP")
  43.       draw_current_and_max_values(x, y, width, this_level, next_level, mp_color(actor), normal_color)
  44.     end
  45.   end
  46. end

  47. class Game_Actor < Game_Battler
  48.   #--------------------------------------------------------------------------
  49.   # ● EXP の割合を取得
  50.   #--------------------------------------------------------------------------
  51.   def exp_rate
  52.     this_level = exp - past_level_exp
  53.     next_level = next_level_exp - past_level_exp
  54.     next_level > 0 ? this_level.to_f / next_level : 0
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 前のレベルの経験値を取得
  58.   #--------------------------------------------------------------------------
  59.   def past_level_exp
  60.     @level > 1 ? exp_for_level(@level - 1) : 0
  61.   end
  62. end

复制代码

评分

参与人数 1梦石 +1 收起 理由
Mic_洛洛 + 1 认可答案,好人卡+1

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部