Project1

标题: 战斗命令选项美化(非原创) [打印本页]

作者: Cherry    时间: 2011-5-21 15:57
标题: 战斗命令选项美化(非原创)
本帖最后由 铃仙·优昙华院·因幡 于 2011-5-22 12:39 编辑

补一个战斗命令选项美化脚本,现在6R上搜不到了吧。



  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================

  4. #==============================================================================
  5. # ■ Window_ActorCommand
  6. #------------------------------------------------------------------------------
  7. #  战斗画面显示角色指令的窗口。
  8. #==============================================================================

  9. class Window_ActorCommand < Window_Selectable
  10.   #--------------------------------------------------------------------------
  11.   # ● 定义实例变量
  12.   #--------------------------------------------------------------------------  
  13.   attr_reader   :commands                 # 命令  
  14.   #--------------------------------------------------------------------------
  15.   # ● 初始化对象
  16.   #     width      : 窗口的宽
  17.   #     commands   : 命令字符串序列
  18.   #     column_max : 行数 (2 行以上时选择)
  19.   #     row_max    : 列数 (0:列数加起来)
  20.   #     spacing : 选项横向排列时间隔空白宽度
  21.   #--------------------------------------------------------------------------
  22.   def initialize(width = 128, commands = [], column_max = 1, row_max = 4, spacing = 32)
  23.     if row_max == 0
  24.       row_max = (commands.size + column_max - 1) / column_max
  25.     end
  26.     super(0, 0, width, row_max * WLH + 32, spacing)
  27.     self.active = false
  28.     @commands = []
  29.     @icon_list = [2712, 2728, 2722, 2724]
  30.     @item_max = commands.size
  31.     @column_max = column_max
  32.     @remember_index = -1
  33.     self.index = 0
  34.     # refresh
  35.     update
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● 刷新
  39.   #--------------------------------------------------------------------------
  40.   def refresh
  41.     self.contents.clear
  42.     for i in 0...@item_max
  43.       draw_item(i)
  44.     end
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 设置自定义特技指令名称
  48.   #     actor :角色
  49.   #--------------------------------------------------------------------------
  50.   def setup(actor)
  51.     s1 = Vocab::attack
  52.     s2 = Vocab::skill
  53.     s3 = Vocab::guard
  54.     s4 = Vocab::item
  55.     if actor.class.skill_name_valid     # 特技指令名称有效?
  56.       s2 = actor.class.skill_name       # 替换指令名
  57.     end
  58.     @commands = [s1, s2, s3, s4]
  59.     @item_max = 4
  60.     refresh
  61.     self.index = 0
  62.   end  
  63.   
  64.   #--------------------------------------------------------------------------
  65.   # ● 描绘项目
  66.   #     index : 项目编号
  67.   #     enabled : 有效标记录。是false 的时候半透明绘画
  68.   #--------------------------------------------------------------------------
  69.   def draw_item(index, enabled = true)
  70.     rect = item_rect(index)
  71.     rect.x += 4
  72.     rect.width -= 8
  73.     self.contents.clear_rect(rect)
  74.     draw_icon(@icon_list[index], rect.x, rect.y, true) if index == self.index
  75.     self.contents.font.color = normal_color
  76.     self.contents.font.color.alpha = enabled ? 255 : 128
  77.     rect.x += 26
  78.     self.contents.draw_text(rect, @commands[index])
  79.   end
  80.   
  81.   #--------------------------------------------------------------------------
  82.   # ● 刷新类型
  83.   #--------------------------------------------------------------------------
  84.   def update
  85.     super
  86.     @remember_index = self.index if self.index == -1
  87.     if @remember_index != self.index
  88.       @remember_index = self.index
  89.       refresh
  90.     end
  91.   end
  92.   
  93. end

  94. #==============================================================================
  95. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  96. #==============================================================================
复制代码




作者: 铁道工    时间: 2011-5-22 10:38
很棒,抱走了。
尤其感谢下面的那张ICONSET,请问可以使用吗?
作者: SSA220300    时间: 2012-10-7 08:17
請問這個要怎麼用啊?
要把哪裡修改掉?
作者: 仲秋启明    时间: 2012-10-7 08:36
记得黑暗圣剑2用的就是这个
作者: 中二病也要卖萌    时间: 2012-12-24 22:24
请问rmva能用么
作者: j433463    时间: 2012-12-25 02:31
我用 LNX11a 战斗系统,选项美化用不到,Icon 图标倒是很需要,感谢,收了。
作者: 熊喵酱    时间: 2013-2-6 11:35
可惜我是VA的  可是圖標很讚!!! 抱走了
作者: 潇洒的子弹2    时间: 2013-2-8 12:07
我也是VA的……如果VA也有战斗选项美化就好了……
作者: www66ds    时间: 2013-5-18 12:35
图片名改为什么?
作者: 黄濑凉太    时间: 2013-5-18 13:32
其实这个就合图标脚本有什么区别。。
作者: fiems    时间: 2013-5-19 23:55
提示: 作者被禁止或删除 内容自动屏蔽




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