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

Project1

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

[已经解决] 请问怎么用脚本描绘属性抗性?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2013-7-2
帖子
10
跳转到指定楼层
1
发表于 2014-3-23 22:14:18 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 墨火 于 2014-3-25 13:38 编辑

比如设定了角色1的物理(属性ID1)抗性50%

该怎样如物攻、物防等一般属性在窗口里绘制出来呢?

PS:偶对脚本只是入门级,希望能简单易懂的解答,谢谢。{:2_264:}

20140323222615.jpg (9.4 KB, 下载次数: 25)

20140323222615.jpg

点评

看不懂你的意思,能夠描述得清楚點?  发表于 2014-3-23 22:18

Lv1.梦旅人

梦石
0
星屑
60
在线时间
214 小时
注册时间
2014-1-23
帖子
197
2
发表于 2014-3-25 09:45:04 | 只看该作者
给你个脚本吧……详细状态全描绘,图书馆和很多大合集里面都有的……
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Status Menu v1.01
  4. # -- Last Updated: 2011.12.26
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-StatusMenu"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2011.12.26 - Compatibility Update: Rename Actor
  15. # 2011.12.23 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # This script changes the status screen completely to something the player can
  21. # interact with more and be able to view actor data with more clarity. The
  22. # player is able to view the general information for an actor (parameters and
  23. # experience), a parameters bar graph, the various hidden extra parameters
  24. # (named properties in the script), and a customizable biography for the actor.
  25. # Also with this script, biographies can be changed at any time using a script
  26. # call to add more of a personal touch to characters.
  27. #
  28. #==============================================================================
  29. # ▼ Instructions
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # To install this script, open up your script editor and copy/paste this script
  32. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  33. #
  34. # -----------------------------------------------------------------------------
  35. # Script Calls - These commands are used with script calls.
  36. # -----------------------------------------------------------------------------
  37. # $game_actors[x].description = string
  38. # Changes the biography description for actor x to that of the string. Use \n
  39. # to designate linebreaks in the string. If you wish to use text codes, write
  40. # them in the strings as \\n[2] or \\c[3] to make them work properly.
  41. #
  42. #==============================================================================
  43. # ▼ Compatibility
  44. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  45. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  46. # it will run with RPG Maker VX without adjusting.
  47. #
  48. #==============================================================================

  49. module YEA
  50.   module STATUS
  51.    
  52.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  53.     # - Command Window Settings -
  54.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  55.     # This section adjusts the commands that appear in the command window used
  56.     # for the status screen. Rearrange the commands, add new ones, remove them
  57.     # as you see fit.
  58.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59.     COMMANDS =[ # The order at which the menu items are shown.
  60.     # [    :command,    "Display"],
  61.       [    :general,    "基本状态"],
  62.       [ :parameters, "数据"],
  63.       [ :properties, "属性"],
  64.       [    :custom1,     "技能"],
  65.       [    :custom2,  "装备"],
  66.       [    :custom3,      "职业"],
  67.       [  :biography,  "传记"],
  68.       [     :rename,     "Rename"],  # Requires YEA - Rename Actor
  69.       [    :retitle,    "Retitle"],  # Requires YEA - Rename Actor
  70.     ] # Do not remove this.
  71.    
  72.     #--------------------------------------------------------------------------
  73.     # - Status Custom Commands -
  74.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  75.     # For those who use scripts to that may produce unique effects for the
  76.     # status menu, use this hash to manage the custom commands for the Status
  77.     # Command Window. You can disable certain commands or prevent them from
  78.     # appearing by using switches. If you don't wish to bind them to a switch,
  79.     # set the proper switch to 0 for it to have no impact.
  80.     #--------------------------------------------------------------------------
  81.     CUSTOM_STATUS_COMMANDS ={
  82.     # :command => [EnableSwitch, ShowSwitch, Handler Method, Window Draw],
  83.       :custom1 => [           0,          0, :command_name1, :draw_custom1],
  84.       :custom2 => [           0,          0, :command_name2, :draw_custom2],
  85.       :custom3 => [           0,          0, :command_name3, :draw_custom3],
  86.     } # Do not remove this.
  87.    
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     # - General Window Settings -
  90.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  91.     # These settings adjust the way the general window visually appears.
  92.     # Not many changes need to be done here other than vocab changes.
  93.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94.     PARAMETERS_VOCAB = "面板"         # Title used for Parameters.
  95.     EXPERIENCE_VOCAB = "经验值"         # Title used for Experience.
  96.     NEXT_TOTAL_VOCAB = "下次 %s 经验值总数"  # Label used for total experience.
  97.    
  98.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  99.     # - Parameters Window Settings -
  100.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  101.     # These settings adjust the way the parameters window visually appears.
  102.     # Each of the stats have a non-window colour. Adjust them as you see fit.
  103.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104.     PARAM_COLOUR ={
  105.     # ParamID => [:stat,       Colour1,                   Colour2          ],
  106.             2 => [ :atk, Color.new(225, 100, 100), Color.new(240, 150, 150)],
  107.             3 => [ :def, Color.new(250, 150,  30), Color.new(250, 180, 100)],
  108.             4 => [ :mat, Color.new( 70, 140, 200), Color.new(135, 180, 230)],
  109.             5 => [ :mdf, Color.new(135, 130, 190), Color.new(170, 160, 220)],
  110.             6 => [ :agi, Color.new( 60, 180,  80), Color.new(120, 200, 120)],
  111.             7 => [ :luk, Color.new(255, 240, 100), Color.new(255, 250, 200)],
  112.     } # Do not remove this.
  113.    
  114.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  115.     # - Properties Window Settings -
  116.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.     # These settings adjust the way the properties window visually appears.
  118.     # The properties have abbreviations, but leaving them as such makes things
  119.     # confusing (as it's sometimes hard to figure out what the abbreviations
  120.     # mean). Change the way the appear, whether or not they appear, and what
  121.     # order they will appear in.
  122.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  123.     PROPERTIES_FONT_SIZE = 16        # Font size used for properties.
  124.    
  125.     # These are the properties that appear in column 1.
  126.     PROPERTIES_COLUMN1 =[
  127.       [:hit, "命中率"],
  128.       [:eva, "躲避"],
  129.       [:cri, "致命一击"],
  130.       [:cev, "关键躲避"],
  131.       [:mev, "魔法躲避"],
  132.       [:mrf, "魔法反射"],
  133.       [:cnt, "反击"],
  134.       [:tgr, "目标攻击"],
  135.     ] # Do not remove this.
  136.    
  137.     # These are the properties that appear in column 2.
  138.     PROPERTIES_COLUMN2 =[
  139.       [:hrg, "生命恢复"],
  140.       [:mrg, "魔法再生"],
  141.       [:trg, "特技叠加"],
  142.       [:rec, "恢复"],
  143.       [:grd, "防御力"],
  144.       [:pha, "物品使用"],
  145.       [:exr, "经验倍率"],
  146.       [:tcr, "特技模式"],
  147.     ] # Do not remove this.
  148.    
  149.     # These are the properties that appear in column 3.
  150.     PROPERTIES_COLUMN3 =[
  151.       [:hcr, "普通伤害"],    # Requires YEA - Skill Cost Manager
  152.       [:mcr, "奥术伤害"],
  153.       [:tcr, "特技伤害"],    # Requires YEA - Skill Cost Manager
  154.       [:cdr, "硬直伤害"],   # Requires YEA - Skill Restrictions
  155.       [:wur, "激励伤害"],     # Requires YEA - Skill Restrictions
  156.       [:pdr, "物理伤害"],
  157.       [:mdr, "魔法伤害"],
  158.       [:fdr, "基本伤害"],
  159.     ] # Do not remove this.
  160.    
  161.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  162.     # - Biography Window Settings -
  163.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  164.     # These settings adjust the way the biography appears including the title
  165.     # used at the top, the font size, and whatnot.
  166.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  167.     BIOGRAPHY_NICKNAME_TEXT = "%s   :   %s"   # How the nickname will appear.
  168.     BIOGRAPHY_NICKNAME_SIZE = 40            # Size of the font used.
  169.    
  170.      
  171.    
  172.   end # STATUS
  173. end # YEA

  174. #==============================================================================
  175. # ▼ Editting anything past this point may potentially result in causing
  176. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  177. # halitosis so edit at your own risk.
  178. #==============================================================================

  179. #==============================================================================
  180. # ■ Numeric
  181. #==============================================================================

  182. class Numeric
  183.   
  184.   #--------------------------------------------------------------------------
  185.   # new method: group_digits
  186.   #--------------------------------------------------------------------------
  187.   unless $imported["YEA-CoreEngine"]
  188.   def group; return self.to_s; end
  189.   end # $imported["YEA-CoreEngine"]
  190.    
  191. end # Numeric

  192. #==============================================================================
  193. # ■ Game_Temp
  194. #==============================================================================

  195. class Game_Temp
  196.   
  197.   #--------------------------------------------------------------------------
  198.   # public instance variables
  199.   #--------------------------------------------------------------------------
  200.   attr_accessor :scene_status_index
  201.   attr_accessor :scene_status_oy
  202.   
  203. end # Game_Temp

  204. #==============================================================================
  205. # ■ Game_Actor
  206. #==============================================================================

  207. class Game_Actor < Game_Battler
  208.   
  209.   #--------------------------------------------------------------------------
  210.   # new method: description=
  211.   #--------------------------------------------------------------------------
  212.   def description=(text)
  213.     @description = text
  214.   end
  215.   
  216.   #--------------------------------------------------------------------------
  217.   # overwrite method: description
  218.   #--------------------------------------------------------------------------
  219.   def description
  220.     return @description unless @description.nil?
  221.     return actor.description
  222.   end
  223.   
  224. end # Game_Actor

  225. #==============================================================================
  226. # ■ Window_StatusCommand
  227. #==============================================================================

  228. class Window_StatusCommand < Window_Command
  229.   
  230.   #--------------------------------------------------------------------------
  231.   # public instance variables
  232.   #--------------------------------------------------------------------------
  233.   attr_accessor :item_window
  234.   
  235.   #--------------------------------------------------------------------------
  236.   # initialize
  237.   #--------------------------------------------------------------------------
  238.   def initialize(dx, dy)
  239.     super(dx, dy)
  240.     [url=home.php?mod=space&uid=95897]@actor[/url] = nil
  241.   end
  242.   
  243.   #--------------------------------------------------------------------------
  244.   # window_width
  245.   #--------------------------------------------------------------------------
  246.   def window_width; return 160; end
  247.   
  248.   #--------------------------------------------------------------------------
  249.   # actor=
  250.   #--------------------------------------------------------------------------
  251.   def actor=(actor)
  252.     return if @actor == actor
  253.     @actor = actor
  254.     refresh
  255.   end
  256.   
  257.   #--------------------------------------------------------------------------
  258.   # visible_line_number
  259.   #--------------------------------------------------------------------------
  260.   def visible_line_number; return 4; end
  261.   
  262.   #--------------------------------------------------------------------------
  263.   # ok_enabled?
  264.   #--------------------------------------------------------------------------
  265.   def ok_enabled?
  266.     return handle?(current_symbol)
  267.   end
  268.   
  269.   #--------------------------------------------------------------------------
  270.   # make_command_list
  271.   #--------------------------------------------------------------------------
  272.   def make_command_list
  273.     return unless @actor
  274.     for command in YEA::STATUS::COMMANDS
  275.       case command[0]
  276.       #--- Default ---
  277.       when :general, :parameters, :properties, :biography
  278.         add_command(command[1], command[0])
  279.       #--- Yanfly Engine Ace ---
  280.       when :rename
  281.         next unless $imported["YEA-RenameActor"]
  282.         add_command(command[1], command[0], @actor.rename_allow?)
  283.       when :retitle
  284.         next unless $imported["YEA-RenameActor"]
  285.         add_command(command[1], command[0], @actor.retitle_allow?)
  286.       #--- Custom Commands ---
  287.       else
  288.         process_custom_command(command)
  289.       end
  290.     end
  291.     if !$game_temp.scene_status_index.nil?
  292.       select($game_temp.scene_status_index)
  293.       self.oy = $game_temp.scene_status_oy
  294.     end
  295.     $game_temp.scene_status_index = nil
  296.     $game_temp.scene_status_oy = nil
  297.   end
  298.   
  299.   #--------------------------------------------------------------------------
  300.   # process_ok
  301.   #--------------------------------------------------------------------------
  302.   def process_ok
  303.     $game_temp.scene_status_index = index
  304.     $game_temp.scene_status_oy = self.oy
  305.     super
  306.   end
  307.   
  308.   #--------------------------------------------------------------------------
  309.   # process_custom_command
  310.   #--------------------------------------------------------------------------
  311.   def process_custom_command(command)
  312.     return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  313.     show = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][1]
  314.     continue = show <= 0 ? true : $game_switches[show]
  315.     return unless continue
  316.     text = command[1]
  317.     switch = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][0]
  318.     enabled = switch <= 0 ? true : $game_switches[switch]
  319.     add_command(text, command[0], enabled)
  320.   end
  321.   
  322.   #--------------------------------------------------------------------------
  323.   # update
  324.   #--------------------------------------------------------------------------
  325.   def update
  326.     super
  327.     update_item_window
  328.   end
  329.   
  330.   #--------------------------------------------------------------------------
  331.   # update_item_window
  332.   #--------------------------------------------------------------------------
  333.   def update_item_window
  334.     return if @item_window.nil?
  335.     return if @current_index == current_symbol
  336.     @current_index = current_symbol
  337.     @item_window.refresh
  338.   end
  339.   
  340.   #--------------------------------------------------------------------------
  341.   # item_window=
  342.   #--------------------------------------------------------------------------
  343.   def item_window=(window)
  344.     @item_window = window
  345.     update
  346.   end
  347.   
  348.   #--------------------------------------------------------------------------
  349.   # update_help
  350.   #--------------------------------------------------------------------------
  351.   def update_help
  352.     return if @actor.nil?
  353.     @help_window.set_text(@actor.actor.description)
  354.   end
  355.   
  356. end # Window_StatusCommand

  357. #==============================================================================
  358. # ■ Window_StatusActor
  359. #==============================================================================

  360. class Window_StatusActor < Window_Base
  361.   
  362.   #--------------------------------------------------------------------------
  363.   # initialize
  364.   #--------------------------------------------------------------------------
  365.   def initialize(dx, dy)
  366.     super(dx, dy, window_width, fitting_height(4))
  367.     @actor = nil
  368.   end
  369.   
  370.   #--------------------------------------------------------------------------
  371.   # window_width
  372.   #--------------------------------------------------------------------------
  373.   def window_width; return Graphics.width - 160; end
  374.   
  375.   #--------------------------------------------------------------------------
  376.   # actor=
  377.   #--------------------------------------------------------------------------
  378.   def actor=(actor)
  379.     return if @actor == actor
  380.     @actor = actor
  381.     refresh
  382.   end
  383.   
  384.   #--------------------------------------------------------------------------
  385.   # refresh
  386.   #--------------------------------------------------------------------------
  387.   def refresh
  388.     contents.clear
  389.     return unless @actor
  390.     draw_actor_face(@actor, 0, 0)
  391.     draw_actor_simple_status(@actor, 108, line_height / 2)
  392.   end
  393.   
  394. end # Window_StatusActor

  395. #==============================================================================
  396. # ■ Window_StatusItem
  397. #==============================================================================

  398. class Window_StatusItem < Window_Base
  399.   
  400.   #--------------------------------------------------------------------------
  401.   # initialize
  402.   #--------------------------------------------------------------------------
  403.   def initialize(dx, dy, command_window)
  404.     super(dx, dy, Graphics.width, Graphics.height - dy)
  405.     @command_window = command_window
  406.     @actor = nil
  407.     refresh
  408.   end
  409.   
  410.   #--------------------------------------------------------------------------
  411.   # actor=
  412.   #--------------------------------------------------------------------------
  413.   def actor=(actor)
  414.     return if @actor == actor
  415.     @actor = actor
  416.     refresh
  417.   end
  418.   
  419.   #--------------------------------------------------------------------------
  420.   # refresh
  421.   #--------------------------------------------------------------------------
  422.   def refresh
  423.     contents.clear
  424.     reset_font_settings
  425.     return unless @actor
  426.     draw_window_contents
  427.   end
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # draw_window_contents
  431.   #--------------------------------------------------------------------------
  432.   def draw_window_contents
  433.     case @command_window.current_symbol
  434.     when :general
  435.       draw_actor_general
  436.     when :parameters
  437.       draw_parameter_graph
  438.     when :properties
  439.       draw_properties_list
  440.     when :biography, :rename, :retitle
  441.       draw_actor_biography
  442.     else
  443.       draw_custom
  444.     end
  445.   end
  446.   
  447.   #--------------------------------------------------------------------------
  448.   # draw_actor_general
  449.   #--------------------------------------------------------------------------
  450.   def draw_actor_general
  451.     change_color(system_color)
  452.     text = YEA::STATUS::PARAMETERS_VOCAB
  453.     draw_text(0, 0, contents.width/2, line_height, text, 1)
  454.     text = YEA::STATUS::EXPERIENCE_VOCAB
  455.     draw_text(contents.width/2, 0, contents.width/2, line_height, text, 1)
  456.     draw_general_parameters
  457.     draw_general_experience
  458.   end
  459.   
  460.   #--------------------------------------------------------------------------
  461.   # draw_general_parameters
  462.   #--------------------------------------------------------------------------
  463.   def draw_general_parameters
  464.     dx = 24
  465.     dy = line_height / 2
  466.     draw_actor_level(dx, line_height*1+dy, contents.width/2 - 24)
  467.     draw_actor_param(0, dx, line_height*2+dy, contents.width/2 - 24)
  468.     draw_actor_param(1, dx, line_height*3+dy, contents.width/2 - 24)
  469.     draw_actor_param(2, dx, line_height*4+dy, contents.width/4 - 12)
  470.     draw_actor_param(4, dx, line_height*5+dy, contents.width/4 - 12)
  471.     draw_actor_param(6, dx, line_height*6+dy, contents.width/4 - 12)
  472.     dx += contents.width/4 - 12
  473.     draw_actor_param(3, dx, line_height*4+dy, contents.width/4 - 12)
  474.     draw_actor_param(5, dx, line_height*5+dy, contents.width/4 - 12)
  475.     draw_actor_param(7, dx, line_height*6+dy, contents.width/4 - 12)
  476.   end
  477.   
  478.   #--------------------------------------------------------------------------
  479.   # draw_actor_level
  480.   #--------------------------------------------------------------------------
  481.   def draw_actor_level(dx, dy, dw)
  482.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  483.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  484.     contents.fill_rect(rect, colour)
  485.     change_color(system_color)
  486.     draw_text(dx+4, dy, dw-8, line_height, Vocab::level)
  487.     change_color(normal_color)
  488.     draw_text(dx+4, dy, dw-8, line_height, @actor.level.group, 2)
  489.   end
  490.   
  491.   #--------------------------------------------------------------------------
  492.   # draw_actor_param
  493.   #--------------------------------------------------------------------------
  494.   def draw_actor_param(param_id, dx, dy, dw)
  495.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  496.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  497.     contents.fill_rect(rect, colour)
  498.     change_color(system_color)
  499.     draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  500.     change_color(normal_color)
  501.     draw_text(dx+4, dy, dw-8, line_height, @actor.param(param_id).group, 2)
  502.   end
  503.   
  504.   #--------------------------------------------------------------------------
  505.   # draw_general_experience
  506.   #--------------------------------------------------------------------------
  507.   def draw_general_experience
  508.     if @actor.max_level?
  509.       s1 = @actor.exp.group
  510.       s2 = "-------"
  511.       s3 = "-------"
  512.     else
  513.       s1 = @actor.exp.group
  514.       s2 = (@actor.next_level_exp - @actor.exp).group
  515.       s3 = @actor.next_level_exp.group
  516.     end
  517.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  518.     total_next_text = sprintf(YEA::STATUS::NEXT_TOTAL_VOCAB, Vocab::level)
  519.     change_color(system_color)
  520.     dx = contents.width/2 + 12
  521.     dy = line_height * 3 / 2
  522.     dw = contents.width/2 - 36
  523.     draw_text(dx, dy + line_height * 0, dw, line_height, Vocab::ExpTotal)
  524.     draw_text(dx, dy + line_height * 2, dw, line_height, s_next)
  525.     draw_text(dx, dy + line_height * 4, dw, line_height, total_next_text)
  526.     change_color(normal_color)
  527.     draw_text(dx, dy + line_height * 1, dw, line_height, s1, 2)
  528.     draw_text(dx, dy + line_height * 3, dw, line_height, s2, 2)
  529.     draw_text(dx, dy + line_height * 5, dw, line_height, s3, 2)
  530.   end
  531.   
  532.   #--------------------------------------------------------------------------
  533.   # draw_parameter_graph
  534.   #--------------------------------------------------------------------------
  535.   def draw_parameter_graph
  536.     draw_parameter_title
  537.     dy = line_height * 3/2
  538.     maximum = 1
  539.     minimum = @actor.param_max(2)
  540.     for i in 2..7
  541.       maximum = [@actor.param(i), maximum].max
  542.       minimum = [@actor.param(i), minimum].min
  543.     end
  544.     maximum += minimum * 0.33 unless maximum == minimum
  545.     for i in 2..7
  546.       rate = calculate_rate(maximum, minimum, i)
  547.       dy = line_height * i - line_height/2
  548.       draw_param_gauge(i, dy, rate)
  549.       change_color(system_color)
  550.       draw_text(28, dy, contents.width - 56, line_height, Vocab::param(i))
  551.       dw = (contents.width - 48) * rate - 8
  552.       change_color(normal_color)
  553.       draw_text(28, dy, dw, line_height, @actor.param(i).group, 2)
  554.     end
  555.   end
  556.   
  557.   #--------------------------------------------------------------------------
  558.   # calculate_rate
  559.   #--------------------------------------------------------------------------
  560.   def calculate_rate(maximum, minimum, param_id)
  561.     return 1.0 if maximum == minimum
  562.     rate = (@actor.param(param_id).to_f - minimum) / (maximum - minimum).to_f
  563.     rate *= 0.67
  564.     rate += 0.33
  565.     return rate
  566.   end
  567.   
  568.   #--------------------------------------------------------------------------
  569.   # draw_param_gauge
  570.   #--------------------------------------------------------------------------
  571.   def draw_param_gauge(param_id, dy, rate)
  572.     dw = contents.width - 48
  573.     colour1 = param_gauge1(param_id)
  574.     colour2 = param_gauge2(param_id)
  575.     draw_gauge(24, dy, dw, rate, colour1, colour2)
  576.   end
  577.   
  578.   #--------------------------------------------------------------------------
  579.   # param_gauge1
  580.   #--------------------------------------------------------------------------
  581.   def param_gauge1(param_id)
  582.     return YEA::STATUS::PARAM_COLOUR[param_id][1]
  583.   end
  584.   
  585.   #--------------------------------------------------------------------------
  586.   # param_gauge2
  587.   #--------------------------------------------------------------------------
  588.   def param_gauge2(param_id)
  589.     return YEA::STATUS::PARAM_COLOUR[param_id][2]
  590.   end
  591.   
  592.   #--------------------------------------------------------------------------
  593.   # draw_parameter_title
  594.   #--------------------------------------------------------------------------
  595.   def draw_parameter_title
  596.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  597.     rect = Rect.new(0, 0, contents.width, contents.height)
  598.     contents.fill_rect(rect, colour)
  599.     change_color(system_color)
  600.     text = YEA::STATUS::PARAMETERS_VOCAB
  601.     draw_text(0, line_height/3, contents.width, line_height, text, 1)
  602.   end
  603.   
  604.   #--------------------------------------------------------------------------
  605.   # draw_properties_list
  606.   #--------------------------------------------------------------------------
  607.   def draw_properties_list
  608.     contents.font.size = YEA::STATUS::PROPERTIES_FONT_SIZE
  609.     draw_properties_column1
  610.     draw_properties_column2
  611.     draw_properties_column3
  612.     reset_font_settings
  613.   end
  614.   
  615.   #--------------------------------------------------------------------------
  616.   # draw_properties_column1
  617.   #--------------------------------------------------------------------------
  618.   def draw_properties_column1
  619.     dx = 24
  620.     dw = (contents.width - 24) / 3 - 24
  621.     dy = 0
  622.     for property in YEA::STATUS::PROPERTIES_COLUMN1
  623.       dy = draw_property(property, dx, dy, dw)
  624.     end
  625.   end
  626.   
  627.   #--------------------------------------------------------------------------
  628.   # draw_properties_column2
  629.   #--------------------------------------------------------------------------
  630.   def draw_properties_column2
  631.     dx = 24 + (contents.width - 24) / 3
  632.     dw = (contents.width - 24) / 3 - 24
  633.     dy = 0
  634.     for property in YEA::STATUS::PROPERTIES_COLUMN2
  635.       dy = draw_property(property, dx, dy, dw)
  636.     end
  637.   end
  638.   
  639.   #--------------------------------------------------------------------------
  640.   # draw_properties_column3
  641.   #--------------------------------------------------------------------------
  642.   def draw_properties_column3
  643.     dx = 24 + (contents.width - 24) / 3 * 2
  644.     dw = (contents.width - 24) / 3 - 24
  645.     dy = 0
  646.     for property in YEA::STATUS::PROPERTIES_COLUMN3
  647.       dy = draw_property(property, dx, dy, dw)
  648.     end
  649.   end
  650.   
  651.   #--------------------------------------------------------------------------
  652.   # draw_property
  653.   #--------------------------------------------------------------------------
  654.   def draw_property(property, dx, dy, dw)
  655.     case property[0]
  656.     #---
  657.     when :hit
  658.       fmt = "%1.2f%%"
  659.       value = sprintf(fmt, @actor.hit * 100)
  660.     when :eva
  661.       fmt = "%1.2f%%"
  662.       value = sprintf(fmt, @actor.eva * 100)
  663.     when :cri
  664.       fmt = "%1.2f%%"
  665.       value = sprintf(fmt, @actor.cri * 100)
  666.     when :cev
  667.       fmt = "%1.2f%%"
  668.       value = sprintf(fmt, @actor.cev * 100)
  669.     when :mev
  670.       fmt = "%1.2f%%"
  671.       value = sprintf(fmt, @actor.mev * 100)
  672.     when :mrf
  673.       fmt = "%1.2f%%"
  674.       value = sprintf(fmt, @actor.mrf * 100)
  675.     when :cnt
  676.       fmt = "%1.2f%%"
  677.       value = sprintf(fmt, @actor.cnt * 100)
  678.     when :hrg
  679.       fmt = "%1.2f%%"
  680.       value = sprintf(fmt, @actor.hrg * 100)
  681.     when :mrg
  682.       fmt = "%1.2f%%"
  683.       value = sprintf(fmt, @actor.mrg * 100)
  684.     when :trg
  685.       fmt = "%1.2f%%"
  686.       value = sprintf(fmt, @actor.trg * 100)
  687.     when :tgr
  688.       fmt = "%1.2f%%"
  689.       value = sprintf(fmt, @actor.tgr * 100)
  690.     when :grd
  691.       fmt = "%1.2f%%"
  692.       value = sprintf(fmt, @actor.grd * 100)
  693.     when :rec
  694.       fmt = "%1.2f%%"
  695.       value = sprintf(fmt, @actor.rec * 100)
  696.     when :pha
  697.       fmt = "%1.2f%%"
  698.       value = sprintf(fmt, @actor.pha * 100)
  699.     when :mcr
  700.       fmt = "%1.2f%%"
  701.       value = sprintf(fmt, @actor.mcr * 100)
  702.     when :tcr
  703.       fmt = "%1.2f%%"
  704.       value = sprintf(fmt, @actor.tcr * 100)
  705.     when :pdr
  706.       fmt = "%1.2f%%"
  707.       value = sprintf(fmt, @actor.pdr * 100)
  708.     when :mdr
  709.       fmt = "%1.2f%%"
  710.       value = sprintf(fmt, @actor.mdr * 100)
  711.     when :fdr
  712.       fmt = "%1.2f%%"
  713.       value = sprintf(fmt, @actor.fdr * 100)
  714.     when :exr
  715.       fmt = "%1.2f%%"
  716.       value = sprintf(fmt, @actor.exr * 100)
  717.     when :hcr
  718.       return dy unless $imported["YEA-SkillCostManager"]
  719.       fmt = "%1.2f%%"
  720.       value = sprintf(fmt, @actor.hcr * 100)
  721.     when :tcr
  722.       return dy unless $imported["YEA-SkillCostManager"]
  723.       fmt = "%1.2f%%"
  724.       value = sprintf(fmt, @actor.tcr * 100)
  725.     when :gcr
  726.       return dy unless $imported["YEA-SkillCostManager"]
  727.       fmt = "%1.2f%%"
  728.       value = sprintf(fmt, @actor.gcr * 100)
  729.     when :cdr
  730.       return dy unless $imported["YEA-SkillRestrictions"]
  731.       fmt = "%1.2f%%"
  732.       value = sprintf(fmt, @actor.cdr * 100)
  733.     when :wur
  734.       return dy unless $imported["YEA-SkillRestrictions"]
  735.       fmt = "%1.2f%%"
  736.       value = sprintf(fmt, @actor.wur * 100)
  737.     #---
  738.     else; return dy
  739.     end
  740.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  741.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  742.     contents.fill_rect(rect, colour)
  743.     change_color(system_color)
  744.     draw_text(dx+4, dy, dw-8, line_height, property[1], 0)
  745.     change_color(normal_color)
  746.     draw_text(dx+4, dy, dw-8, line_height, value, 2)
  747.     return dy + line_height
  748.   end
  749.   
  750.   #--------------------------------------------------------------------------
  751.   # draw_actor_biography
  752.   #--------------------------------------------------------------------------
  753.   def draw_actor_biography
  754.     fmt = YEA::STATUS::BIOGRAPHY_NICKNAME_TEXT
  755.     text = sprintf(fmt, @actor.name, @actor.nickname)
  756.     contents.font.size = YEA::STATUS::BIOGRAPHY_NICKNAME_SIZE
  757.     draw_text(0, 0, contents.width, line_height*2, text, 1)
  758.     reset_font_settings
  759.     draw_text_ex(24, line_height*2, @actor.description)
  760.   end
  761.   
  762.   #--------------------------------------------------------------------------
  763.   # draw_custom
  764.   #--------------------------------------------------------------------------
  765.   def draw_custom
  766.     current_symbol = @command_window.current_symbol
  767.     return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(current_symbol)
  768.     method(YEA::STATUS::CUSTOM_STATUS_COMMANDS[current_symbol][3]).call
  769.   end
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # draw_custom1
  773.   #--------------------------------------------------------------------------
  774.   def draw_custom1
  775.     dx = 0; dy = 0
  776.     for skill in @actor.skills
  777.       next if skill.nil?
  778.       next unless @actor.added_skill_types.include?(skill.stype_id)
  779.       draw_item_name(skill, dx, dy)
  780.       dx = dx == contents.width / 2 + 16 ? 0 : contents.width / 2 + 16
  781.       dy += line_height if dx == 0
  782.       return if dy + line_height > contents.height
  783.     end
  784.   end
  785.   
  786.   #--------------------------------------------------------------------------
  787.   # draw_custom2
  788.   #--------------------------------------------------------------------------
  789.   def draw_custom2
  790.     dx = 4; dy = 0; slot_id = 0
  791.     for equip in @actor.equips
  792.       change_color(system_color)
  793.       text = Vocab.etype(@actor.equip_slots[slot_id])
  794.       draw_text(dx, dy, contents.width - dx, line_height, text)
  795.       reset_font_settings
  796.       draw_item_name(equip, dx+92, dy) unless equip.nil?
  797.       slot_id += 1
  798.       dy += line_height
  799.       break if dy + line_height > contents.height
  800.     end
  801.     dw = Graphics.width * 2 / 5 - 24
  802.     dx = contents.width - dw; dy = 0
  803.     param_id = 0
  804.     8.times do
  805.       colour = Color.new(0, 0, 0, translucent_alpha/2)
  806.       rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  807.       contents.fill_rect(rect, colour)
  808.       size = $imported["YEA-AceEquipEngine"] ? YEA::EQUIP::STATUS_FONT_SIZE : 20
  809.       contents.font.size = size
  810.       change_color(system_color)
  811.       draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id))
  812.       change_color(normal_color)
  813.       dwa = (Graphics.width * 2 / 5 - 2) / 2
  814.       draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2)
  815.       reset_font_settings
  816.       change_color(system_color)
  817.       draw_text(dx + dwa, dy, 22, line_height, "→", 1)
  818.       param_id += 1
  819.       dy += line_height
  820.       break if dy + line_height > contents.height
  821.     end
  822.   end
  823.   
  824.   #--------------------------------------------------------------------------
  825.   # draw_custom3
  826.   #--------------------------------------------------------------------------
  827.   def draw_custom3
  828.     return unless $imported["YEA-ClassSystem"]
  829.     data = []
  830.     for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
  831.       next if $data_classes[class_id].nil?
  832.       item = $data_classes[class_id]
  833.       next unless @actor.unlocked_classes.include?(item.id) or
  834.         YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id)
  835.       data.push(item)
  836.     end
  837.     dx = 0; dy = 0; class_index = 0
  838.     for class_id in data
  839.       item = data[class_index]
  840.       reset_font_settings
  841.       if item == @actor.class
  842.         change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR))
  843.       elsif item == @actor.subclass
  844.         change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR))
  845.       else
  846.         change_color(normal_color)
  847.       end
  848.       icon = item.icon_index
  849.       draw_icon(icon, dx, dy)
  850.       text = item.name
  851.       draw_text(24, dy, contents.width-24, line_height, text)
  852.       next if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  853.       level = @actor.class_level(item.id)
  854.       contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE
  855.       text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group)
  856.       dwa = contents.width - (Graphics.width * 2 / 5 - 24) - 28
  857.       draw_text(dx, dy, dwa, line_height, text, 2)
  858.       class_index += 1
  859.       dy += line_height
  860.       break if dy + line_height > contents.height
  861.     end
  862.     dw = Graphics.width * 2 / 5 - 24
  863.     dx = contents.width - dw; dy = 0
  864.     param_id = 0
  865.     8.times do
  866.       colour = Color.new(0, 0, 0, translucent_alpha/2)
  867.       rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  868.       contents.fill_rect(rect, colour)
  869.       contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  870.       change_color(system_color)
  871.       draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id))
  872.       change_color(normal_color)
  873.       dwa = (Graphics.width * 2 / 5 - 2) / 2
  874.       draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2)
  875.       reset_font_settings
  876.       change_color(system_color)
  877.       draw_text(dx + dwa, dy, 22, line_height, "→", 1)
  878.       param_id += 1
  879.       dy += line_height
  880.       break if dy + line_height > contents.height
  881.     end
  882.   end
  883.   
  884. end # Window_StatusItem

  885. #==============================================================================
  886. # ■ Scene_Status
  887. #==============================================================================

  888. class Scene_Status < Scene_MenuBase
  889.   
  890.   #--------------------------------------------------------------------------
  891.   # start
  892.   #--------------------------------------------------------------------------
  893.   def start
  894.     super
  895.      
  896.     create_help_window
  897.     create_command_window
  898.     create_status_window
  899.     create_item_window
  900.     relocate_windows
  901.   end
  902.   
  903.   #--------------------------------------------------------------------------
  904.   # create_command_window
  905.   #--------------------------------------------------------------------------
  906.   def create_command_window
  907.     wy = @help_window.height
  908.     @command_window = Window_StatusCommand.new(0, wy)
  909.     @command_window.viewport = @viewport
  910.     @command_window.actor = @actor
  911.     @command_window.help_window = @help_window
  912.     @command_window.set_handler(:cancel,   method(:return_scene))
  913.     @command_window.set_handler(:pagedown, method(:next_actor))
  914.     @command_window.set_handler(:pageup,   method(:prev_actor))
  915.     process_custom_status_commands
  916.   end
  917.   
  918.   #--------------------------------------------------------------------------
  919.   # process_custom_status_commands
  920.   #--------------------------------------------------------------------------
  921.   def process_custom_status_commands
  922.     for command in YEA::STATUS::COMMANDS
  923.       next unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  924.       called_method = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][2]
  925.       @command_window.set_handler(command[0], method(called_method))
  926.     end
  927.   end
  928.   
  929.   #--------------------------------------------------------------------------
  930.   # create_status_window
  931.   #--------------------------------------------------------------------------
  932.   def create_status_window
  933.     wy = @help_window.height
  934.     @status_window = Window_StatusActor.new(@command_window.width, wy)
  935.     @status_window.viewport = @viewport
  936.     @status_window.actor = @actor
  937.   end
  938.   
  939.   #--------------------------------------------------------------------------
  940.   # create_item_window
  941.   #--------------------------------------------------------------------------
  942.   def create_item_window
  943.     dy = @command_window.y + @command_window.height
  944.     @item_window = Window_StatusItem.new(0, dy, @command_window)
  945.     @item_window.viewport = @viewport
  946.     @item_window.actor = @actor
  947.     @command_window.item_window = @item_window
  948.   end
  949.   
  950.   #--------------------------------------------------------------------------
  951.   # relocate_windows
  952.   #--------------------------------------------------------------------------
  953.   def relocate_windows
  954.     return unless $imported["YEA-AceMenuEngine"]
  955.     case Menu.help_window_location
  956.     when 0 # Top
  957.       @help_window.y = 0
  958.       @command_window.y = @help_window.height
  959.       @item_window.y = @command_window.y + @command_window.height
  960.     when 1 # Middle
  961.       @command_window.y = 0
  962.       @help_window.y = @command_window.height
  963.       @item_window.y = @help_window.y + @help_window.height
  964.     else # Bottom
  965.       @command_window.y = 0
  966.       @item_window.y = @command_window.height
  967.       @help_window.y = @item_window.y + @item_window.height
  968.     end
  969.     @status_window.y = @command_window.y
  970.   end
  971.   
  972.   #--------------------------------------------------------------------------
  973.   # on_actor_change
  974.   #--------------------------------------------------------------------------
  975.   def on_actor_change
  976.     @command_window.actor = @actor
  977.     @status_window.actor = @actor
  978.     @item_window.actor = @actor
  979.     @command_window.activate
  980.   end
  981.   
  982.   #--------------------------------------------------------------------------
  983.   # new method: command_name1
  984.   #--------------------------------------------------------------------------
  985.   def command_name1
  986.     SceneManager.call(Scene_Skill)
  987.   end
  988.   
  989.   #--------------------------------------------------------------------------
  990.   # new method: command_name2
  991.   #--------------------------------------------------------------------------
  992.   def command_name2
  993.     SceneManager.call(Scene_Equip)
  994.   end
  995.   
  996.   #--------------------------------------------------------------------------
  997.   # new method: command_name3
  998.   #--------------------------------------------------------------------------
  999.   def command_name3
  1000.     unless $imported["YEA-ClassSystem"]
  1001.       @command_window.activate
  1002.       return
  1003.     end
  1004.     SceneManager.call(Scene_Class)
  1005.   end
  1006.   
  1007. end # Scene_Status

  1008. #==============================================================================
  1009. #
  1010. # ▼ End of File
  1011. #
  1012. #==============================================================================
复制代码

评分

参与人数 1星屑 +80 收起 理由
Sion + 80 感谢帮忙

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
610
在线时间
925 小时
注册时间
2011-5-11
帖子
438
3
发表于 2014-3-25 11:02:38 | 只看该作者
本帖最后由 345912390 于 2014-3-25 17:16 编辑

下面脚本不知道是不是你想要的!
  1. class Window_Status < Window_Selectable
  2.         def draw_features_info(x_,y_)
  3.                 @elements_txt = {}
  4.                 elements = $data_system.elements
  5.                 elements.each_with_index{|x,y| @elements_txt[y] = x if x != ""}
  6.     i = 0
  7.     while i < @elements_txt.size
  8.       change_color(system_color)
  9.       draw_text(x_, y_ + line_height * i, 160, line_height, @elements_txt[i+1] + "属性:")
  10.       change_color(normal_color)
  11.       draw_text(x_ + 100, y_ + line_height * i,60, line_height,(100*@actor.features_sum(11,i+1)).to_i, 2)
  12.       i += 1
  13.     end
  14.         end
  15.         #--------------------------------------------------------------------------
  16.         # ● 刷新
  17.         #--------------------------------------------------------------------------
  18.         alias  refresh_20140325 refresh
  19.         def refresh
  20.                 refresh_20140325
  21.                 draw_features_info(450,line_height * 7)
  22.         end
  23. end
复制代码
下为图示

不好意思,以前的脚本有点问题,现在更新了一下!
@墨火  

点评

这个比我那个倒霉方案屌得多。因为我那个用技能填描述的方法查看起来一点都不直观……  发表于 2015-9-25 14:34
非常感谢大大的帮忙,我要的就是这样的效果。^_^  发表于 2014-3-25 13:37

评分

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

查看全部评分

http://rpg.blue/static/image/smiley/yct/A059.gif中国字认识都不到一半,哪的心情学英语呀!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
120
在线时间
486 小时
注册时间
2007-5-27
帖子
807
4
发表于 2014-3-25 11:48:47 | 只看该作者
本帖最后由 紫苍焰 于 2015-9-25 14:33 编辑

……
表示如果是不需要改变的在特性里填的东西的话……
做成不能使用的技能,在描述里填上具体效果就好。
比如我做的某个角色……
被动技能里有描述物理易伤20%,以及攻击力增加20%。只要给技能里单独设置一个被动类型,里面放的都是这种无法使用的技能就完事了。无法使用所以公式不用填写,但是查看角色的时候描述还是会显示的。
抗性什么的都可以做成类似的东西。如果嫌多可以好几条抗性用一个被动写。反正只要描述栏长度够用就没事。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-24 11:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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