赞 | 152 |
VIP | 10 |
好人卡 | 39 |
积分 | 93 |
经验 | 146191 |
最后登录 | 2024-5-6 |
在线时间 | 2504 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 9280
- 在线时间
- 2504 小时
- 注册时间
- 2011-5-20
- 帖子
- 15389
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- #==============================================================================
- # ■ Window_SkillCommand
- #==============================================================================
- class Window_SkillCommand < Window_Selectable
- attr_accessor :commands
- #--------------------------------------------------------------------------
- # ● 初始化,生成commands窗口
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 64, 160, 416)
- @commands = []
- [url=home.php?mod=space&uid=95897]@actor[/url] = actor
- #————————生成commands窗口
- @data = []
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- if skill != nil
- @data.push(skill)
- end
- end
- for i in [email protected]
- if @data.size>0
- push = true
- for com in @commands
- if com == $data_skills[@data[i].id].desc
- push = false
- end
- end
- if push == true
- @commands.push($data_skills[@data[i].id].desc)
- end
- end
- end
- if @commands == []
- @commands.push("") #空背包显示分类
- end
- @skill_max = @commands.size
- self.contents = Bitmap.new(width - 32, @skill_max * 32)
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@skill_max
- draw_item(i, normal_color)
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def draw_item(index, color)
- self.contents.font.color = color
- y = index * 32
- self.contents.draw_text(4, y, 128, 32, @commands[index])
- end
- #--------------------------------------------------------------------------
- # 只描绘原文字
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(@commands[self.index])
- end
- end
- #==============================================================================
- # ■ RPG追加定义,使用$skills_[$Xs_specie[@id]]分类
- #==============================================================================
- module RPG
- class Skill
- def desc
- desc = $skills_species[$skills_specie[@id]]
- return desc != nil ? desc : $skills_species[1]
- end
- end
- end
复制代码- #==============================================================================
- # ■ Window_Skill
- #------------------------------------------------------------------------------
- # 特技画面、战斗画面、显示可以使用的特技浏览的窗口。
- #==============================================================================
- class Window_Skill < Window_ItemSelectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(160, 0, 480, 480)
- @actor = actor
- @column_max = 14
- refresh
- self.index = 0
- # 战斗中的情况下将窗口移至中央并将其半透明化
- if $game_temp.in_battle
- self.y = 64
- self.height = 256
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取特技
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- if skill != nil
- @data.push(skill)
- end
- end
- # 如果项目数不是 0 就生成位图、重新描绘全部项目
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- skill = @data[index]
- color=$skills_quality[skill.id]
- if @actor.skill_can_use?(skill.id)
- self.contents.font.color = text_color($skills_quality[skill.id])
- else
- self.contents.font.color = disabled_color
- end
- x = 4 + index % 14 * (0 + 32)
- y = index / 14 * 32
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(skill.icon_name)
- opacity = self.contents.font.color == text_color(color) ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
- self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
- self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.skill == nil ? "" : self.skill.description)
- end
- end
复制代码 求解释为什么不管现实那个分类都是所有技能···(技能已经设施分类,感觉是其他设置有问题···但是纠结的是找不到问题在哪···) |
|