赞 | 108 |
VIP | 386 |
好人卡 | 10 |
积分 | 81 |
经验 | 156746 |
最后登录 | 2024-12-3 |
在线时间 | 1564 小时 |
Lv4.逐梦者 世界坑化协会
- 梦石
- 0
- 星屑
- 8137
- 在线时间
- 1564 小时
- 注册时间
- 2007-3-13
- 帖子
- 5542
|
回复 提妲 的帖子
嗯,指定的,是根据备注来决定学几号技能。
顺道找来沉影的脚本。- #==============================================================================
- # 武器带技能 by 沉影不器
- #------------------------------------------------------------------------------
- # 武器备注栏写 skill=技能号 表示武器带该技能.
- # 允许同时带多技能 skill=技能号,技能号,技能号...
- # 写法比较偷懒,bug未知
- #==============================================================================
- #==============================================================================
- # ■ RPG::Weapon
- #==============================================================================
- module RPG
- class Weapon < BaseItem
- def skill_ids
- return read_note('skill').split(/,/)
- end
- end
- class Armor < BaseItem
- def skill_ids
- return read_note('skill').split(/,/)
- end
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # 技能绑定
- #--------------------------------------------------------------------------
- def skill_plus
- @skills.clear
- for i in self.class.learnings
- learn_skill(i.skill_id) if i.level <= @level
- end
- unless @armor3_id == 0
- ids = equips[3].skill_ids
- for s in ids
- learn_skill(s.to_i)
- end
- end
- unless @armor4_id == 0
- ids = equips[4].skill_ids
- for s in ids
- learn_skill(s.to_i)
- end
- end
- unless @weapon_id == 0
- ids = equips[0].skill_ids
- for s in ids
- learn_skill(s.to_i)
- end
- end
- unless @armor1_id == 0
- ids = equips[1].skill_ids
- for s in ids
- learn_skill(s.to_i)
- end
- end
- unless @armor2_id == 0
- ids = equips[2].skill_ids
- for s in ids
- learn_skill(s.to_i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置
- #--------------------------------------------------------------------------
- alias old_setup setup
- def setup(actor_id)
- old_setup(actor_id)
- skill_plus
- end
- #--------------------------------------------------------------------------
- # ● 更改装备
- #--------------------------------------------------------------------------
- def change_equip(equip_type, item, test = false)
- last_item = equips[equip_type]
- unless test
- return if $game_party.item_number(item) == 0 if item != nil
- $game_party.gain_item(last_item, 1)
- $game_party.lose_item(item, 1)
- end
- item_id = item == nil ? 0 : item.id
- case equip_type
- when 0 # 武器
- @weapon_id = item_id
- unless two_hands_legal? # 违反双手拿取的情况下
- change_equip(1, nil, test) # 解除反手的装备
- end
- when 1 # 盾
- @armor1_id = item_id
- unless two_hands_legal? # 违反双手拿取的情况下
- change_equip(0, nil, test) # 解除反手的装备
- end
- when 2 # 头
- @armor2_id = item_id
- when 3 # 身体
- @armor3_id = item_id
- when 4 # 装饰品
- @armor4_id = item_id
- end
- skill_plus
- end
- #--------------------------------------------------------------------------
- # ● 废弃装备
- #--------------------------------------------------------------------------
- def discard_equip(item)
- if item.is_a?(RPG::Weapon)
- if @weapon_id == item.id
- @weapon_id = 0
- elsif two_swords_style and @armor1_id == item.id
- @armor1_id = 0
- end
- elsif item.is_a?(RPG::Armor)
- if not two_swords_style and @armor1_id == item.id
- @armor1_id = 0
- elsif @armor2_id == item.id
- @armor2_id = 0
- elsif @armor3_id == item.id
- @armor3_id = 0
- elsif @armor4_id == item.id
- @armor4_id = 0
- end
- end
- skill_plus
- end
- end
复制代码 |
|