#============================================================================== # # • Dhoom Petrified State v1.3a # -- Last Updated: 2015.07.08 # -- Level: Easy # # Aditional Credit : # - joeyjoejoe (Commission requester) # #============================================================================== $imported = {} if $imported.nil? $imported["DHPetrifiedState"] = true #============================================================================== # ¥ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2015.07.08 - Fixed error when using item. # 2015.01.14 - Change how the script works. Now it's based on skill type. # 2015.01.14 - Fixed minor typo and actor selection. # 2015.01.13 - Started and finished the script. # #============================================================================== # ¥ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This will add ability to state, which is when applied to actor or enemy, the # actor or enemy can't be selected by any attack, and immune to slip damage or # area skills or items. This state can be ignored with notetag in items or # skills. #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials. Remember to save. # # ----------------------------------------------------------------------------- # State Notetags - These notetags go in the state notebox in the database. # ----------------------------------------------------------------------------- # # type : all - Total immunity from all skills type. # : skill type ID, 0 : none. # If skill type ID is specified, only negate that skill type. # Skill type ID could be more than one. Item can only be negated with "all". # # ----------------------------------------------------------------------------- # Skill and Item Notetags - These notetags go in the item or skill notebox in # the database. # ----------------------------------------------------------------------------- # # Ignore petrified state. # #============================================================================== module Dhoom module Petrified SLIP_DAMAGE_STYPE = [1] end module REGEXP module UsableItem IgnorePetrified = /<(?:IGNORE PETRIFIED|ignore petrified)>/i end module State Petrified = /<(?:PETRIFIED|petrified):[ ]*(.*)>/i end end end class RPG::UsableItem < RPG::BaseItem attr_reader :ignore_petrified def load_notetags_dhpetrified @ignore_petrified = false self.note.split(/[\r\n]+/).each { |line| case line when Dhoom::REGEXP::UsableItem::IgnorePetrified @ignore_petrified = true end } end end class RPG::State < RPG::BaseItem attr_reader :petrified attr_reader :petrified_stype def load_notetags_dhpetrified @petrified = false @petrified_stype = [] self.note.split(/[\r\n]+/).each { |line| case line when Dhoom::REGEXP::State::Petrified @petrified = true r = $1.split(",") r.each do |v| (v == "all" || v == "ALL") ? @petrified_stype.push(:all) : @petrified_stype.push(v.to_i) end end } end end module DataManager class <