赞 | 1 |
VIP | 255 |
好人卡 | 52 |
积分 | 1 |
经验 | 77416 |
最后登录 | 2016-1-18 |
在线时间 | 1269 小时 |
Lv1.梦旅人 薄凉看客
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1269 小时
- 注册时间
- 2010-6-20
- 帖子
- 1316
|
- # 装备附带技能
- # 举例
- # 铜剑,10 该武器附带ID为10的特技
- # 防具亦然
- module RPG
- class Weapon
- def name
- return @name.split(",")[0] == nil ? "" : @name.split(",")[0]
- end
- def skill
- return @name.split(",")[1] == nil ? 0 : @name.split(",")[1].to_i
- end
- end
- class Armor
- def name
- return @name.split(",")[0] == nil ? "" : @name.split(",")[0]
- end
- def skill
- return @name.split(",")[1] == nil ? 0 : @name.split(",")[1].to_i
- end
- end
- end
- class Game_Actor < Game_Battler
- def equip(equip_type, id)
- case equip_type
- when 0
- if id == 0 or $game_party.weapon_number(id) > 0
- $game_party.gain_weapon(@weapon_id, 1)
- if $data_weapons[@weapon_id] != nil and
- $data_weapons[@weapon_id].skill != 0
- forget_skill($data_weapons[@weapon_id].skill)
- end
- @weapon_id = id
- $game_party.lose_weapon(id, 1)
- if $data_weapons[id] != nil and
- $data_weapons[id].skill != 0
- learn_skill($data_weapons[id].skill)
- end
- end
- when 1
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor1_id], $data_armors[id])
- $game_party.gain_armor(@armor1_id, 1)
- if $data_armors[@armor1_id] != nil and
- $data_armors[@armor1_id].skill != 0
- forget_skill($data_armors[@armor1_id].skill)
- end
- @armor1_id = id
- $game_party.lose_armor(id, 1)
- if $data_armors[id] != nil and
- $data_armors[id].skill != 0
- learn_skill($data_armors[id].skill)
- end
- end
- when 2
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor2_id], $data_armors[id])
- $game_party.gain_armor(@armor2_id, 1)
- if $data_armors[@armor2_id] != nil and
- $data_armors[@armor2_id].skill != 0
- forget_skill($data_armors[@armor2_id].skill)
- end
- @armor2_id = id
- $game_party.lose_armor(id, 1)
- if $data_armors[id] != nil and
- $data_armors[id].skill != 0
- learn_skill($data_armors[id].skill)
- end
- end
- when 3
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor3_id], $data_armors[id])
- $game_party.gain_armor(@armor3_id, 1)
- if $data_armors[@armor3_id] != nil and
- $data_armors[@armor3_id].skill != 0
- forget_skill($data_armors[@armor3_id].skill)
- end
- @armor3_id = id
- $game_party.lose_armor(id, 1)
- if $data_armors[id] != nil and
- $data_armors[id].skill != 0
- learn_skill($data_armors[id].skill)
- end
- end
- when 4
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor4_id], $data_armors[id])
- $game_party.gain_armor(@armor4_id, 1)
- if $data_armors[@armor4_id] != nil and
- $data_armors[@armor4_id].skill != 0
- forget_skill($data_armors[@armor4_id].skill)
- end
- @armor4_id = id
- $game_party.lose_armor(id, 1)
- if $data_armors[id] != nil and
- $data_armors[id].skill != 0
- learn_skill($data_armors[id].skill)
- end
- end
- end
- end
- end
复制代码 |
|