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

Project1

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

[已经过期] 如何显示变量

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1438
在线时间
328 小时
注册时间
2016-4-4
帖子
168

开拓者

跳转到指定楼层
1
发表于 2016-7-30 13:53:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   #取得当前角色
  3.   #--------------------------------------------------------------------------
  4.   class Scene_Battle
  5.     alias lqc_phase3_setup_command_window phase3_setup_command_window
  6.     def phase3_setup_command_window
  7.       $active_now = $game_party.actors[@actor_index]
  8.       lqc_phase3_setup_command_window
  9.     end
  10.   end
  11. #==============================================================================
  12. # ■ Window_Help
  13. #------------------------------------------------------------------------------
  14. #  特技及物品的说明、角色的状态显示的窗口。
  15. #==============================================================================
  16.  
  17. class Window_SkillHelp < Window_Base
  18.   #--------------------------------------------------------------------------
  19.   # ● 初始化对像
  20.   #--------------------------------------------------------------------------
  21.   def initialize
  22.     super(320-50, 0, 320+50,416)
  23.     self.contents = Bitmap.new(width - 32, height - 32)
  24.     if $game_temp.in_battle
  25.       self.height = 256+64
  26.       self.back_opacity = 160
  27.     end
  28.   end   
  29.   #--------------------------------------------------------------------------
  30.   # ● 设置文本
  31.   #     text  : 窗口显示的字符串
  32.   #     align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
  33.   #--------------------------------------------------------------------------
  34.   def set_text(skill)
  35.     if skill !=nil
  36.       fontsize=18        #定义文字大小
  37.       infx=100           #定义说明文字左边内容的宽度
  38.       y=20               #定义行距
  39.       self.contents.clear
  40.       self.contents.font.color = normal_color
  41.       self.contents.font.size = fontsize
  42.       xx=0
  43.       yy=0
  44.       yy = -160 if $skill_second_page
  45.       s=[]
  46.       s=skill.description.scan(/./)
  47.       space = self.contents.text_size(" ").width
  48.       #一行显示21个字
  49.       for i in s
  50.         sss = self.contents.text_size(i)
  51.         if (xx+sss.width)>(width - 32)#超过屏幕就换行
  52.           yy+=y
  53.           xx=4
  54.         end
  55.         self.contents.draw_text(xx, yy, sss.width, sss.height, i)
  56.         xx+=sss.width
  57.       end
  58.       self.contents.font.size = fontsize
  59.       #-------------------------------------------------------------------
  60.       #描画技能类型
  61.       #-------------------------------------------------------------------
  62.           hurt_flag = false
  63.           curse_flag = false
  64.           heal_flag = false
  65.           cure_flag = false
  66.         if skill.common_event_id > 0
  67.           the_event = Game_CommonEvent.new(skill.common_event_id)
  68.           for i in the_event.list
  69.             the_parameters = i.parameters
  70.             the_code = i.code
  71.             case the_code
  72.               when 331
  73.                 if the_parameters[1] == 1
  74.                   hurt_flag = true
  75.                 end
  76.               when 332
  77.                 if the_parameters[1] == 1
  78.                   hurt_flag = true
  79.                 end
  80.               when 338
  81.                 if the_parameters[0] == 0
  82.                   hurt_flag = true
  83.                 end
  84.                 if the_parameters[0] == 1
  85.                   heal_flag = true
  86.                 end
  87.               when 333
  88.                 curse_flag = true
  89.               when 311
  90.                 if the_parameters[1] == 0
  91.                   heal_flag = true
  92.                 end
  93.               when 312
  94.                 if the_parameters[1] == 0
  95.                   heal_flag = true
  96.                 end
  97.               when 313
  98.                 cure_flag = true
  99.             end
  100.           end
  101.         end
  102.  
  103.         xx=0
  104.         yy+=y
  105.         self.contents.font.color = system_color
  106.         self.contents.draw_text(xx, yy, infx, sss.height, "技能类型")
  107.         xx = infx
  108.         if skill.occasion == 3
  109.           self.contents.font.color = normal_color
  110.           self.contents.draw_text(xx, yy, 40, sss.height, "被动")
  111.           xx += 40
  112.         end
  113.         if skill.scope == 1 || skill.scope == 2
  114.           if skill.atk_f > 0
  115.             self.contents.font.color = Color.new(220, 20, 60, 255)
  116.             self.contents.draw_text(xx, yy, 40, sss.height, "物理")
  117.             xx += 40   
  118.           elsif skill.power > 0
  119.             self.contents.font.color = Color.new(0, 191, 255, 255)
  120.             self.contents.draw_text(xx, yy, 40, sss.height, "魔法")
  121.             xx += 40
  122.           end
  123.      #     if skill.plus_state_set.size > 0 or skill.minus_state_set.size > 0 or curse_flag
  124.      #       self.contents.font.color = Color.new(128, 0, 128, 255)
  125.      #       self.contents.draw_text(xx, yy, 40, sss.height, "妨害")
  126.      #       xx += 40
  127.      #     end
  128.         end
  129.         if skill.scope >= 3 and skill.scope <= 7
  130.           if skill.atk_f < 0 or skill.power < 0 or heal_flag
  131.             self.contents.font.color = Color.new(50, 205, 50, 255)
  132.             self.contents.draw_text(xx, yy, 40, sss.height, "恢复")
  133.             xx += 40
  134.           end
  135.      #     if skill.plus_state_set.size > 0 or skill.minus_state_set.size > 0 or cure_flag
  136.      #       self.contents.font.color = Color.new(72, 209, 204, 255)
  137.      #       self.contents.draw_text(xx, yy, 40, sss.height, "祝福")
  138.      #       xx += 40
  139.      #     end
  140.         end
  141.       #  if skill.common_event_id > 0
  142.       #    if hurt_flag
  143.       #    self.contents.font.color = Color.new(255, 69, 0, 255)
  144.       #    self.contents.draw_text(xx, yy, 40, sss.height, "特殊")
  145.       #    xx += 40
  146.       #    end
  147.       #  end
  148.         if xx == 100
  149.           self.contents.font.color = disabled_color
  150.           self.contents.draw_text(xx, yy, 58, sss.height, "未分类")
  151.           xx += 58
  152.         end
  153.       #-------------------------------------------------------------------
  154.       #描画使用场合
  155.       #-------------------------------------------------------------------
  156.      # if skill.occasion != 3
  157.      #   xx=0
  158.      #   yy+=y
  159.      #   self.contents.font.color=system_color
  160.      #   self.contents.draw_text(xx, yy, infx, sss.height, "使用时机")
  161.      #   xx=infx
  162.      #   case skill.occasion
  163.      #     when 0
  164.      #       i="任何时候"
  165.      #     when 1
  166.      #       i="仅战斗中"
  167.      #     when 2
  168.      #       i="仅菜单中"
  169.      #   end
  170.         self.contents.font.color=normal_color
  171.         self.contents.draw_text(xx, yy, infx, sss.height, i)
  172.       #-------------------------------------------------------------------
  173.       #描画效果范围
  174.       #-------------------------------------------------------------------
  175.       xx=0
  176.       yy+=y
  177.       self.contents.font.color=system_color
  178.       self.contents.draw_text(xx, yy, infx, sss.height, "效果范围")
  179.       xx=infx                                 
  180.       self.contents.font.color=normal_color
  181.       case skill.scope
  182.         when 0
  183.           i="无"
  184.         when 1
  185.           i="敌方单体"
  186.         when 2
  187.           i="敌方全体"
  188.         when 3
  189.           i="我方单体"
  190.         when 4
  191.           i="我方全体"
  192.         when 5
  193.           i="我方战斗不能单体"
  194.         when 6
  195.           i="我方战斗不能全体"
  196.         when 7
  197.           i="自身"
  198.       end
  199.       self.contents.draw_text(xx, yy, infx, sss.height, i)
  200.     #---------------------------------------------------------------------------
  201.     #伤害估算
  202.     #---------------------------------------------------------------------------
  203.       if $game_temp.in_battle
  204.       xx = 0
  205.       yy += y
  206.       #--------------------------------------------------
  207.       #求对敌人伤害
  208.       #--------------------------------------------------
  209.       x_powers = 0
  210.       x_user = $active_now
  211.       if skill.scope == 1 or skill.scope == 2
  212.         self.contents.font.color=system_color
  213.         self.contents.draw_text(xx, yy, 100, sss.height, "预计威力")
  214.         enemies_court = 0
  215.         for x_enemy in $game_troop.enemies
  216.         if x_enemy.is_a?(Game_Enemy)
  217.         x_power = skill.power + x_user.atk * skill.atk_f / 100
  218.         if x_power > 0
  219.        # x_power -= x_enemy.pdef * skill.pdef_f / 200
  220.        # x_power -= x_enemy.mdef * skill.mdef_f / 200
  221.         x_power = [x_power, 0].max
  222.         end
  223.         rate = 1.0
  224.         rate += (x_user.str * skill.str_f / 2000)
  225.         rate += (x_user.dex * skill.dex_f / 2000)
  226.         rate += (x_user.agi * skill.agi_f / 2000)
  227.         rate += (x_user.int * skill.int_f / 2000)
  228.         x_power *= rate
  229.         x_power *= x_enemy.elements_correct(skill.element_set).to_f
  230.         x_power /= 100.0
  231.         if x_power > 0
  232.         if x_enemy.guarding?
  233.           x_power /= 2
  234.         end
  235.         end
  236.         x_powers += x_power
  237.         enemies_court += 1
  238.         end
  239.       end
  240.       out_power = enemies_court == 0 ? 0 : (x_powers / enemies_court)
  241.       out_power_max = out_power * (100 + skill.variance) / 100.0
  242.       out_power_max = out_power_max.to_i
  243.       out_power_min = out_power * (100 - skill.variance) / 100.0
  244.       out_power_min = out_power_min.to_i
  245.       xx = 100
  246.       #------------------------------------------------------------------------
  247.       #------------------------------------------------------------------------
  248.       self.draw_text_add(xx-1, yy-1, 100, sss.height, out_power_min.to_s + " - " + out_power_max.to_s,255,20,147,255)
  249.       #-----------------------------------------------------------------------------
  250.       #求对自己的恢复量
  251.       #-----------------------------------------------------------------------------
  252.       elsif skill.scope >= 3
  253.         self.contents.font.color=Color.new(0,255,0,255)
  254.         self.contents.draw_text(xx, yy, 100, sss.height, "预计恢复")
  255.         actors_court = 0
  256.         for x_actor in $game_party.actors
  257.          if x_actor.is_a?(Game_Actor)
  258.          x_power = skill.power + x_user.atk * skill.atk_f / 100
  259.           if x_power > 0
  260.        #    x_power -= x_actor.pdef * skill.pdef_f / 200
  261.        #    x_power -= x_actor.mdef * skill.mdef_f / 200
  262.            x_power = [x_power, 0].max
  263.           end
  264.          rate = 1.0
  265.          rate += (x_user.str * skill.str_f / 2000)
  266.          rate += (x_user.dex * skill.dex_f / 2000)
  267.          rate += (x_user.agi * skill.agi_f / 2000)
  268.          rate += (x_user.int * skill.int_f / 2000)
  269.          x_power *= rate
  270.          x_power *= x_actor.elements_correct(skill.element_set).to_f
  271.          x_power /= 100.0
  272.          x_powers += x_power
  273.          actors_court += 1
  274.          end
  275.         end
  276.       out_power = actors_court == 0 ? 0 : (x_powers / actors_court)
  277.       out_power_max = out_power * (100 + skill.variance) / 100.0
  278.       out_power_max = - out_power_max.to_i
  279.       out_power_min = out_power * (100 - skill.variance) / 100.0
  280.       out_power_min = - out_power_min.to_i
  281.       xx = 100
  282.       self.draw_text_add(xx, yy, 100, sss.height, out_power_min.to_s + " - " + out_power_max.to_s,127,255,0,255)
  283.     end
  284.     #--------------------------------------------------------------------
  285.     #计算命中率
  286.     #--------------------------------------------------------------------
  287.     if skill.scope == 1 or skill.scope == 2
  288.     xx = 200
  289.     self.contents.font.color=system_color
  290.     self.contents.draw_text(xx, yy, 75, sss.height, "结算命中")
  291.     xx += 75
  292.     hit = skill.hit
  293.     hit *= x_user.hit / 100
  294.     s_hits = 0
  295.     enemies_court = 0
  296.     for x_enemy in $game_troop.enemies
  297.       eva = 8 * x_enemy.agi / x_user.dex + x_enemy.eva
  298.       s_hit = 100 - eva * skill.eva_f / 100
  299.       s_hit = x_enemy.cant_evade? ? 100 : s_hit
  300.       s_hits += s_hit * hit / 100
  301.       enemies_court += 1
  302.     end
  303.     hit = enemies_court ? (s_hits / enemies_court) : 0
  304.     hit = [[hit.to_i,100].min,0].max
  305.     self.draw_text_add(xx, yy, 100, sss.height, hit.to_s + "%",193,255,193,255)
  306.     end
  307.     xx=0
  308.     yy+=y
  309.     yy+=2
  310.     self.contents.font.color=system_color
  311.     self.contents.draw_text(xx, yy, infx, sss.height, "平均")
  312.     xx+=infx
  313.     self.contents.font.size = 22
  314.       if skill.scope == 1 or skill.scope == 2
  315.         self.contents.font.color=Color.new(255,215,0,255)
  316.         self.contents.draw_text(xx, yy, infx, 22,(out_power * hit /100).to_i.to_s)
  317.       elsif skill.scope >= 3
  318.         self.contents.font.color=Color.new(255,215,0,255)
  319.         self.contents.draw_text(xx, yy, infx, 22,out_power.to_i.to_s)
  320.       end
  321.     yy+=2
  322.     end
  323.     #--------------------------------------------------------------------
  324.     #描画基础威力
  325.     #--------------------------------------------------------------------
  326.       xx=0
  327.       yy+=y
  328.       self.contents.font.size = fontsize
  329.       self.contents.font.color=system_color
  330.       self.contents.draw_text(xx, yy, infx, sss.height, "基本威力")
  331.       xx=infx
  332.       self.contents.font.color=normal_color
  333.       self.contents.draw_text(xx, yy, infx*2, sss.height, skill.power.to_s)
  334.     #--------------------------------------------------------------------
  335.     #描画攻击计算依据
  336.     #--------------------------------------------------------------------
  337.     if skill.atk_f + skill.power != 0
  338.       xx=0
  339.       yy+=y
  340.       self.contents.font.color=system_color
  341.       self.contents.draw_text(xx, yy, infx, sss.height, "属性参数")
  342.       xx=infx
  343.       self.contents.font.color=normal_color
  344.       infx = 54
  345.       if skill.atk_f != 0
  346.         self.contents.draw_text(xx, yy, infx, sss.height, "| ATK " )
  347.         xx += infx
  348.       end
  349.       if skill.str_f != 0
  350.         self.contents.draw_text(xx, yy, infx, sss.height, "| STR " )
  351.         xx += infx
  352.       end
  353.       if skill.dex_f != 0
  354.         self.contents.draw_text(xx, yy, infx, sss.height, "| DEX " )
  355.         xx += infx
  356.       end
  357.       if skill.agi_f != 0
  358.         self.contents.draw_text(xx, yy, infx, sss.height, "| AGI " )
  359.         xx += infx
  360.       end
  361.       if skill.int_f != 0
  362.         self.contents.draw_text(xx, yy, infx, sss.height, "| INT " )
  363.         xx += infx
  364.       end
  365.         self.contents.draw_text(xx, yy, infx, sss.height, "|" )
  366.       xx = 100
  367.       yy += 10
  368.       if skill.atk_f != 0
  369.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  370.         xx += infx
  371.       end
  372.       if skill.str_f != 0
  373.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  374.         xx += infx
  375.       end
  376.       if skill.dex_f != 0
  377.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  378.         xx += infx
  379.       end
  380.       if skill.agi_f != 0
  381.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  382.         xx += infx
  383.       end
  384.       if skill.int_f != 0
  385.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  386.         xx += infx
  387.       end
  388.         self.contents.draw_text(xx, yy, infx, sss.height, "|" )
  389.       xx = 100
  390.       yy += 10
  391.       if skill.atk_f != 0
  392.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + skill.atk_f.to_s + " ")
  393.         xx += infx
  394.       end
  395.       if skill.str_f != 0
  396.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + skill.str_f.to_s + " " )
  397.         xx += infx
  398.       end
  399.       if skill.dex_f != 0
  400.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + skill.dex_f.to_s + " " )
  401.         xx += infx
  402.       end
  403.       if skill.agi_f != 0
  404.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + skill.agi_f.to_s + " ")
  405.         xx += infx
  406.       end
  407.       if skill.int_f != 0
  408.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + skill.int_f.to_s + " " )
  409.         xx += infx
  410.       end
  411.         self.contents.draw_text(xx, yy, infx, sss.height, "|" )
  412.       if $game_temp.in_battle
  413.       xx=100
  414.       yy += 10
  415.       self.contents.font.color=normal_color
  416.       if skill.atk_f != 0
  417.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  418.         xx += infx
  419.       end
  420.       if skill.str_f != 0
  421.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  422.         xx += infx
  423.       end
  424.       if skill.dex_f != 0
  425.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  426.         xx += infx
  427.       end
  428.       if skill.agi_f != 0
  429.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  430.         xx += infx
  431.       end
  432.       if skill.int_f != 0
  433.         self.contents.draw_text(xx, yy, infx, sss.height, "|  ")
  434.         xx += infx
  435.       end
  436.         self.contents.draw_text(xx, yy, infx, sss.height, "|" )
  437.       xx=0
  438.       yy+=10
  439.       self.contents.font.color=system_color
  440.       self.contents.draw_text(xx, yy, 100, sss.height, "角色属性")
  441.       xx = 100
  442.       self.contents.font.color=normal_color
  443.       if skill.atk_f != 0
  444.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + $active_now.atk.to_s + " ")
  445.         xx += infx
  446.       end
  447.       if skill.str_f != 0
  448.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + $active_now.str.to_s + " " )
  449.         xx += infx
  450.       end
  451.       if skill.dex_f != 0
  452.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + $active_now.dex.to_s + " " )
  453.         xx += infx
  454.       end
  455.       if skill.agi_f != 0
  456.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + $active_now.agi.to_s + " ")
  457.         xx += infx
  458.       end
  459.       if skill.int_f != 0
  460.         self.contents.draw_text(xx, yy, infx, sss.height, "| " + $active_now.int.to_s + " " )
  461.         xx += infx
  462.       end
  463.         self.contents.draw_text(xx, yy, infx, sss.height, "|" )
  464.       end
  465.       end
  466.       #-----------------------------------------------------------------------------
  467.       #防御计算值
  468.       #-----------------------------------------------------------------------------
  469.       infx = 100
  470.       xx = 0
  471.       yy += y
  472.       self.contents.font.color=system_color
  473.       self.contents.draw_text(xx, yy, infx, sss.height, "伤害类型")
  474.       xx=infx
  475.       self.contents.font.color=normal_color
  476.       if skill.pdef_f == 0 and skill.mdef_f != 0
  477.       self.contents.draw_text(xx, yy, infx, sss.height, "[魔法]")
  478.       elsif skill.pdef_f != 0 and skill.mdef_f == 0
  479.       self.contents.draw_text(xx, yy, infx, sss.height, "[物理]")
  480.       elsif skill.pdef_f != 0 and skill.mdef_f != 0
  481.       self.contents.draw_text(xx, yy, infx, sss.height, "[混合]")
  482.       elsif skill.pdef_f == 0 and skill.mdef_f == 0
  483.       self.contents.draw_text(xx, yy, infx, sss.height, "[无视防御]")
  484.       end
  485.       #-----------------------------------------------------------------------
  486.       #波动度
  487.       #-----------------------------------------------------------------------
  488.       unless $game_temp.in_battle
  489.         xx=0
  490.         yy+=y
  491.         self.contents.font.color=system_color
  492.         self.contents.draw_text(xx, yy, infx, sss.height, "威力波动度")
  493.         xx=infx
  494.         self.contents.font.color=normal_color
  495.         self.contents.draw_text(xx, yy, infx*2, sss.height, skill.variance.to_s)
  496.       #-----------------------------------------------------------------------
  497.       #基本命中率
  498.       #-----------------------------------------------------------------------
  499.         xx=0
  500.         yy+=y
  501.         self.contents.font.color=system_color
  502.         self.contents.draw_text(xx, yy, infx, sss.height, "基础命中")
  503.         xx=infx
  504.         self.contents.font.color=normal_color
  505.         self.contents.draw_text(xx, yy, infx, sss.height, skill.hit.to_s)
  506.         xx+=45
  507.         if skill.eva_f != 100
  508.           self.contents.font.color=system_color
  509.           self.contents.draw_text(xx, yy, 90, sss.height, "无视百分之")
  510.           xx+=90
  511.           self.contents.font.color=normal_color
  512.           self.contents.draw_text(xx, yy, 36, sss.height, (100 - skill.eva_f).to_s)
  513.           xx+=36
  514.           self.contents.font.color=system_color
  515.           self.contents.draw_text(xx, yy, 36, sss.height, "回避")
  516.         end
  517.       end
  518.  
  519.       #-----------------------------------------------------------------------
  520.       xx=0
  521.       yy+=y
  522.       element=""
  523.       for i in skill.element_set
  524.         if i <= 17
  525.           element =element+" "+$data_system.elements[i]
  526.         end
  527.       end
  528.       self.contents.font.color=system_color
  529.       self.contents.draw_text(xx, yy, infx, sss.height, "技能属性")
  530.       xx=infx-space
  531.       self.contents.font.color=normal_color
  532.       s=[]
  533.       s=element.scan(/./)
  534.       #一行显示21个字
  535.       for i in s
  536.         sss = self.contents.text_size(i)
  537.         if (xx+sss.width)>(width - 32)#超过屏幕就换行
  538.           yy+=y
  539.           xx=infx
  540.         end
  541.         self.contents.draw_text(xx, yy, sss.width, sss.height, i)
  542.         xx+=sss.width
  543.       end
  544.       xx=0
  545.       yy+=y
  546.       race=""
  547.       for i in skill.plus_state_set
  548.           race += "["+$data_states[i].name+"]" if $data_states[i].name != ""
  549.       end
  550.       self.contents.font.color=system_color
  551.       self.contents.draw_text(xx, yy, infx, sss.height, "附加状态")
  552.       xx=infx
  553.       self.contents.font.color=normal_color
  554.       s=[]
  555.       s=race.scan(/./)
  556.       #一行显示21个字
  557.       for i in s
  558.         sss = self.contents.text_size(i)
  559.         if (xx+sss.width)>(width - 32)#超过屏幕就换行
  560.           yy+=y
  561.           xx=infx
  562.         end
  563.         self.contents.draw_text(xx, yy, sss.width, sss.height, i)
  564.         xx+=sss.width
  565.       end
  566.       xx=0
  567.       yy+=y
  568.       race=""
  569.       for i in skill.minus_state_set
  570.           race += "["+$data_states[i].name+"]" if $data_states[i].name != ""
  571.       end
  572.       self.contents.font.color=system_color
  573.       self.contents.draw_text(xx, yy, infx, sss.height, "解除状态")
  574.       xx=infx
  575.       self.contents.font.color=normal_color
  576.       s=[]
  577.       s=race.scan(/./)
  578.       #一行显示21个字
  579.       for i in s
  580.         sss = self.contents.text_size(i)
  581.         if (xx+sss.width)>(width - 32)#超过屏幕就换行
  582.           yy+=y
  583.           xx=infx
  584.         end
  585.         self.contents.draw_text(xx, yy, sss.width, sss.height, i)
  586.         xx+=sss.width
  587.       end
  588.       @actor = nil
  589.     end
  590.     end
  591.     self.visible = true
  592.   end
  593.   def draw_text_add(xx,yy,width,height,i,red,green,blue,gray)
  594.       self.contents.font.color = Color.new(0,0,0,255)
  595.       self.contents.draw_text(xx-1, yy-1,width,height,i)
  596.       self.contents.draw_text(xx, yy-1,width,height,i)
  597.       self.contents.draw_text(xx+1, yy-1,width,height,i)
  598.       self.contents.draw_text(xx-1, yy,width,height,i)
  599.       self.contents.draw_text(xx+1, yy,width,height,i)
  600.       self.contents.draw_text(xx-1, yy+1,width,height,i)
  601.       self.contents.draw_text(xx, yy+1,width,height,i)
  602.       self.contents.draw_text(xx+1, yy+1,width,height,i)
  603.       self.contents.font.color = Color.new(red,green,blue,gray)
  604.       self.contents.draw_text(xx, yy,width,height,i)
  605.     end
  606. end

如何在“预计威力”处显示变量的值
比如变量1[伤害计算]的值为100的情况下
如何使“预计威力”处显示变量1

Lv3.寻梦者

梦石
0
星屑
1358
在线时间
1295 小时
注册时间
2012-8-4
帖子
749
2
发表于 2016-8-2 19:07:10 | 只看该作者
self.contents.draw_text(xx, yy, 100, sss.height,$game_variables[1]) 这样?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 06:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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