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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
107 小时
注册时间
2012-8-20
帖子
54
跳转到指定楼层
1
 楼主| 发表于 2013-2-18 16:28:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
[pre lang="ruby" line="1" file="六边形界面"]# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
#---------------------------------------------------
# 本脚本来自66RPG.com,作者Deathless
#---------------------------------------------------

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

ST_DRAW_SIX_LINES_TYPE = 1

class Bitmap
  #--------------------------------------------------------------------------
  # ● 描绘直线   
  #     x1,y1,x2,y2:  直线两端的坐标
  #     width:    宽度   
  #     color:    颜色
  #--------------------------------------------------------------------------
  def drawline(x1, y1, x2, y2, width, color)
    x1 = x1.to_f
    y1 = y1.to_f
    x2 = x2.to_f
    y2 = y2.to_f
    width = width.to_f
    k = (y2 - y1) / (x2 - x1)
    if k.abs > 1
      drawline_x(x1, y1, x2, y2, width, color)
    else
      drawline_y(x1, y1, x2, y2, width, color)
    end
  end
  def drawline_x(x1, y1, x2, y2, width, color)
    l = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 * width / (y1 - y2)
    length = l.abs * 2
    k = (x2 - x1) / (y2 - y1) #x=ky+b
    b = x1 - k * y1
    if l > 0
      for ty in y2.to_i..y1.to_i
        tx = ty * k + b
        fill_rect(tx - l, ty, length, 1, color)
      end
    else
      for ty in y1.to_i..y2.to_i
        tx = ty * k + b
        fill_rect(tx + l, ty, length, 1, color)
      end
    end
  end
  def drawline_y(x1, y1, x2, y2, width, color)
    l = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 * width / (x1 - x2)
    height = l.abs * 2
    k = (y2 - y1) / (x2 - x1) #y=kx+b
    b = y1 - k * x1
    if l > 0
      for tx in x2.to_i..x1.to_i
        ty = tx * k + b
        fill_rect(tx, ty - l, 1, height, color)
      end
    else
      for tx in x1.to_i..x2.to_i
        ty = tx * k + b
        fill_rect(tx, ty + l, 1, height, color)
      end
    end
  end
end
# ■ Window_Status
#------------------------------------------------------------------------------
#  显示状态画面、完全规格的状态窗口。
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def get_position(x_begin, y_begin, x_end, y_end, percent)
    a = []
    a[0] = x_begin + (x_end - x_begin) * percent
    a[1] = y_begin + (y_end - y_begin) * percent
    return a
  end
  def refresh
    self.contents.clear
    x0 = 60 #图表的坐标
    y0 = 220
    r = 100.0 #图表的大小,友情提示:浮点数后面的.0不要省略了
    h = 3 ** 0.5 * r / 2
    a = [] #六边形的顶点和圆心
    a[0] = [r, h] #圆心
    a[1] = [r / 2, 0.0]
    a[2] = [r * 3 / 2, 0.0]
    a[6] = [0.0, h]
    a[3] = [r * 2, h]
    a[5] = [r / 2, h * 2]
    a[4] = [r * 3 / 2, h * 2]
    for i in a
      i[0] += x0
      i[1] += y0
    end
    self.contents.font.color = Color.new(128, 255, 255, 255)
    self.contents.draw_text(a[1][0] - 16 , a[1][1] - 32, 80, 32, "攻击")
    self.contents.draw_text(a[2][0] - 4, a[2][1] - 32, 80, 32, "防御")
    self.contents.draw_text(a[6][0] - 28, a[6][1] - 16, 80, 32, "力量")
    self.contents.draw_text(a[5][0] - 16, a[5][1], 80, 32, "敏捷")
    self.contents.draw_text(a[4][0] - 4, a[4][1], 80, 32, "速度")
    self.contents.draw_text(a[3][0] + 8, a[3][1] - 16, 80, 32, "魔力")
    #描绘边框
    for i in 1...a.size
      self.contents.drawline(a[0][0], a[0][1], a[0], a[1], 1, disabled_color)
    end
    self.contents.drawline(a[1][0], a[1][1], a[2][0], a[2][1], 1, text_color(6))
    self.contents.drawline(a[2][0], a[2][1], a[3][0], a[3][1], 1, text_color(6))
    self.contents.drawline(a[3][0], a[3][1], a[4][0], a[4][1], 1, text_color(6))
    self.contents.drawline(a[4][0], a[4][1], a[5][0], a[5][1], 1, text_color(6))
    self.contents.drawline(a[5][0], a[5][1], a[6][0], a[6][1], 1, text_color(6))
    self.contents.drawline(a[6][0], a[6][1], a[1][0], a[1][1], 1, text_color(6))
    #描绘能力曲线
    b = [] #获取能力值
    b.push(@actor.atk)
    b.push(@actor.pdef)
    b.push(@actor.int)
    b.push(@actor.agi)
    b.push(@actor.dex)
    b.push(@actor.str)
case ST_DRAW_SIX_LINES_TYPE
when 2
    #跟999作比较
    c = []
    for i in 0...b.size
      c = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b / 999.0)
    end
    for i in 0...c.size
      self.contents.drawline(c[0], c[1], c[i-1][0], c[i-1][1], 1, text_color(3))
    end   
when 1
    #跟最高能力值比较
    max_abi = 0
    b.each{|i| max_abi = [max_abi, i].max}
    max_abi = max_abi.to_f
    c = [] #获得能力值的坐标
    for i in 0...b.size
      c = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b / max_abi)
    end
    for i in 0...c.size
      self.contents.drawline(c[0], c[1], c[i-1][0], c[i-1][1], 1, text_color(3))
    end   
end
    #描绘能力数值
    self.contents.font.color = knockout_color
    self.contents.font.size = 14
    for i in 0...b.size
      self.contents.draw_text(c[0], c[1], 32, 24, b.to_s)
    end
    self.contents.font.size = 22
    #以下未修改   
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 48, 80, 32, "EXP")
    self.contents.draw_text(320, 80, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "装备")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 240)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 336)
    draw_item_name($data_armors[@actor.armor5_id], 320 + 16, 368)
    draw_item_name($data_armors[@actor.armor6_id], 320 + 16, 400)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end[/pre]
脚本如上,是XP的一个状态界面美化脚本,用六边形的6个顶点表示6个属性。我觉得这个脚本很强大,不发扬太可惜了,求脚本帝改为VA脚本,让游戏更美观。
其次,对VA而言,现有的公开横版战斗系统太简陋,不像VX一样看战斗是种享受。求珍藏着先进脚本的大神能分享下,让新手也能用VA创造出美丽的战斗。
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-5-7 17:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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