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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
12 小时
注册时间
2012-11-16
帖子
6
跳转到指定楼层
1
发表于 2012-11-16 19:51:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
VA 如何在菜单里显示经验条

Lv1.梦旅人

梦石
0
星屑
50
在线时间
63 小时
注册时间
2009-3-25
帖子
38
2
发表于 2012-11-16 19:54:36 | 只看该作者
RUBY 代码复制
  1. #  ●設定區域
  2. #===================================
  3.  
  4. module WD
  5. module Exp_Gauge
  6.   #EXP條COLOR,請修改成TEXT文字
  7.   EXP_GAUGE_COLOR1 = 6
  8.   EXP_GAUGE_COLOR2 = 14
  9.  
  10.   #EXP條文字顯示設定,true為打開,false為關閉
  11.   EXP_TEXT_DISPLAY = false
  12. end
  13. end
  14.  
  15. #==============================================================================
  16. # ■ Window_Base
  17. #------------------------------------------------------------------------------
  18. #  ゲーム中の全てのウィンドウのスーパークラスです。
  19. #==============================================================================
  20.  
  21. class Window_Base < Window
  22.   include WD::Exp_Gauge
  23.  
  24.   def exp_gauge_color1;   text_color(EXP_GAUGE_COLOR1);  end;    # EXP ゲージ 1
  25.   def exp_gauge_color2;   text_color(EXP_GAUGE_COLOR2);  end;    # EXP ゲージ 2
  26.  
  27.   #--------------------------------------------------------------------------
  28.   # ● シンプルなステータスの描画
  29.   #--------------------------------------------------------------------------
  30.   def draw_actor_simple_status(actor, x, y)
  31.     draw_actor_name(actor, x, y + line_height * 0.5)
  32.     draw_actor_level(actor, x, y - line_height * 0.5)
  33.     draw_actor_icons(actor, x, y + line_height * 1.5)
  34.     draw_actor_class(actor, x + 120, y - line_height * 0.5)
  35.     draw_actor_hp(actor, x + 120, y + line_height * 0.5)
  36.     draw_actor_mp(actor, x + 120, y + line_height * 1.5)
  37.     draw_actor_exp(actor, x, y + line_height * 2.5, EXP_TEXT_DISPLAY)
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● EXP の描画
  41.   #--------------------------------------------------------------------------
  42.   def draw_actor_exp(actor, x, y, display = true, width = 244)
  43.     this_level = actor.exp - actor.past_level_exp
  44.     next_level = actor.next_level_exp - actor.past_level_exp
  45.     draw_gauge(x, y, width, actor.exp_rate, exp_gauge_color1, exp_gauge_color2)
  46.     change_color(system_color)
  47.     if display
  48.       draw_text(x, y, 30, line_height, "EXP")
  49.       draw_current_and_max_values(x, y, width, this_level, next_level, mp_color(actor), normal_color)
  50.     end
  51.   end
  52. end
  53.  
  54. class Game_Actor < Game_Battler
  55.   #--------------------------------------------------------------------------
  56.   # ● EXP の割合を取得
  57.   #--------------------------------------------------------------------------
  58.   def exp_rate
  59.     this_level = exp - past_level_exp
  60.     next_level = next_level_exp - past_level_exp
  61.     next_level > 0 ? this_level.to_f / next_level : 0
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 前のレベルの経験値を取得
  65.   #--------------------------------------------------------------------------
  66.   def past_level_exp
  67.     @level > 1 ? exp_for_level(@level - 1) : 0
  68.   end
  69. end

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 12:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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