- #============================================================================== 
- # 
- # ▼ Yanfly Engine Ace - 关闭失败提示 v1.00 
- # -- 最后更新: 2011.12.23 
- # -- 使用难度: 普通 
- # -- 需要脚本: 无 
- # 
- #============================================================================== 
-   
- $imported = {} if $imported.nil? 
- $imported["YEA-AntiFailMessage"] = true 
-   
- #============================================================================== 
- # ▼ Updates 
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
- # 2011.12.23 - Started Script and Finished. 
- # 
- #============================================================================== 
- # ▼ 介绍 
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
- # 本脚本可以在技能/物品造成0伤害时关闭"使用失败"的信息提示,或是将失败提示改变为 
- # 其他文本.一般用于仅触发公共事件而不造成伤害的技能或物品中. 
- # 
- #============================================================================== 
- # ▼ 安装方式 
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
- # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新 
- # 脚本页/槽中.记得保存你的工程以使脚本生效. 
- # 
- # ----------------------------------------------------------------------------- 
- # 技能备注 - 在数据库-技能中可以使用的备注. 
- # ----------------------------------------------------------------------------- 
- # <关闭失败提示> 
- # 该技能使用失败时无失败提示. 
- # 
- # ----------------------------------------------------------------------------- 
- # 物品备注 - 在数据库-物品中可以使用的备注. 
- # ----------------------------------------------------------------------------- 
- # <关闭失败提示> 
- # 该技能使用失败时无失败提示. 
- # 
- #============================================================================== 
- # ▼ 兼容性 
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
- # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX. 
- # 
- #============================================================================== 
- # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭 
- # 所以编辑了后果自负。 
- #============================================================================== 
-   
- module YEA 
-   module REGEXP 
-   module USABLEITEM 
-   
-     ANTIFAIL = /<(?:ANTI_FAIL|关闭失败提示|antifail)>/i 
-   
-   end # USABLEITEM 
-   end # REGEXP 
- end # YEA 
-   
- #============================================================================== 
- # ■ DataManager 
- #============================================================================== 
-   
- module DataManager 
-   
-   #-------------------------------------------------------------------------- 
-   # alias method: load_database 
-   #-------------------------------------------------------------------------- 
-   class <<self; alias load_database_antifail load_database; end 
-   def self.load_database 
-     load_database_antifail 
-     load_notetags_antifail 
-   end 
-   
-   #-------------------------------------------------------------------------- 
-   # new method: load_notetags_antifail 
-   #-------------------------------------------------------------------------- 
-   def self.load_notetags_antifail 
-     groups = [$data_skills, $data_items] 
-     for group in groups 
-       for obj in group 
-         next if obj.nil? 
-         obj.load_notetags_antifail 
-       end 
-     end 
-   end 
-   
- end # DataManager 
-   
- #============================================================================== 
- # ■ RPG::UsableItem 
- #============================================================================== 
-   
- class RPG::UsableItem < RPG::BaseItem 
-   
-   #-------------------------------------------------------------------------- 
-   # public instance variables 
-   #-------------------------------------------------------------------------- 
-   attr_accessor :antifail 
-   
-   #-------------------------------------------------------------------------- 
-   # common cache: load_notetags_antifail 
-   #-------------------------------------------------------------------------- 
-   def load_notetags_antifail 
-     @antifail = false 
-     #--- 
-     self.note.split(/[\r\n]+/).each { |line| 
-       case line 
-       #--- 
-       when YEA::REGEXP::USABLEITEM::ANTIFAIL 
-         @antifail = true 
-       #--- 
-       end 
-     } # self.note.split 
-     #--- 
-   end 
-   
- end # RPG::UsableItem 
-   
- #============================================================================== 
- # ■ Game_Battler 
- #============================================================================== 
-   
- class Game_Battler < Game_BattlerBase 
-   
-   #-------------------------------------------------------------------------- 
-   # alias method: item_user_effect 
-   #-------------------------------------------------------------------------- 
-   alias game_battler_item_user_effect_antifail item_user_effect 
-   def item_user_effect(user, item) 
-     game_battler_item_user_effect_antifail(user, item) 
-     apply_antifail(item) 
-   end 
-   
-   #-------------------------------------------------------------------------- 
-   # new method: apply_antifail 
-   #-------------------------------------------------------------------------- 
-   def apply_antifail(item) 
-     @result.success = true if item.antifail 
-   end 
-   
- end # Game_Battler 
-   
- #============================================================================== 
- # 
- # ▼ End of File 
- # 
- #==============================================================================