赞 | 1 |
VIP | 10 |
好人卡 | 2 |
积分 | 1 |
经验 | 132388 |
最后登录 | 2016-5-9 |
在线时间 | 34 小时 |
Lv1.梦旅人 冰王子
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 34 小时
- 注册时间
- 2008-1-27
- 帖子
- 1875
|
如果脚本没做过太大改动的话,这个能用
- #-------------------------------------------------------------------------------
- #天赋技能(另一种思路) By 凌冰
- #------------------------------------------------------------------------------
- $天赋数 = 3 #修改这里更改可以学会的技能数
- #----------------------------------------------------------------------------------
- class Window_Base < Window
- def pressed_color #为了与可在菜单使用的颜色区分,定义一种颜色表示已点击
- return Color.new(255, 255, 0, 255)#如果不需要区分,就改称return normal_color
- end
- end
- #--------------------------------------------------------------------------------
- class Game_Actor
- attr_accessor :skill_press
- attr_accessor :press
- alias skill_updata_init setup
- def setup(actor_id)
- skill_updata_init(actor_id)
- @skill_press = []
- @press = $天赋数
- for id in 1...$data_skills.size
- @skill_press[id] = false
- end
- end
- alias eci_skill_can_use? skill_can_use?
- def skill_can_use?(skill_id)
- result = eci_skill_can_use?(skill_id)
- if skill_press[skill_id] == false
- result = false
- end
- return result
- end
- end
- class Scene_Skill
- alias eci_update_skill update_skill
- def update_skill
- eci_update_skill
- if Input.trigger?(Input::C)
- if @actor.skill_press[@skill.id] or @actor.press == 0
- $game_system.se_play($data_system.buzzer_se)
- return
- else
- $game_system.se_play($data_system.decision_se)
- @actor.skill_press[@skill.id] = true
- @actor.press -= 1
- @skill_window.refresh
- end
- end
- end
- end
- class Window_Skill < Window_Selectable
- def draw_item(index)
- skill = @data[index]
- if @actor.skill_can_use?(skill.id)
- self.contents.font.color = normal_color
- elsif @actor.skill_press[skill.id]
- self.contents.font.color = pressed_color
- else
- self.contents.font.color = disabled_color
- end
- x = 4 + index % 2 * (288 + 32)
- y = index / 2 * 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 == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 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
- end
复制代码
顺便提供范例
http://rpg.blue/upload_program/f ... 思路_83464207.rar 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|