#==============================================================================## ▼ Yanfly Engine Ace - Lunatic States Package - Slip Damage## -- Requires: YEA - Lunatic States v1.00+##==============================================================================$imported = {} if $imported.nil?$imported["YEA-LSP-SlipDamage"] = true#==============================================================================# ▼ Instructions# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# To install this script, open up your script editor and copy/paste this script# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.## Install this script under YEA - Lunatic States. Then, proceed to use the# proper effects notetags to apply the proper LSP Slip Damage item desired.# Look within the script for more instructions on how to use each effect.##==============================================================================# ▼ Compatibility# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that# it will run with RPG Maker VX without adjusting.## This script requires YEA - Lunatic States v1.00+ to work. It must be placed# under YEA - Lunatic States v1.00+ in the script listing.##==============================================================================if $imported["YEA-LunaticStates"]class Game_BattlerBase #-------------------------------------------------------------------------- # ● Lunatic States Package Effects - Slip Damage # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #-------------------------------------------------------------------------- alias lunatic_state_extension_lsp3 lunatic_state_extension def lunatic_state_extension(effect, state, user, state_origin, log_window) case effect.upcase #---------------------------------------------------------------------- # Slip Damage Effect No.0: Slip Damage # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Affected receives increasing damage based on the state's remaining turns. # # Recommended notetag: # <while effect: element x damage> # <close effect: element x damage> # <leave effect: element x damage> #---------------------------------------------------------------------- when /ELEMENT[ ](\d+)[ ]DAMAGE/i s_turns = @state_turns[state.id] + 1 dmg = ($game_party.self_variables[[state_origin.id, $1.to_i]] / s_turns).to_i rate = element_rate($1.to_i) ; dmg = (rate * dmg).to_i s_turns == 0 ? dmg : dmg /= s_turns if $imported["YEA-BattleEngine"] && dmg > 0 text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_dmg], dmg.group) user.make_rate_popup(rate) user.create_popup(text, "HP_DMG") end user.perform_damage_effect user.hp = [user.hp - dmg, 1].max user.add_state(1) if user.hp <= 1 #---------------------------------------------------------------------- # Stop editting past this point. #---------------------------------------------------------------------- else so = state_origin lw = log_window lunatic_state_extension_lsp3(effect, state, user, so, lw) end end end # Game_BattlerBaseend # $imported["YEA-LunaticStates"]#==============================================================================## ▼ End of File##==============================================================================