累计送礼: 0 个 累计收礼: 1 个 TA的每日心情 开心 2026-7-12 04:10
签到天数: 209 天
连续签到: 2 天
[LV.7]常住居民III
管理员
VIP
7
卡币
58751
OK点
16
推广点
0
同能卷
50
积分 68660
State Slip Skills
by
MobiusXVI
Release Notes
Sep 2014 - v. 1.0 Initial Release
Oct 2014 - v. 1.5 Improved DBS Integration
Feb 2020 - v. 1.6 Improved compatibility with other scripts
Jul 2020 - v. 1.7 Fixed obscure bug where "regen" type skills appeared to damage rather than heal
Oct 2024 - v. 1.8 Fixed bug preventing equipment auto states from working
Introduction
The purpose of the script is to allow you to set skills to replace the default slip damage formula. This allows you to create interesting poison-type skills and also easily create regen-type skills.
Features
- Create as many custom states as you want!
- Use the old (and awful) slip damage formula if you really want to.
- Create states that need the caster alive to maintain them.
How to Use
Copy the script into the script editor below the default scripts but above Main. Follow the instructions and configuration guidance within the script itself.
Script
Spoiler Code:
#=============================================================================== # State Slip Skills # Author: Mobius XVI # Version: 1.8 # Date: 18 OCT 2024 #=============================================================================== # # Introduction: # # The purpose of this script is to allow you to set skills to replace # the default slip damage formula # # Instructions: # # - Place this script below all the default scripts but above main # # - In the configuration section below, set up which states will call # a skill in place of default slip damage. The format is very simple: # 'State_ID' => 'Skill_ID', (without quotes) # Be sure each line ends in a comma, and make sure all of your lines # are in between the two curly brackets, i.e. { and } # # - Lastly, in the database, check the box for 'slip damage' for any # state that you set up in the configuration section. If you don't, # the script won't call a skill. # # - There are also a few more options described in detail in the # configuration section below, so be sure to check those out. # # - One last thing, if you want to use the default slip damage for # anything, simply check the 'slip damage' box in the database but # don't configure anything below and the script will use the default # formula. # # Issues/Bugs/Possible Bugs: # # - This script heavily modifies Game_Battler, and my cause bugs in # in other custom battle systems. # # Credits/Thanks: # - Mobius XVI, author # - TheRiotInside, for requesting it # - Roninator2, for helping to improve compatibility # - Fred_than_dead, for finding an obscure bug # - garbiMestolo, for finding an obvious bug # # License # The MIT License (MIT) # # Copyright (c) 2024 darmes # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # # Further, if you do decide to use this script in a commercial product, # I'd ask that you let me know via a forum post or a PM. Thanks. # #=============================================================================== # CONFIGURATION #=============================================================================== module Mobius module State_Slip_Skills States_to_Skills = { # The following is an example # that links slip damage on state #21 # to call skill #1 21 => 1, } # Setting this option to "true" causes the skill to track changes # to the original caster, i.e. if the caster get buffed then # the skill will cause more damage per turn or if the caster gets # debuffed the skill will cause less damage. # Setting this to "false" will cause the skill to take a snapshot # of the original caster, i.e. the skill will deal the same damage # each turn (with variance) regardless of what happens to the caster. Allow_Changes = true # >This option only works if "Allow_Changes" is set to true< # >This option only effects skills that are set in States_to_Skills< # Setting this option to "true" causes states to be removed when # the original caster dies. # Setting this option to false will allow states to remain even # if the original caster dies. End_State_on_Actor_Death = true end end #=============================================================================== # ** State Slip Skills - EDIT BELOW THIS LINE AT OWN RISK #=============================================================================== #-------------------------------------------------------------------------- # Changes to class Game_Battler #-------------------------------------------------------------------------- class Game_Battler # Alias old methods alias mobius_state_slip_initialize initialize alias mobius_state_slip_add_state add_state alias mobius_state_slip_remove_state remove_state alias mobius_state_slip_attack_effect attack_effect alias mobius_state_slip_skill_effect skill_effect alias mobius_state_slip_damage_effect slip_damage_effect # New methods #-------------------------------------------------------------------------- # * New Public Instance Variables #-------------------------------------------------------------------------- attr_reader :animation_queue #-------------------------------------------------------------------------- # * Initialize - adds new variables for tracking states #-------------------------------------------------------------------------- def initialize mobius_state_slip_initialize @attacker = nil # Variable for temp storing attacker @states_attacker = {} # Variable for linking states to attacker @animation_queue = [] # Variable for queuing animations end #-------------------------------------------------------------------------- # * Add State - Links applied state to caster/actor that caused it #-------------------------------------------------------------------------- def add_state(state_id, force = false) # Get result of old method (returns nil if ineffective) result = mobius_state_slip_add_state(state_id, force) # If effective, link state_id to current attacker if result unless @attacker == nil if Mobius::State_Slip_Skills::Allow_Changes @states_attacker[state_id] = @attacker else @states_attacker[state_id] = @attacker.clone end end end # Pass result to caller result end #-------------------------------------------------------------------------- # * Remove State - Removes associated caster/actor link #-------------------------------------------------------------------------- def remove_state(state_id, force = false) # Get result of old method (returns nil if ineffective) result = mobius_state_slip_remove_state(state_id, force) # If effective, remove state_id from @states_attacker hash if result @states_attacker.delete(state_id) end # Pass result to caller result end #-------------------------------------------------------------------------- # * Attack Effect - Stores attacker in local variable for linking to state #-------------------------------------------------------------------------- def attack_effect(attacker) # temporarily store value of attacker @attacker = attacker # call original method mobius_state_slip_attack_effect(attacker) # reset value of attacker @attacker = nil # attack effect needs to return true to caller return true end #-------------------------------------------------------------------------- # * Skill Effect - Stores attacker in local variable for linking to state #-------------------------------------------------------------------------- def skill_effect(attacker, skill) # temporarily store value of attacker @attacker = attacker # skill effect return 'effective' to caller effective = mobius_state_slip_skill_effect(attacker, skill) # reset value of attacker @attacker = nil # pass value of 'effectve' back to original caller return effective end #-------------------------------------------------------------------------- # * Slip Damage Effect - drastically overhauled # Now checks for states that are linked to skills and calls those # skills up with an associated caster/actor. It will also store the # results of the skill for display at a later time. # If state is not set up that way, method calls original method #-------------------------------------------------------------------------- def slip_damage_effect for state_id in @states # If an applied state has slip damage if $data_states[state_id].slip_damage # Check if state has associated skill if skill_id = Mobius::State_Slip_Skills::States_to_Skills[state_id] # Check if state has associated attacker if skill_attacker = @states_attacker[state_id] # Check if End_State option is true and actor is dead if Mobius::State_Slip_Skills::End_State_on_Actor_Death and skill_attacker.dead? # Remove state self.remove_state(state_id) # Go to next state next end # Call skill with attacker skill = $data_skills[skill_id] last_hp = self.hp effective = self.skill_effect(skill_attacker, skill) # Set animation info add_animation_to_queue(skill.animation2_id, self.damage, self.critical) # Restore HP so it can be deducted when animation plays if self.damage.is_a?(Numeric) actual_damage = (last_hp - self.hp) self.hp += actual_damage end end # If state not set with skill, use old slip damage effect else mobius_state_slip_damage_effect end end end end #-------------------------------------------------------------------------- # New methods that allow for queuing damage animations # Data structure - Array of arrays with sub arrays containing: # [animation_id, damage, critical] #-------------------------------------------------------------------------- # * Add Animation to Queue - adds an animation to the queue #-------------------------------------------------------------------------- def add_animation_to_queue(id, dam, crit) arr = [id, dam, crit] @animation_queue.push(arr) end #-------------------------------------------------------------------------- # * Set Up Animation - Sets up new queued animation data #-------------------------------------------------------------------------- def set_up_queued_animation # Get animation data arr = @animation_queue[0] # Ensure it's not nil if arr # Set all parameters self.animation_id = arr[0] self.damage = arr[1] self.animation_hit = (self.damage != "Miss") end end #-------------------------------------------------------------------------- # * Unqueue Animation - Removes queued animation and plays damage pop #-------------------------------------------------------------------------- def unqueue_animation # Get animation data arr = @animation_queue.shift # Ensure it's not nil if arr # Set all parameters self.damage = arr[1] self.critical = arr[2] self.damage_pop = true # If damage is a number, i.e. not "Miss" if self.damage.is_a?(Numeric) # Deal the damage here, so that the timing is right self.hp -= self.damage end end end #-------------------------------------------------------------------------- # * Animation Queued? - returns whether there are animations waiting #-------------------------------------------------------------------------- def animation_queued? return ( not (@animation_queue.empty?) ) end end # class Game_Battler end #-------------------------------------------------------------------------- # Changes to class Scene_Battle #-------------------------------------------------------------------------- class Scene_Battle # alias old methods alias mobius_state_slip_update_phase4_step1 update_phase4_step1 #-------------------------------------------------------------------------- # * Update Phase 4 - Method branches phase 4 to different steps # Added steps 'slip1' and 'slip2' #-------------------------------------------------------------------------- def update_phase4 case @phase4_step when 1 update_phase4_step1 when 2 update_phase4_step2 when 3 update_phase4_step3 when 4 update_phase4_step4 when 5 update_phase4_step5 when 6 update_phase4_step6 when "slip1" update_phase4_slip1 when "slip2" update_phase4_slip2 end end #-------------------------------------------------------------------------- # * Update Phase 4 Slip 1 - Plays state animation on target #-------------------------------------------------------------------------- def update_phase4_slip1 # Animation for target @active_battler.set_up_queued_animation # Animation has at least 8 frames, regardless of its length @wait_count = 8 # Shift to step slip2 @phase4_step = "slip2" end #-------------------------------------------------------------------------- # * Update Phase 4 Slip 2 - Plays damage pop on target #-------------------------------------------------------------------------- def update_phase4_slip2 # Display damage @active_battler.unqueue_animation # Refresh status window @status_window.refresh # Check if additional animations to show if @active_battler.animation_queued? # Shift to step slip1 @phase4_step = "slip1" else # Shift to step 2 @phase4_step = 2 end end #-------------------------------------------------------------------------- # * Update Phase 4 Step 1 - After old method runs, checks if there are # animations to play and if there are, then it unsets the damage pop #-------------------------------------------------------------------------- def update_phase4_step1 # Call old method result = mobius_state_slip_update_phase4_step1 # Check that the active battler is valid and animations are waiting if result and @active_battler.animation_queued? # Set damage pop to false @active_battler.damage_pop = false # Shift to slip phase @phase4_step = "slip1" end end end # class Scene_Battle end 复制代码
FAQ
Q. Can this do _______?
A. Maybe! Leave a post on the forum, and I might just add the feature if it can't already do it.
Credits and Thanks
- MobiusXVI, author
- TheRiotInside, for requesting it
- Roninator2, for helping to improve compatibility
- Fred_than_dead, for finding an obscure bug
- garbiMestolo, for finding an obvious bug
License
This script is licensed under the MIT license, so you can use it for both commercial and non-commercial games!
See the full license in the script header for notice requirements.
本贴来自国际rpgmaker官方论坛作者:MobiusXVI处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/state-slip-skills.45242/