Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - FF Style Status Effects
- # -- Author : Dekita
- # -- Version : 1.1
- # -- Level : Easy / Normal
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:FFSSE]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 15/o4/2o14 - Small Bugfixx,
- # 14/o4/2o14 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script allows you to recreate some of the states from the final fantasy
- # series.
- #
- # Obviously, most status effects can already be made; however, there are a few
- # that cannot, such as; autolife, disease, reverse.
- # This script allows the creation of the aforementioned status effects.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # <autolife>
- # This notetag will automatically revive the afflicted battler when they die.
- # All states are removed and HP is refilled 100%
- #
- # <hp disease>
- # <mp disease>
- # <tp disease>
- # These notetags enable 'disease' for the afflicted battler.
- # Disease will reduce the stats 'max value' to the current value.
- # eg. if actor has 100 hp and becomes hp diseased, they then lose 50 hp, their
- # new max hp will be 50, until the status effect wears off.
- #
- # <reverse>
- # This notetag causes the damage dealt/taken to be reversed whilse under the
- # influence of the affliction.
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # N/A
- #===============================================================================
- module FFSSE
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Notes={
- :auto_life => /<autolife>/i,
- :hp_disease => /<hp disease>/i,
- :mp_disease => /<mp disease>/i,
- :tp_disease => /<tp disease>/i,
- :reverse => /<reverse>/i,
- } #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- class << self
- alias :load_database_FFSSE :load_database
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.load_database
- load_database_FFSSE
- load_notetags_FFSSE
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.load_notetags_FFSSE
- for obj in $data_states
- next if obj.nil?
- obj.load_FFSSE
- end
- end
- end
- #===============================================================================
- module FFSSE_DATA
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :ffsse
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_FFSSE_variables
- @ffsse = FFSSE_States.new
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def load_FFSSE_notetags
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when FFSSE::Notes[:auto_life] then @ffsse.autolife = true
- when FFSSE::Notes[:hp_disease] then @ffsse.hp_disease = true
- when FFSSE::Notes[:mp_disease] then @ffsse.mp_disease = true
- when FFSSE::Notes[:tp_disease] then @ffsse.tp_disease = true
- when FFSSE::Notes[:reverse] then @ffsse.reverse = true
- end
- end
- end
- end
- #===============================================================================
- class RPG::State < RPG::BaseItem
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include FFSSE_DATA
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def load_FFSSE
- init_FFSSE_variables
- load_FFSSE_notetags
- end
- end
- #===============================================================================
- class FFSSE_States
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :autolife
- attr_accessor :hp_disease
- attr_accessor :mp_disease
- attr_accessor :tp_disease
- attr_accessor :reverse
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize
- @autolife = false
- @hp_disease = false
- @mp_disease = false
- @tp_disease = false
- @reverse = false
- end
- end
- #===============================================================================
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :ffsse_add_state :add_state
- alias :ffsse_remove_state :remove_state
- alias :ffsse_param :param
- alias :ffsse_max_tp :max_tp
- alias :ffsse_refresh :refresh
- alias :ffsse_execute_damage :execute_damage
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def add_state(state_id)
- add_disease_state(state_id)
- ffsse_add_state(state_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def remove_state(state_id)
- remove_disease_state(state_id)
- ffsse_remove_state(state_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_disease
- reset_hp_disease
- reset_mp_disease
- reset_tp_disease
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def perform_autolife
- return false unless states.any? {|i| i.ffsse.autolife }
- @hp = mhp
- clear_states
- clear_buffs
- return true
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def add_disease_state(id)
- return unless state_addable?(id) && !state?(id)
- @disease_hp[0] = true if $data_states[id].ffsse.hp_disease
- @disease_mp[0] = true if $data_states[id].ffsse.mp_disease
- @disease_tp[0] = true if $data_states[id].ffsse.tp_disease
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def remove_disease_state(id)
- return unless state?(id)
- @disease_hp[0] = false if $data_states[id].ffsse.hp_disease
- @disease_mp[0] = false if $data_states[id].ffsse.mp_disease
- @disease_tp[0] = false if $data_states[id].ffsse.tp_disease
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def param(param_id)
- if @disease_hp && @disease_mp
- case param_id
- when 0 then return @disease_hp[2] if @disease_hp[0]
- when 1 then return @disease_mp[2] if @disease_mp[0]
- end
- end
- return ffsse_param(param_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def max_tp
- if @disease_tp
- return @disease_tp[2] if @disease_tp[0]
- end
- return ffsse_max_tp
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh
- ffsse_refresh
- refresh_disease
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh_disease
- return setup_disease unless @disease_hp
- @disease_hp[2] = @hp if @disease_hp[0]
- @disease_mp[2] = @mp if @disease_mp[0]
- @disease_tp[2] = @tp if @disease_tp[0]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def reset_hp_disease
- @disease_hp = [false,mhp,mhp]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def reset_mp_disease
- @disease_mp = [false,mmp,mmp]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def reset_tp_disease
- @disease_tp = [false,max_tp,max_tp]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def execute_damage(user)
- damage_reverse(user)
- ffsse_execute_damage(user)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def damage_reverse(user)
- return unless states.any? {|i| i.ffsse.reverse }
- if @result.hp_damage > 0
- @result.hp_damage = -@result.hp_damage
- else
- amnt = 999999
- diff = amnt-@result.hp_damage
- @result.hp_damage = (amnt-diff).to_i
- end
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :ffsse_setup :setup
- alias :ffsse_die :die
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup(*args,&block)
- ffsse_setup(*args,&block)
- setup_disease
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def die
- return if perform_autolife
- ffsse_die
- end
- end
- #===============================================================================
- class Game_Enemy < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :ffsse_setup :initialize
- alias :ffsse_die :die
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize(*args,&block)
- ffsse_setup(*args,&block)
- setup_disease
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def die
- return if perform_autolife
- ffsse_die
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement