赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 436 |
最后登录 | 2013-8-10 |
在线时间 | 12 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 12 小时
- 注册时间
- 2013-7-11
- 帖子
- 15
|
貌似不用在Window_Status中吧。。。。下面那个脚本是从一个游戏中找的。。你试试看,不冲突就行了- # 脚本功能:
- # 实现战斗中和菜单中用图标显示状态,代替原来的文字显示。
- # 默认最多同时显示5个状态
- #------------------------------------------------------------------------------
- # 设置方法:
- # 一个状态对应的图标文件名为“状态的动画ID.png”
- # 例如某状态的动画ID为50,那么它的图标就是“Icons\50.png”
- # 如果找不到对应的文件,会报错 ◎_◎
- #==============================================================================
- # 注意,在ICON_STATE_IDS中写上需要带图标的状态ID
- # ICON_STATE_IDS是一个数组,数组的方法请参考帮助文件
- # 例如:
- # 只要1,5,8号状态带图标,就这样:ICON_STATE_IDS = [1,5,8]
- # 要20到50号状态带图标:ICON_STATE_IDS = 20..50
- ICON_STATE_IDS = [1,2,3,4,5,6,7,8,9,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,52,55,59]
- # 注意,在ICON_STATE_IDS中写上需要带图标的状态ID!!!
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中全部窗口的超级类。
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘状态
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_state(actor, x, y, width = 96)
- state_size = 0
- size = 0
- for i in actor.states
- size += 1 if i >= 16
- end
- for state in actor.states
- # 图标数量超出宽度就中断循环
- if state_size >= 1
- break
- end
- # 此状态不带图标就跳过
- if !ICON_STATE_IDS.include?(state)
- next
- end
- bitmap = RPG::Cache.icon($data_states[state].name + "_sta")
- opacity = 255
- # 这里的图标大小默认是24x24,要改就改下面那个Rect.new(0, 0, 24, 24)
- if state_size < 1 or (size >= 1 && state >= 16)
- self.contents.blt(x + 92, y + 36, bitmap, Rect.new(0, 0, 20, 20), opacity)
- state_size += 1
- end
- end
- end
- def draw_actor_state2(actor, x, y, width = 96)
- state_size = 0
- for state in actor.states
- # 图标数量超出宽度就中断循环
- if state_size >= 6
- break
- end
- # 此状态不带图标就跳过
- if !ICON_STATE_IDS.include?(state)
- next
- end
- bitmap = RPG::Cache.icon($data_states[state].name + "_sta")
- opacity = 255
- # 这里的图标大小默认是24x24,要改就改下面那个Rect.new(0, 0, 24, 24)
- if state_size < 6
- self.contents.blt(x + 20 * state_size, y + 9, bitmap, Rect.new(0, 0, 20, 20), opacity)
- state_size += 1
- end
- end
- end
- end
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 设置敌人
- # enemy : 要显示名字和状态的敌人
- #--------------------------------------------------------------------------
- def set_enemy(enemy)
- # 描绘状态图标
- self.contents.clear
- state_size = 0
- for state in enemy.states
- # 图标数量超出宽度就中断循环
- if state_size >= 6
- break
- end
- # 此状态不带图标就跳过
- if !ICON_STATE_IDS.include?(state)
- next
- end
- bitmap = RPG::Cache.icon($data_states[state].name + "_sta")
- if enemy.states_turn[state] >= $data_states[state].hold_turn/2
- opacity = 255
- else
- opacity = 100
- end
- self.contents.blt(160 + 20 * state_size, 6, bitmap, Rect.new(0, 0, 24, 24), opacity)
- state_size += 1
- end
- # 描绘敌人名字
- self.contents.draw_text(10, 0, 200, 32, enemy.name)
- carol3_draw_hp_bar(enemy, 290, 0)
- carol3_draw_sp_bar(enemy, 440, 0)
- @text = nil
- self.visible = true
- end
-
- def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
- self.contents.font.color = system_color
- self.contents.fill_rect(x-1, y+17, width+2,6, Color.new(0, 0, 0, 255))
- w = width * actor.hp / [actor.maxhp,1].max
- self.contents.fill_rect(x, y+18, w,1, Color.new(255, 96, 96, 255))
- self.contents.fill_rect(x, y+19, w,1, Color.new(255, 0, 0, 255))
- self.contents.fill_rect(x, y+20, w,1, Color.new(128, 0, 0, 255))
- self.contents.fill_rect(x, y+21, w,1, Color.new(0, 0, 0, 255))
- self.contents.draw_text(x,y,128,32,$data_system.words.hp,1)
- self.contents.font.color = normal_color
- end
- def carol3_draw_sp_bar(actor, x, y, width = 128)
- self.contents.font.color = system_color
- self.contents.fill_rect(x-1, y+17, width+2,6, Color.new(0, 0, 0, 255))
- w = width * actor.sp / [actor.maxsp,1].max
- self.contents.fill_rect(x, y+18, w,1, Color.new(128, 255, 255, 255))
- self.contents.fill_rect(x, y+19, w,1, Color.new(0, 255, 255, 255))
- self.contents.fill_rect(x, y+20, w,1, Color.new(0, 192, 192, 255))
- self.contents.fill_rect(x, y+21, w,1, Color.new(0, 128, 128, 255))
- self.contents.draw_text(x,y,128,32,$data_system.words.sp,1)
- self.contents.font.color = normal_color
- end
- end
- class Game_Battler
- attr_reader :states_turn # 声明状态剩余回合
- end
复制代码 |
|