放置在插件区即可。鉴于你没有详细的描述需求…
默认所有武器耐久度10,攻击或使用技能一次减少1,双重攻击每次减少1,耐久度到0之后无法选择对应的指令,双重攻击的第二击到0仍然有效。
你可以做个恢复耐久度的物品,对人使用后把它的武器durability加上去
class Game_BaseItem attr_accessor :durability alias initialize_bfca0d3a79042ed8 initialize def initialize initialize_bfca0d3a79042ed8 @durability=10 end end class Game_Actor def get_weapon return @equips[0] end end class Game_BattlerBase alias usable_efe2e69d78eceb51 usable? def usable?(skill) if self.is_a?(Game_Actor)&&skill.is_a?(RPG::Skill) if !self.weapons.empty? w=self.get_weapon if w.durability<=0 return skill.id==2 end else return skill.id==2 end end usable_efe2e69d78eceb51(skill) end end class Game_Battler alias item_apply_e17c250161634ead item_apply def item_apply(user, item) item_apply_e17c250161634ead(user,item) if user.is_a?(Game_Actor) if item.is_a?(RPG::Skill)&&item.id!=2 if !user.weapons.empty? w=user.get_weapon w.durability=w.durability-1 if w.durability>0 p w.durability end end end end end
class Game_BaseItem
attr_accessor :durability
alias initialize_bfca0d3a79042ed8 initialize
def initialize
initialize_bfca0d3a79042ed8
@durability=10
end
end
class Game_Actor
def get_weapon
return @equips[0]
end
end
class Game_BattlerBase
alias usable_efe2e69d78eceb51 usable?
def usable?(skill)
if self.is_a?(Game_Actor)&&skill.is_a?(RPG::Skill)
if !self.weapons.empty?
w=self.get_weapon
if w.durability<=0
return skill.id==2
end
else
return skill.id==2
end
end
usable_efe2e69d78eceb51(skill)
end
end
class Game_Battler
alias item_apply_e17c250161634ead item_apply
def item_apply(user, item)
item_apply_e17c250161634ead(user,item)
if user.is_a?(Game_Actor)
if item.is_a?(RPG::Skill)&&item.id!=2
if !user.weapons.empty?
w=user.get_weapon
w.durability=w.durability-1 if w.durability>0
p w.durability
end
end
end
end
end
|