查看: 4292|回复: 0

[已经过期] 半吊子求人请教

[复制链接]
梦石
0
星屑
50
在线时间
107 小时
注册时间
2012-8-20
回帖
39
发表于 2013-2-18 16:28:20 | 显示全部楼层 |阅读模式

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

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

×
  1. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  2. #==============================================================================
  3. #---------------------------------------------------
  4. # 本脚本来自66RPG.com,作者Deathless
  5. #---------------------------------------------------

  6. #-----------------------------------------------------
  7. # 功能设定
  8. # 当=1和=2,会改变图形的大小
  9. # =1的时候,图形为每个人自身的能力分配,最大数就是顶点
  10. # =2的时候,图形为所有人的能力分配,顶点为999
  11. #
  12. # 如果不需要999这么大,本脚本中搜索
  13. # "c[i] = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b[i] / 999.0)"
  14. # 把这个999修改了即可。
  15. #-----------------------------------------------------

  16. ST_DRAW_SIX_LINES_TYPE = 1

  17. class Bitmap
  18.   #--------------------------------------------------------------------------
  19.   # ● 描绘直线   
  20.   #     x1,y1,x2,y2:  直线两端的坐标
  21.   #     width:    宽度   
  22.   #     color:    颜色
  23.   #--------------------------------------------------------------------------
  24.   def drawline(x1, y1, x2, y2, width, color)
  25.     x1 = x1.to_f
  26.     y1 = y1.to_f
  27.     x2 = x2.to_f
  28.     y2 = y2.to_f
  29.     width = width.to_f
  30.     k = (y2 - y1) / (x2 - x1)
  31.     if k.abs > 1
  32.       drawline_x(x1, y1, x2, y2, width, color)
  33.     else
  34.       drawline_y(x1, y1, x2, y2, width, color)
  35.     end
  36.   end
  37.   def drawline_x(x1, y1, x2, y2, width, color)
  38.     l = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 * width / (y1 - y2)
  39.     length = l.abs * 2
  40.     k = (x2 - x1) / (y2 - y1) #x=ky+b
  41.     b = x1 - k * y1
  42.     if l > 0
  43.       for ty in y2.to_i..y1.to_i
  44.         tx = ty * k + b
  45.         fill_rect(tx - l, ty, length, 1, color)
  46.       end
  47.     else
  48.       for ty in y1.to_i..y2.to_i
  49.         tx = ty * k + b
  50.         fill_rect(tx + l, ty, length, 1, color)
  51.       end
  52.     end
  53.   end
  54.   def drawline_y(x1, y1, x2, y2, width, color)
  55.     l = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 * width / (x1 - x2)
  56.     height = l.abs * 2
  57.     k = (y2 - y1) / (x2 - x1) #y=kx+b
  58.     b = y1 - k * x1
  59.     if l > 0
  60.       for tx in x2.to_i..x1.to_i
  61.         ty = tx * k + b
  62.         fill_rect(tx, ty - l, 1, height, color)
  63.       end
  64.     else
  65.       for tx in x1.to_i..x2.to_i
  66.         ty = tx * k + b
  67.         fill_rect(tx, ty + l, 1, height, color)
  68.       end
  69.     end
  70.   end
  71. end
  72. # ■ Window_Status
  73. #------------------------------------------------------------------------------
  74. #  显示状态画面、完全规格的状态窗口。
  75. #==============================================================================

  76. class Window_Status < Window_Base
  77.   #--------------------------------------------------------------------------
  78.   # ● 刷新
  79.   #--------------------------------------------------------------------------
  80.   def get_position(x_begin, y_begin, x_end, y_end, percent)
  81.     a = []
  82.     a[0] = x_begin + (x_end - x_begin) * percent
  83.     a[1] = y_begin + (y_end - y_begin) * percent
  84.     return a
  85.   end
  86.   def refresh
  87.     self.contents.clear
  88.     x0 = 60 #图表的坐标
  89.     y0 = 220
  90.     r = 100.0 #图表的大小,友情提示:浮点数后面的.0不要省略了
  91.     h = 3 ** 0.5 * r / 2
  92.     a = [] #六边形的顶点和圆心
  93.     a[0] = [r, h] #圆心
  94.     a[1] = [r / 2, 0.0]
  95.     a[2] = [r * 3 / 2, 0.0]
  96.     a[6] = [0.0, h]
  97.     a[3] = [r * 2, h]
  98.     a[5] = [r / 2, h * 2]
  99.     a[4] = [r * 3 / 2, h * 2]
  100.     for i in a
  101.       i[0] += x0
  102.       i[1] += y0
  103.     end
  104.     self.contents.font.color = Color.new(128, 255, 255, 255)
  105.     self.contents.draw_text(a[1][0] - 16 , a[1][1] - 32, 80, 32, "攻击")
  106.     self.contents.draw_text(a[2][0] - 4, a[2][1] - 32, 80, 32, "防御")
  107.     self.contents.draw_text(a[6][0] - 28, a[6][1] - 16, 80, 32, "力量")
  108.     self.contents.draw_text(a[5][0] - 16, a[5][1], 80, 32, "敏捷")
  109.     self.contents.draw_text(a[4][0] - 4, a[4][1], 80, 32, "速度")
  110.     self.contents.draw_text(a[3][0] + 8, a[3][1] - 16, 80, 32, "魔力")
  111.     #描绘边框
  112.     for i in 1...a.size
  113.       self.contents.drawline(a[0][0], a[0][1], a[i][0], a[i][1], 1, disabled_color)
  114.     end
  115.     self.contents.drawline(a[1][0], a[1][1], a[2][0], a[2][1], 1, text_color(6))
  116.     self.contents.drawline(a[2][0], a[2][1], a[3][0], a[3][1], 1, text_color(6))
  117.     self.contents.drawline(a[3][0], a[3][1], a[4][0], a[4][1], 1, text_color(6))
  118.     self.contents.drawline(a[4][0], a[4][1], a[5][0], a[5][1], 1, text_color(6))
  119.     self.contents.drawline(a[5][0], a[5][1], a[6][0], a[6][1], 1, text_color(6))
  120.     self.contents.drawline(a[6][0], a[6][1], a[1][0], a[1][1], 1, text_color(6))
  121.     #描绘能力曲线
  122.     b = [] #获取能力值
  123.     b.push(@actor.atk)
  124.     b.push(@actor.pdef)
  125.     b.push(@actor.int)
  126.     b.push(@actor.agi)
  127.     b.push(@actor.dex)
  128.     b.push(@actor.str)
  129. case ST_DRAW_SIX_LINES_TYPE
  130. when 2
  131.     #跟999作比较
  132.     c = []
  133.     for i in 0...b.size
  134.       c[i] = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b[i] / 999.0)
  135.     end
  136.     for i in 0...c.size
  137.       self.contents.drawline(c[i][0], c[i][1], c[i-1][0], c[i-1][1], 1, text_color(3))
  138.     end   
  139. when 1
  140.     #跟最高能力值比较
  141.     max_abi = 0
  142.     b.each{|i| max_abi = [max_abi, i].max}
  143.     max_abi = max_abi.to_f
  144.     c = [] #获得能力值的坐标
  145.     for i in 0...b.size
  146.       c[i] = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b[i] / max_abi)
  147.     end
  148.     for i in 0...c.size
  149.       self.contents.drawline(c[i][0], c[i][1], c[i-1][0], c[i-1][1], 1, text_color(3))
  150.     end   
  151. end
  152.     #描绘能力数值
  153.     self.contents.font.color = knockout_color
  154.     self.contents.font.size = 14
  155.     for i in 0...b.size
  156.       self.contents.draw_text(c[i][0], c[i][1], 32, 24, b[i].to_s)
  157.     end
  158.     self.contents.font.size = 22
  159.     #以下未修改   
  160.     draw_actor_graphic(@actor, 40, 112)
  161.     draw_actor_name(@actor, 4, 0)
  162.     draw_actor_class(@actor, 4 + 144, 0)
  163.     draw_actor_level(@actor, 96, 32)
  164.     draw_actor_state(@actor, 96, 64)
  165.     draw_actor_hp(@actor, 96, 112, 172)
  166.     draw_actor_sp(@actor, 96, 144, 172)
  167.     draw_actor_parameter(@actor, 96, 192, 0)
  168.     draw_actor_parameter(@actor, 96, 224, 1)
  169.     draw_actor_parameter(@actor, 96, 256, 2)
  170.     draw_actor_parameter(@actor, 96, 304, 3)
  171.     draw_actor_parameter(@actor, 96, 336, 4)
  172.     draw_actor_parameter(@actor, 96, 368, 5)
  173.     draw_actor_parameter(@actor, 96, 400, 6)
  174.     self.contents.font.color = system_color
  175.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  176.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  177.     self.contents.font.color = normal_color
  178.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  179.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  180.     self.contents.font.color = system_color
  181.     self.contents.draw_text(320, 160, 96, 32, "装备")
  182.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  183.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 240)
  184.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 272)
  185.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 304)
  186.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 336)
  187.     draw_item_name($data_armors[@actor.armor5_id], 320 + 16, 368)
  188.     draw_item_name($data_armors[@actor.armor6_id], 320 + 16, 400)
  189.   end
  190.   def dummy
  191.     self.contents.font.color = system_color
  192.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  193.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  194.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  195.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  196.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  197.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  198.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  199.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  200.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  201.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  202.   end
  203. end
复制代码

脚本如上,是XP的一个状态界面美化脚本,用六边形的6个顶点表示6个属性。我觉得这个脚本很强大,不发扬太可惜了,求脚本帝改为VA脚本,让游戏更美观。
其次,对VA而言,现有的公开横版战斗系统太简陋,不像VX一样看战斗是种享受。求珍藏着先进脚本的大神能分享下,让新手也能用VA创造出美丽的战斗。
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部