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

Project1

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

[RMVA发布] 角色圖鑑ver.1.0

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
131 小时
注册时间
2012-7-3
帖子
121
跳转到指定楼层
1
发表于 2013-8-13 20:17:46 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 冰鎮史萊姆 于 2013-8-13 20:21 编辑

可以看到現時角色資訊的圖鑑
PS 有用就拿去吧



RUBY 代码复制
  1. #===========================================================================
  2. # [VA]角色圖鑑 ver.1.0                                           by 冰鎮史萊姆
  3. #===========================================================================
  4. =begin
  5. 使用方法:
  6. 開啟角色 $game_switches[x] = true x為角色id+1000
  7. 例 開啟角色id 1號 $game_switches[1001] = true
  8. HIDE_ACTOR_ID 為不出現在圖鑑中的角色ID
  9. HIDE_JOB_ID 為不出現在圖鑑中的職業ID
  10. NONE 為未開啟圖鑑中的角色時顯示
  11. EXP 為EXP的名稱
  12. 開圖鑑用 SceneManager.call(Scene_CharBook)
  13. =end
  14. module ICE_CharBook
  15.   HIDE_ACTOR_ID = []
  16.   HIDE_JOB_ID = [6, 7, 8, 9, 10]
  17.   NONE = "甚麼也沒有"
  18.   EXP = "EXP"
  19. end
  20.  
  21.  
  22. class Window_CharBook_List < Window_Selectable
  23.   include ICE_CharBook
  24.   #-------------------------------------------------------------------------
  25.   # ● 公開实例变量
  26.   #-------------------------------------------------------------------------
  27.   attr_reader   :status_window
  28.   #-------------------------------------------------------------------------
  29.   # ● 初始化对象
  30.   #-------------------------------------------------------------------------
  31.   def initialize(x, y, width, height)
  32.     super(x, y, width, height)
  33.     @char_id = []
  34.     @data = {}
  35.     $data_actors.each do |x|
  36.       next if x == nil or ICE_CharBook::HIDE_ACTOR_ID.include?(x.id) or ICE_CharBook::HIDE_JOB_ID.include?(x.class_id)
  37.       @char_id.push(x.id)
  38.     end
  39.     @char_id.each do |x|
  40.       @data[$data_actors[x].class_id] = Array.new
  41.     end
  42.     @char_id.each do |x|
  43.       @data[$data_actors[x].class_id].push(x)
  44.     end
  45.     @current_job = nil
  46.   end
  47.   #-------------------------------------------------------------------------
  48.   # ● 取得項目數
  49.   #-------------------------------------------------------------------------
  50.   def item_max
  51.     @n_data ? @n_data.size : 1
  52.   end
  53.   #-------------------------------------------------------------------------
  54.   # ● 取得項目
  55.   #-------------------------------------------------------------------------
  56.   def item
  57.     $game_actors[@n_data[index]]
  58.   end
  59.   #-------------------------------------------------------------------------
  60.   # ● 取得當前職業
  61.   #-------------------------------------------------------------------------
  62.   def get_current_job(current_job)
  63.     @current_job = current_job
  64.     @n_data = @data[current_job]
  65.     refresh
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 刷新
  69.   #--------------------------------------------------------------------------
  70.   def refresh
  71.     create_contents
  72.     draw_all_items
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ● 項目の描画
  76.   #--------------------------------------------------------------------------
  77.   def draw_item(index)
  78.     item = $game_actors[@n_data[index]]
  79.     rect = item_rect(index)
  80.     if $game_switches[1000 + item.id]
  81.       draw_actor_name(item, rect.x, rect.y, width = 112)
  82.     else
  83.       draw_text(rect,"-------",1)
  84.     end
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 狀態の設定
  88.   #--------------------------------------------------------------------------
  89.   def status_window=(status_window)
  90.     @status_window = status_window
  91.      call_update_help
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 调用狀態窗口的更新方法
  95.   #--------------------------------------------------------------------------
  96.   def call_update_help
  97.     update_help if active && @status_window
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● 狀態更新
  101.   #--------------------------------------------------------------------------
  102.   def update_help
  103.     @status_window.item = item if @status_window
  104.   end
  105. end
  106. #============================================================================
  107. #============================================================================
  108. class Scene_CharBook < Scene_MenuBase
  109.   #--------------------------------------------------------------------------
  110.   # ● 開始処理
  111.   #--------------------------------------------------------------------------
  112.   def start
  113.     super
  114.     create_category_window
  115.     create_dummy1_window
  116.     create_dummy2_window
  117.     create_status_window
  118.     create_list_window
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ● DUMMY1の作成
  122.   #--------------------------------------------------------------------------
  123.   def create_dummy1_window
  124.     wy = @category_window.height
  125.     wh = Graphics.height - wy
  126.     @dummy1_window = Window_Base.new(0, wy, 181, wh)
  127.     @dummy1_window.viewport = @viewport
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● DUMMY2の作成
  131.   #--------------------------------------------------------------------------
  132.   def create_dummy2_window
  133.     wy = @category_window.height
  134.     wh = Graphics.height - wy
  135.     @dummy2_window = Window_Base.new(181, wy, 363, wh)
  136.     @dummy2_window.viewport = @viewport
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● ステータスウィンドウの作成
  140.   #--------------------------------------------------------------------------
  141.   def create_status_window
  142.     wy = @category_window.height
  143.     wh = Graphics.height - wy
  144.     @status_window = Window_CharBook_Status.new(181, wy, 363, wh)
  145.     @status_window.viewport = @viewport
  146.     @status_window.hide
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● アイテムリストウィンドウの作成
  150.   #--------------------------------------------------------------------------
  151.   def create_list_window
  152.     wy = @category_window.height
  153.     wh = Graphics.height - wy
  154.     @list_window = Window_CharBook_List.new(0, wy, 181, wh)
  155.     @list_window.viewport = @viewport
  156.     @list_window.status_window = @status_window
  157.     @list_window.hide
  158.     @list_window.set_handler(:cancel, method(:on_list_cancel))   
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● カテゴリウィンドウの作成
  162.   #--------------------------------------------------------------------------
  163.   def create_category_window
  164.     @category_window = Window_CharBook_Category.new
  165.     @category_window.viewport = @viewport
  166.     @category_window.y = 0
  167.     @category_window.width = Graphics.width
  168.     @category_window.activate
  169.     @category_window.set_handler(:ok,     method(:on_category_ok))
  170.     @category_window.set_handler(:cancel, method(:return_scene))
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● LIST CANCEL
  174.   #--------------------------------------------------------------------------
  175.   def on_list_cancel
  176.     @category_window.activate
  177.     @dummy1_window.show
  178.     @dummy2_window.show
  179.     @list_window.hide
  180.     @status_window.hide
  181.     @status_window.item = nil
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● CATEGORY[決定]
  185.   #--------------------------------------------------------------------------
  186.   def on_category_ok
  187.     @list_window.select(0)
  188.     @list_window.get_current_job(@category_window.current_symbol.to_i)
  189.     @list_window.show.activate
  190.     @status_window.show
  191.   end
  192. end
  193. #===========================================================================
  194. #===========================================================================
  195. class Window_CharBook_Category < Window_HorzCommand
  196.   include ICE_CharBook
  197.   #--------------------------------------------------------------------------
  198.   # ● 初始化对象
  199.   #--------------------------------------------------------------------------
  200.   def initialize
  201.     super(0, 0)
  202.   end
  203.   #-------------------------------------------------------------------------
  204.   # ● 桁数の取得
  205.   #-------------------------------------------------------------------------
  206.   def col_max
  207.     return @job_id.size
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 获取窗口的宽度
  211.   #--------------------------------------------------------------------------
  212.   def window_width
  213.     return 544
  214.   end
  215.   #-------------------------------------------------------------------------
  216.   # ● LISTの作成
  217.   #-------------------------------------------------------------------------
  218.   def make_command_list
  219.     @job_id = []
  220.     $data_classes.each do |x|
  221.       next if x == nil or ICE_CharBook::HIDE_JOB_ID.include?(x.id)
  222.       @job_id.push(x.id)
  223.     end
  224.     @job_id.each do |i|
  225.       sym = i.to_s
  226.       add_command($data_classes[i].name, sym )
  227.     end
  228.   end
  229. end
  230. #===========================================================================
  231. #===========================================================================
  232. class Window_CharBook_Status < Window_Base
  233.   #--------------------------------------------------------------------------
  234.   # ● 初始化对象
  235.   #--------------------------------------------------------------------------
  236.   def initialize(x, y, width, height)
  237.     super(x, y, width, height)
  238.     [url=home.php?mod=space&uid=95897]@actor[/url] = nil
  239.     refresh
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● 刷新
  243.   #--------------------------------------------------------------------------
  244.   def refresh
  245.     contents.clear
  246.     if [url=home.php?mod=space&uid=95897]@actor[/url] != nil
  247.       if $game_switches[1000 + @actor.id]
  248.         draw_block1   (line_height * 0)
  249.         draw_horz_line(line_height * 5)
  250.         draw_block2   (line_height * 7)
  251.       else
  252.         draw_text(0, 0, 181, 200, ICE_CharBook::NONE)
  253.       end
  254.     end
  255.   end
  256.  
  257.   #--------------------------------------------------------------------------
  258.   # ● アイテムの設定
  259.   #--------------------------------------------------------------------------
  260.   def item=(item)
  261.     @actor = item
  262.     refresh
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 繪畫BLOCK 1
  266.   #--------------------------------------------------------------------------
  267.   def draw_block1(y)
  268.     draw_actor_face(@actor, 8, y)
  269.     draw_actor_level(@actor, 248, y + line_height * 0)
  270.     draw_actor_icons(@actor, 8, y + line_height * 3)
  271.     draw_actor_name(@actor, 136, y + line_height * 0)
  272.     draw_actor_class(@actor, 136, y + line_height * 1)
  273.     draw_actor_nickname(@actor, 136, y + line_height * 2)
  274.     draw_actor_exp(@actor, 136, y + line_height * 3)
  275.     draw_actor_hp(@actor, 32, y + line_height * 4)
  276.     draw_actor_mp(@actor, 181, y + line_height * 4)
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 繪畫BLOCK 2
  280.   #--------------------------------------------------------------------------
  281.   def draw_block2(y)
  282.  
  283.     draw_actor_param(@actor, 64, y + line_height * 0, 2)
  284.     draw_actor_param(@actor, 104, y + line_height * 1, 3)
  285.     draw_actor_param(@actor, 64, y + line_height * 2, 4)
  286.     draw_actor_param(@actor, 104, y + line_height * 3, 5)
  287.     draw_actor_param(@actor, 64, y + line_height * 4, 6)
  288.     draw_actor_param(@actor, 104, y + line_height * 5, 7)
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● 水平線繪畫
  292.   #--------------------------------------------------------------------------
  293.   def draw_horz_line(y)
  294.     line_y = y + line_height / 2 - 1
  295.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 水平線の色を取得
  299.   #--------------------------------------------------------------------------
  300.   def line_color
  301.     color = normal_color
  302.     color.alpha = 48
  303.     color
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● EXP 繪畫
  307.   #--------------------------------------------------------------------------
  308.   def draw_actor_exp(actor, x, y, width = 124)
  309.     draw_gauge(x, y, width, actor.exp.to_f / actor.next_level_exp,
  310.       text_color(28), text_color(29))
  311.     change_color(system_color)
  312.     draw_text(x, y, 30, line_height, ICE_CharBook::EXP)
  313.     draw_current_and_max_values(x, y, width, actor.exp, actor.next_level_exp,
  314.       exp_color(actor), normal_color)
  315.   end
  316.   def exp_color(actor)
  317.       return normal_color
  318.   end
  319. end


範例
角色图鉴 1.0.rar (303.92 KB, 下载次数: 104)
只收1元 求給糖   

评分

参与人数 1星屑 +66 收起 理由
Mic_洛洛 + 66 额外奖励

查看全部评分

Lv1.梦旅人

梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
帖子
2394
2
发表于 2013-8-13 21:02:16 | 只看该作者
貌似是为了完成某个提问区里的人发的问题把?

点评

對啊 然後便來拿點分XD  发表于 2013-8-13 21:07

坑的进度如上                                                                                                        点击↑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
68
在线时间
208 小时
注册时间
2013-8-8
帖子
1296
3
发表于 2013-8-13 21:39:38 | 只看该作者
不错不错!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
68
在线时间
208 小时
注册时间
2013-8-8
帖子
1296
4
发表于 2013-8-13 21:40:04 | 只看该作者
还可以。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
575
在线时间
1752 小时
注册时间
2008-11-7
帖子
1431
5
发表于 2013-8-14 10:37:46 | 只看该作者
居然有日文 也算原创  - -
RPG魔塔:http://rpg.blue/thread-254429-1-1.html
魔塔2:http://rpg.blue/thread-303601-1-1.html
魔塔3: 制作中...MV
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
743
在线时间
2064 小时
注册时间
2011-10-3
帖子
1686
6
发表于 2013-8-14 10:44:18 | 只看该作者
z2z4 发表于 2013-8-14 10:37
居然有日文 也算原创  - -

窗口描画这些懒得打而直接复制默认脚本里的也算原创吧……

点评

复制归复制 干嘛复制日文的 - - 我也会复制 修改了下  发表于 2013-8-14 12:58
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
170
在线时间
227 小时
注册时间
2011-5-19
帖子
736
7
发表于 2013-8-16 09:37:54 | 只看该作者
好东西,收下了。
休息中……
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-19 18:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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