Project1

标题: 如何添加一个能力值,然后在状态栏显示?? [打印本页]

作者: 木许许    时间: 2008-11-4 20:26
标题: 如何添加一个能力值,然后在状态栏显示??
比如添加一项叫"忠诚度"的能力值,初始值 = 100,然后在状态栏里和力量灵巧速度之类的一起显示 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 卓越大白痴    时间: 2008-11-4 22:01
在50行添加 参考一下 我添加了善恶.资质.技能.健康
  1. #==============================================================================
  2. # ■ Window_Status
  3. #------------------------------------------------------------------------------
  4. #  显示状态画面、完全规格的状态窗口。
  5. #==============================================================================

  6. class Window_Status < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     actor : 角色
  10.   #--------------------------------------------------------------------------
  11.   def initialize(actor)
  12.     super(0, 0, 640, 480)
  13.     self.contents = Bitmap.new(width - 32, height - 32)
  14.     @actor = actor
  15.     refresh
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 刷新
  19.   #--------------------------------------------------------------------------
  20.   def refresh
  21.     self.contents.clear
  22.     draw_actor_graphic(@actor, 40, 112)
  23.     draw_actor_name(@actor, 4, 0)
  24.     draw_actor_class(@actor, 4 + 144, 0)
  25.     draw_actor_level(@actor, 96, 32)
  26.     draw_actor_state(@actor, 96, 64)
  27.     draw_actor_hp(@actor, 26, 112, 172)
  28.     draw_actor_sp(@actor, 26, 144, 172)
  29.     draw_actor_parameter(@actor, 26, 192, 0)
  30.     draw_actor_parameter(@actor, 26, 224, 1)
  31.     draw_actor_parameter(@actor, 26, 256, 2)
  32.     draw_actor_parameter(@actor, 26, 304, 3)
  33.     draw_actor_parameter(@actor, 26, 336, 4)
  34.     draw_actor_parameter(@actor, 26, 368, 5)
  35.     draw_actor_parameter(@actor, 26, 400, 6)
  36.     self.contents.font.color = system_color
  37.     self.contents.draw_text(220, 50, 80, 32, "EXP")
  38.     self.contents.draw_text(220, 80, 80, 32, "NEXT")
  39.     self.contents.font.color = normal_color
  40.     self.contents.draw_text(220 + 80, 48, 84, 32, @actor.exp_s, 2)
  41.     self.contents.draw_text(220 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  42.     self.contents.font.color = system_color
  43.     self.contents.draw_text(490, 27, 96, 32, "装备")
  44.     draw_item_name($data_weapons[@actor.weapon_id], 380 + 6, 50)
  45.     draw_item_name($data_armors[@actor.armor1_id], 380 + 6, 80)
  46.     draw_item_name($data_armors[@actor.armor2_id], 380 + 6, 110)
  47.     draw_item_name($data_armors[@actor.armor3_id], 380 + 6, 140)
  48.     draw_item_name($data_armors[@actor.armor4_id], 380 + 6, 170)
  49.     cx = contents.text_size("健康").width
  50.    self.contents.font.color = normal_color
  51.    self.contents.draw_text(4, 32, 424-cx-2, 188, $game_variables[46].to_s, 2)
  52.    self.contents.font.color = system_color
  53.    self.contents.draw_text(263-cx, 110, cx, 32, "健康" , 2)
  54.    cx = contents.text_size("善恶").width
  55.    self.contents.font.color = normal_color
  56.    self.contents.draw_text(4, 48, 424-cx-2, 218, $game_variables[46].to_s, 2)
  57.    self.contents.font.color = system_color
  58.    self.contents.draw_text(263-cx, 140, cx, 32, "善恶" , 2)
  59.    cx = contents.text_size("资质").width
  60.    self.contents.font.color = normal_color
  61.    self.contents.draw_text(4, 62, 424-cx-2, 248, $game_variables[46].to_s, 2)
  62.    self.contents.font.color = system_color
  63.    self.contents.draw_text(263-cx, 170, cx, 32, "资质" , 2)
  64.    cx = contents.text_size("技能").width
  65.    self.contents.font.color = normal_color
  66.    self.contents.draw_text(4, 76, 424-cx-2, 278, $game_variables[46].to_s, 2)
  67.    self.contents.font.color = system_color
  68.    self.contents.draw_text(263-cx, 200, cx, 32, "技能" , 2)
  69.   end
  70.   def dummy
  71.     self.contents.font.color = system_color
  72.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  73.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  74.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  75.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  76.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  77.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  78.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  79.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  80.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  81.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  82.   end
  83. end
复制代码
[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 木许许    时间: 2008-11-4 22:51
是不是在 Game_Actor 里也要添加什么呢?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1