Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Skill based on FFVI's Celes Runic

Save-Point

Full Version: Skill based on FFVI's Celes Runic
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
@kyonides
That actually is also a thing. The original Runic's ability I mean. Not only does Runic allow the user (i.e. Celes) to absorb the enemy's Magical Attack, it also absorbs the magical attacks or healing spells of the allies. The only way to bypass that was not to have Celes cast Runic.

@DerVVwulfman
Thank YOU so much for your time and effort. Still have to give it a test to see if it works which won't be anytime soon until October 5th.
The point would be if it is fine to let it absorb healing spells or you would prefer to get a mechanism to avoid their absorbtion...
Technically, I COULD make it only perform the absorb feature as long as attacker and defender are on opposite sides. Of course, this could go both ways with a group of ghosts performing runic spells once and a while on its BOSS Spectre. So the attacker might be a hero vs an enemy too.

You may notice that I used a 'runic_animation' value in the script. Heheh.... I kinda thought "why not use the battle animation from the runic spell" as a barrier animation, and this could change from Spell to spell. You may have one runic spell that affects one ally, his animation being a barrier effect (animation 16), while another runic spell might be an all-allies spell with another animation effect. ;)
Updated. I took the TURNS value out of the configuration section. Now the duration that a Runic spell is set per spell. Just use the skilll's variance setting to change how long the runic barrier lasts.

Meanwhile, a new array sets whether a runic barrier can let friendly spells work and pass through... as kyo suggested.

Now you have even more flexibility.... a Runic spell could be singie-target/multiple-target, have various durations, various animations, and may permit/deny friendly effects.


Code:
#==============================================================================
# ** Just Runics
#------------------------------------------------------------------------------
#  By DerVVulfman
#  v 1.1
#  October 3, 2017
#==============================================================================
#  
#  NOTES:  The Target Animation of a Runic Barrier skill may also show as
#          an effect  upon the recipient when the next turn starts if the
#          barrier is still in effect.
#
#          Originally,  I had a TURNS value  in the configuration section
#          to set how many turns a runic barrier lasts.   Now, the number
#          of turns for a runic barrier to last can be set in the skill's
#          variance value in the Skills database.
#          
#          Originally,  I had a TURNS value  in the configuration section
#          Lastly, a new BYPASS_LIST was added,  Fill this with Skill IDs
#          of skills that permit team member spells  to pass through  the
#          protective Runic barrier.  Concept courtesy of kyonides.
#
#==============================================================================


module Runic


  # List of Skills by ID
  # This, by their skill ID in the database
  #
    SKILL_LIST = [81]

  # Bypass List by ID
  # This holds the list of Runic spells that permit team member spells
  # to pass through.
  #
    BYPASS_LIST = [81]

  # Show Animation Effect per turn?
  # If true, the shielded runic animation plays on turn start
  #
    SHOW = true


  # Pop that shows target/self protected
  # (Or nil if no pop to show)
  #
    SPELL_POP  = "Runic Barrier"


  # Words that show target/self absorbed SP
  # Format is RUNIC_ABSORB + value + RUNIC_SUFFIX
  # (Or nil per word not showing)
  #
    RUNIC_ABSORB = "Absorb"
    RUNIC_SUFFIX = "SP"


end


#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias runic_gb_initialize initialize
  alias runic_gb_skill_effect skill_effect
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :runic_counter            # runic absorb counter
  attr_accessor :runic_spell_id           # runic spell ID
  attr_accessor :runic_animation          # runic spell animation
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Perform the original call
    runic_gb_initialize
    # The added value
    @runic_counter    = 0
    @runic_spell_id   = 0
    @runic_animation  = 0
  end
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    # If skill is slated as a runic barrier spell
    if Runic::SKILL_LIST.include?(skill.id)
      # Set the spell ID for the runic spell
      @runic_spell_id = skill.id
      # Set the number of turns
      @runic_counter = skill.variance
      # Self/caster turns must be increased 1
      @runic_counter += 1 if user == self
      # Show applied pop text if text set
      self.damage = Runic::SPELL_POP unless Runic::SPELL_POP.nil?
      # Set the barrier animation ID for self
      @runic_animation = skill.animation2_id
      # End Method
      return true
    end
    # Perform the original call
    effective = runic_gb_skill_effect(user, skill)
    # Run bypass if Skill permits ally effects
    return effective unless skill_effect_attacker?(user) == true
    # If positive damage during runic effect
    if @runic_counter > 0
      if self.damage != 0
        # Restore health befoer damage
        self.hp += self.damage
        # Add attacker's SP cost into SP score
        self.sp += skill.sp_cost
        # Clear critical flag
        self.critical = false
        # Change Pop message
        word1 = word2 = ""
        word1 = Runic::RUNIC_ABSORB unless Runic::RUNIC_ABSORB.nil?
        word2 = Runic::RUNIC_SUFFIX unless Runic::RUNIC_SUFFIX.nil?
        self.damage = word1 +(skill.sp_cost).to_s + word2
        # And turn the runic effect off
        @runic_counter = 0
      return effective
      end
    end
    # End Method
    return effective
  end
  #--------------------------------------------------------------------------
  # * Skill Effect from an attacker?
  #     user  : the one using skills (battler)
  #--------------------------------------------------------------------------  
  def skill_effect_attacker?(user)
    # Ineffective test if team bypass turned on for skill
    unless Runic::BYPASS_LIST.nil?
      return true unless Runic::BYPASS_LIST.include?(@runic_spell_id)
    end
    # Check if both user and self are in same 'group'
    return false  if user.is_a?(Game_Enemy) and self.is_a?(Game_Enemy)
    return false  if user.is_a?(Game_Actor) and self.is_a?(Game_Actor)
    # End Method
    return true
  end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  alias runic_sb_start_phase2 start_phase2
  alias runic_sb_update_phase4_step6 update_phase4_step6
  #--------------------------------------------------------------------------
  # * Start Party Command Phase
  #--------------------------------------------------------------------------
  def start_phase2
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Perform runic animation
      runic_animation(enemy)
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Perform runic animation
      runic_animation(actor)
    end
    # Perform the original call
    runic_sb_start_phase2
  end
  #--------------------------------------------------------------------------
  # * Start Runic Animation Effect at Party Command Start
  #     target : target (actor or enemy)
  #--------------------------------------------------------------------------
  def runic_animation(target)
    return unless Runic::SHOW == true
    return unless target.exist?
    return unless target.hp > 0
    return unless target.runic_counter > 0
    target.animation_id = target.runic_animation
    target.animation_hit = true
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  def update_phase4_step6
    # Update Runic counter (never below 0)
    @active_battler.runic_counter -= 1
    @active_battler.runic_counter == 0 if @active_battler.runic_counter < 0
    # Perform the original call
    runic_sb_update_phase4_step6
  end
end
@DerVVulfman
Wow, I honestly did not expect that. Well, I'm still going to thank you anyway so thank YOU again for your time and effort.

Edit: My phone's Emojis ended up as "????". Oh well.
Laughing No prob. But I can't just leave well enough alone.

THIS one.... now enables the barrier effect animation to play when the attacker attacks, as if the runic barrier KNOWS it is gonna be used. I had to put in an extra value to handle a stored animation ID as the skill attack wipes out the initial barrier before the attack animations. The animation for the target raising the barrier had to be played when the attacker preps his attack. Unfortunately, it appears a battler cannot have two battle animations playing simultaneously. So I had to make it 'raise' the barrier before being hit. It woulda been cool otherwise.

AND... Man, do I stock things up? While this does not create an actual barrier 'state', I added a feature so a Runic state may appear in the Battlestatus window or Help window for both actors and enemies.

ALSO... I added 'cleanup' features to erase any runic values both before the battle begins and after it ends. You do NOT want to have a hero exit battle and still have the Runic flags in effect, or have a player enter battle with the runic system still applied.

Code:
#==============================================================================
# ** Just Runics
#------------------------------------------------------------------------------
#  By DerVVulfman
#  v 1.3
#  October 3, 2017
#==============================================================================
#  
#  NOTES:  The Target Animation of a Runic Barrier skill may also show as
#          an effect  upon the recipient when the next turn starts if the
#          barrier is still in effect.
#
#          Originally,  I had a TURNS value  in the configuration section
#          to set how many turns a runic barrier lasts.   Now, the number
#          of turns for a runic barrier to last can be set in the skill's
#          variance value in the Skills database.
#          
#          Originally,  I had a TURNS value  in the configuration section
#          Lastly, a new BYPASS_LIST was added,  Fill this with Skill IDs
#          of skills that permit team member spells  to pass through  the
#          protective Runic barrier.  Concept courtesy of kyonides.
#
#==============================================================================


module Runic


  # List of Skills by ID
  # This, by their skill ID in the database
  #
    SKILL_LIST = [81]

  # Bypass List by ID
  # This holds the list of Runic spells that permit team member spells
  # to pass through.
  #
    BYPASS_LIST = [81]


  # Show Animation Effect per turn?
  # If true, the shielded runic animation plays on turn start
  #
    TURN_SHOW = true


  # Show Animation Effect on Defence?
  # If true, the shielded runic animation plays just as the attacker attacks.
  #
    DEFENCE_SHOW = true


  # Pop that shows target/self protected
  # (Or nil if no pop to show)
  #
    SPELL_POP  = "Runic Barrier"


  # Set Status Effect text if barrier exists
  # Or nil in either if no state text shows.
  # The '[Normal]' state tends to be hardcoded in the default scripts
  #
    STATE_TXT1  = "[Normal]"
    STATE_TXT2  = "[Runic]"


  # Words that show target/self absorbed SP
  # Format is RUNIC_ABSORB + value + RUNIC_SUFFIX
  # (Or nil per word not showing)
  #
    RUNIC_ABSORB = "Absorb"
    RUNIC_SUFFIX = "SP"


end


#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias runic_gb_initialize initialize
  alias runic_gb_skill_effect skill_effect
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :runic_counter            # runic absorb counter
  attr_accessor :runic_spell_id           # runic spell ID
  attr_accessor :runic_animation          # runic spell animation
  attr_accessor :runic_animation2         # runic spell animation2
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Perform the original call
    runic_gb_initialize
    # The added value
    @runic_counter    = 0
    @runic_spell_id   = 0
    @runic_animation  = 0
    @runic_animation2  = 0
  end
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    # If skill is slated as a runic barrier spell
    if Runic::SKILL_LIST.include?(skill.id)
      # Set the spell ID for the runic spell
      @runic_spell_id = skill.id
      # Set the number of turns
      @runic_counter = skill.variance
      # Self/caster turns must be increased 1
      @runic_counter += 1 if user == self
      # Show applied pop text if text set
      self.damage = Runic::SPELL_POP unless Runic::SPELL_POP.nil?
      # Set the barrier animation ID for self
      @runic_animation = skill.animation2_id
      # End Method
      return true
    end
    # Perform the original call
    effective = runic_gb_skill_effect(user, skill)
    # Run bypass if Skill permits ally effects
    return effective unless skill_effect_attacker?(user) == true
    # If positive damage during runic effect
    if @runic_counter > 0
      if self.damage != 0
        # Restore health befoer damage
        self.hp += self.damage
        # Add attacker's SP cost into SP score
        self.sp += skill.sp_cost
        # Clear critical flag
        self.critical = false
        # Add Animation Effect
        @runic_animation2 = @runic_animation
        # Change Pop message
        word1 = word2 = ""
        word1 = Runic::RUNIC_ABSORB unless Runic::RUNIC_ABSORB.nil?
        word2 = Runic::RUNIC_SUFFIX unless Runic::RUNIC_SUFFIX.nil?
        self.damage = word1 +(skill.sp_cost).to_s + word2
        # And turn the runic effect off
        @runic_counter = 0
      return effective
      end
    end
    # End Method
    return effective
  end
  #--------------------------------------------------------------------------
  # * Skill Effect from an attacker?
  #     user  : the one using skills (battler)
  #--------------------------------------------------------------------------  
  def skill_effect_attacker?(user)
    # Ineffective test if team bypass turned on for skill
    unless Runic::BYPASS_LIST.nil?
      return true unless Runic::BYPASS_LIST.include?(@runic_spell_id)
    end
    # Check if both user and self are in same 'group'
    return false  if user.is_a?(Game_Enemy) and self.is_a?(Game_Enemy)
    return false  if user.is_a?(Game_Actor) and self.is_a?(Game_Actor)
    # End Method
    return true
  end
end



#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias runic_wb_make_battler_state_text make_battler_state_text
  #--------------------------------------------------------------------------
  # * Make State Text String for Drawing
  #     actor       : actor
  #     width       : draw spot width
  #     need_normal : Whether or not [normal] is needed (true / false)
  #--------------------------------------------------------------------------
  def make_battler_state_text(battler, width, need_normal)
    # Perform the original call
    text = runic_wb_make_battler_state_text(battler, width, need_normal)
    # Exit if system not used
    return text if Runic::STATE_TXT1.nil?
    return text if Runic::STATE_TXT2.nil?
    # Change if normal state and ...
    if text == Runic::STATE_TXT1
      # If a runic barrier exists
      if battler.runic_counter > 0
        # Set the new text
        text = Runic::STATE_TXT2
      end
    end
    # Return completed text string
    return text
  end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  alias runic_sb_start_phase1 start_phase1
  alias runic_sb_battle_end battle_end
  alias runic_sb_start_phase2 start_phase2
  alias runic_sb_update_phase4_step3 update_phase4_step3
  alias runic_sb_update_phase4_step6 update_phase4_step6
  #--------------------------------------------------------------------------
  # * Start Pre-Battle Phase
  #--------------------------------------------------------------------------
  def start_phase1
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(enemy)
      end
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(actor)
      end
    end    
    # Perform the original call
    runic_sb_start_phase1
  end
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(enemy)
      end
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(actor)
      end
    end    
    # Perform the original call
    runic_sb_battle_end(result)
  end
  #--------------------------------------------------------------------------
  # * Start Pre-Battle Runic System Cleanup
  #     target : target (actor or enemy)
  #--------------------------------------------------------------------------
  def runic_clean(target)
    target.runic_counter    = 0
    target.runic_spell_id   = 0
    target.runic_animation  = 0
    target.runic_animation2 = 0
  end
  #--------------------------------------------------------------------------
  # * Start Party Command Phase
  #--------------------------------------------------------------------------
  def start_phase2
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Perform runic animation
      runic_animation(enemy)
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Perform runic animation
      runic_animation(actor)
    end
    # Perform the original call
    runic_sb_start_phase2
  end
  #--------------------------------------------------------------------------
  # * Start Runic Animation Effect at Party Command Start
  #     target : target (actor or enemy)
  #--------------------------------------------------------------------------
  def runic_animation(target)
    return unless Runic::TURN_SHOW == true
    return unless target.exist?
    return unless target.hp > 0
    return unless target.runic_counter > 0
    target.animation_id = target.runic_animation
    target.animation_hit = true
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 3 : animation for action performer)
  #--------------------------------------------------------------------------
  def update_phase4_step3
    # Cycle through targets and apply
    update_phase4_step3_barrier
    # Perform the original call
    runic_sb_update_phase4_step3
  end  
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 3 : animation for barrier)
  #--------------------------------------------------------------------------
  def update_phase4_step3_barrier
    # Exit method unless Defence Barrier shows
    return unless Runic::DEFENCE_SHOW == true
    # Cycle through targets and apply
    for target in @target_battlers
      # Skip unless there is an animation
      next if target.runic_animation2 == 0
      # Apply protective barrier in anticipation
      target.animation_id = target.runic_animation2
      target.animation_hit = true
      # Erase effect
      target.runic_animation2 = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  def update_phase4_step6
    # Update Runic counter (never below 0)
    @active_battler.runic_counter -= 1
    @active_battler.runic_counter == 0 if @active_battler.runic_counter < 0
    # Perform the original call
    runic_sb_update_phase4_step6
  end
end

No ghosts were harmed in the development of this script.
@DerVVulfman
Wowzers. Three times the charm in effect here. I like it.
Will be able to test the final one (assuming that it is) soon.
I HOPE so. Laughing I got a few other things to work on myself, and then there's ReGaL. But that's another topic (no hijacking here).

Still, it was a fun exercise after working on that music system for so long.

Enjoy.
@DerVVulfman
Welp, looks like my first error of the Runic test which happened the moment I hit the "Play Test".
May I know what I should adjust and what I should leave alone?

https://sta.sh/0bl6xeotuod

Edit: Basically, it said "Script 'Runic' line 236: Syntax Error occurred."
Hrm... What other scripts are you using?

Trying it in a fresh project I've encountered no problems.
Pages: 1 2 3 4 5 6