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

Project1

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

[已经解决] 显示多个状态图标

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2150
在线时间
1010 小时
注册时间
2015-10-17
帖子
1283
跳转到指定楼层
1
发表于 2017-4-1 14:56:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 fjm 于 2017-4-1 18:55 编辑

默认的是两个,如何多显示几个,比如4个

RUBY 代码复制
  1. class Scene_Battle < Scene_Base
  2.     def start
  3.     super
  4.     create_spriteset
  5.     create_all_windows
  6.     BattleManager.method_wait_for_message = method(:wait_for_message)
  7.     @icon_rotate = 0
  8.   end
  9.     def update_basic
  10.     super
  11.     $game_timer.update
  12.     $game_troop.update
  13.     @spriteset.update
  14.     update_info_viewport
  15.     update_message_open
  16.     @icon_rotate += 1
  17.     if @icon_rotate > 120
  18.       $game_party.alive_members.each{|i| i.sort_states}
  19.       @status_window.refresh
  20.       @icon_rotate = 0
  21.     end
  22.   end
  23.     def update_info_viewport
  24.     move_info_viewport(0)   if @party_command_window.active
  25.     move_info_viewport(0) if @actor_command_window.active
  26.     move_info_viewport(0)  if BattleManager.in_turn?
  27.   end
  28.   def create_party_command_window
  29.     @party_command_window = Window_PartyCommand.new
  30.     @party_command_window.y = @info_viewport.rect.y - @party_command_window.height
  31.     @party_command_window.set_handler(:fight,  method(:command_fight))
  32.     @party_command_window.set_handler(:escape, method(:command_escape))
  33.     @party_command_window.unselect
  34.   end
  35.     def create_status_window
  36.     @status_window = Window_BattleStatus.new
  37.   end
  38.     def create_actor_command_window
  39.     @actor_command_window = Window_ActorCommand.new
  40.     @actor_command_window.y = @info_viewport.rect.y - @actor_command_window.height
  41.     #@actor_command_window.x = Graphics.width - @actor_command_window.width
  42.     @actor_command_window.set_handler(:attack, method(:command_attack))
  43.     @actor_command_window.set_handler(:skill,  method(:command_skill))
  44.     @actor_command_window.set_handler(:guard,  method(:command_guard))
  45.     @actor_command_window.set_handler(:item,   method(:command_item))
  46.     @actor_command_window.set_handler(:cancel, method(:prior_command))
  47.   end
  48. end
  49. class Window_BattleEnemy < Window_Selectable
  50.     def initialize(info_viewport)
  51.     super(0, info_viewport.rect.y, window_width, fitting_height(6))
  52.     refresh
  53.     self.visible = false
  54.     @info_viewport = info_viewport
  55.   end
  56.   def window_width
  57.     Graphics.width
  58.   end
  59. end
  60. class Window_PartyCommand < Window_Command
  61.   def window_width
  62.     return 100
  63.   end
  64.     def visible_line_number
  65.     return 3
  66.   end
  67.     def alignment
  68.     return 1
  69.   end
  70. end
  71. class Window_BattleStatus < Window_Selectable
  72.   def window_width
  73.     Graphics.width
  74.   end
  75.     def col_max
  76.     return 2
  77.   end
  78.     def draw_actor_icons(actor, x, y, width = 96)
  79.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  80.     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  81.   end
  82.     def draw_basic_area(rect, actor)
  83.     draw_actor_name(actor, rect.x - 7, rect.y, 100)
  84.     draw_actor_icons(actor, rect.x + 59 , rect.y, 24)
  85.   end
  86.   def spacing
  87.     return 4
  88.   end
  89.   def draw_actor_hp(actor, x, y, width = 124)
  90.     draw_gauge(x+60, y, width-15, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  91.     change_color(system_color)
  92.     draw_text(x+55, y, 30, line_height, Vocab::hp_a)
  93.     draw_current_and_max_values(x+45, y, width, actor.hp, actor.mhp,
  94.       hp_color(actor), normal_color)
  95.   end
  96.   def draw_actor_mp(actor, x, y, width = 124)
  97.     draw_gauge(x+42, y, width-15, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  98.     change_color(system_color)
  99.     draw_text(x+38, y, 30, line_height, Vocab::mp_a)
  100.     draw_current_and_max_values(x+25, y, width, actor.mp, actor.mmp,
  101.       mp_color(actor), normal_color)
  102.   end
  103.   def draw_actor_tp(actor, x, y, width = 124)
  104.     draw_gauge(x+25, y, width-20, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  105.     change_color(system_color)
  106.     draw_text(x+20, y, 30, line_height, Vocab::tp_a)
  107.     change_color(tp_color(actor))
  108.     draw_text(x + width - 37, y, 42, line_height, actor.tp.to_i, 2)
  109.   end
  110. end

9999.jpg (41.96 KB, 下载次数: 19)

9999.jpg

Lv3.寻梦者

梦石
0
星屑
4803
在线时间
1350 小时
注册时间
2015-7-25
帖子
541

开拓者

2
发表于 2017-4-1 19:21:20 | 只看该作者
本帖最后由 魔法丶小肉包 于 2017-4-1 19:26 编辑

由于楼主给的脚本不是默认系统,给的截图却是默认系统的,所以都改了

根据默认系统脚本修改
RUBY 代码复制
  1. class Window_BattleStatus < Window_Selectable
  2.   def draw_basic_area(rect, actor)
  3.     draw_actor_name(actor, rect.x + 0, rect.y, 100)
  4.     draw_actor_icons(actor, rect.x + 70, rect.y, rect.width)
  5.   end
  6. end

使用了楼主给的脚本之后修改
RUBY 代码复制
  1. class Window_BattleStatus < Window_Selectable
  2.   def draw_basic_area(rect, actor)
  3.     draw_actor_name(actor, rect.x - 7, rect.y, 100)
  4.     draw_actor_icons(actor, rect.x + 59 , rect.y, 24*4)
  5.   end
  6. end

评分

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

查看全部评分

目前的坑 幽灵契约外传:歌莉娅
回归持续更新中~ 进度 v0.21/v1.00
笨肉包开始学像素画啦!努力训练中XD
啊~今天也是填坑的一天呢!

看!是肉包!
只能看!不能吃!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2150
在线时间
1010 小时
注册时间
2015-10-17
帖子
1283
3
 楼主| 发表于 2017-4-1 20:22:55 | 只看该作者
魔法丶小肉包 发表于 2017-4-1 19:21
由于楼主给的脚本不是默认系统,给的截图却是默认系统的,所以都改了

根据默认系统脚本修改

太感谢了,非常好用
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
301
在线时间
37 小时
注册时间
2019-8-4
帖子
25
4
发表于 2021-2-25 12:31:18 | 只看该作者
正在找类似的功能,MV有办法在战斗时显示多个状态吗?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-26 07:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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