Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [RGSS] TSE-Runic, Allows you to recreate Runic skills in your game.
privateWright
post Apr 19 2013, 05:42 AM
Post #1



Group Icon

Group: Member
Posts: 4
Type: Scripter
RM Skill: Skilled




Script Name : TSE-RemoveOnActions
Version : 1.0
Author : privateWright, privateer, or private (Either of them is fine...)

Introductions :
Mainly inspired from hours of playing Final Fantasy VI.
This script allows you to recreate Runic skills in your game. A Runic skill will nullify the next compatible skill cast on the user and restores the
user's SP equals to the cast skill's SP cost if the user has a Runic compatible weapon equipped to it.

Screenshots :
None needed.

Demo :
None needed.

Script :
CODE
#==============================================================================
# Theta Scripting Engine - Runic by privateer
#==============================================================================
# ► Version  : 1.0
#==============================================================================
# ► Introduction
# This script allows you to recreate Runic skills in your game. A Runic skill
# will nullify the next compatible skill cast on the user and restores the
# user's SP equals to the cast skill's SP cost if the user has a Runic
# compatible weapon equipped to it.
#==============================================================================
# ► Instruction
# Just put this script anywhere below Scene_Debug but above Main.
#==============================================================================
# ► Compatibility
# Designed and tested for DBS. May or not work with exotic CBS and/or skills
# that alter how a skill is cast on an unit.
#==============================================================================

module TSE
  module Runic
    # Skill ID(s) that will activate Runic on its user.
    RUNIC_SKILLS = [81]
    
    # Element ID that will make a weapon or skill compatible with Runic
    # Compatible weapon is needed when a Runic skill is used; without it the
    # Runic skill won't activate at all(it will simply say "Miss").
    # And regarding compatible skills, only compatible skills' SP Cost will be
    # absorbed through Runic.
    RUNIC_COMPATIBLE_ELEMENT = 17
    
    # Animation ID that will be played when an unit's runic effect is activated.
    # Set it to 0 for no animation.
    RUNIC_ANIMATION = 65
    
    # Message that will be displayed when an unit uses a Runic skill.
    # Set it to "" for no message.
    RUNIC_MESSAGE = "Runic Activated!"
  end
end

#==============================================================================
# DON'T EDIT ANY FURTHER UNLESS YOU KNOW WHAT YOU'RE DOING!
#==============================================================================

$imported = {} if $imported.nil?
$imported["TSE-Runic"] = true

module RPG
  class Weapon
    def runic_compatible?
      return self.element_set.include?($game_system.runic_compatible_element)
    end
  end
  class Skill
    def runic_skill?
      return TSE::Runic::RUNIC_SKILLS.include?(id)
    end
    def runic_compatible?
      return self.element_set.include?($game_system.runic_compatible_element)
    end
  end
end

class Game_Battler
  attr_accessor :runic_ready
  alias tse_init initialize
  def initialize
    tse_init
    @runic_ready = false
  end
  alias tse_runic_skill_effect skill_effect
  def skill_effect(user, skill)
    return tse_runic_skill_effect(user, skill) unless skill.runic_skill? or @runic_ready
    if skill.runic_skill?
      # Performing original method
      tse_runic_skill_effect(user, skill)
      if $data_weapons[@weapon_id].runic_compatible?
        self.damage = $game_system.runic_message
        @runic_ready = true
      end
    elsif @runic_ready
      @runic_ready = false
      return perform_runic_effect(skill) if skill.runic_compatible?
    end
  end
  def perform_runic_effect(skill)
    absorbed_sp = skill.sp_cost
    self.animation_id = $game_system.runic_animation
    self.sp += absorbed_sp
    self.damage = -absorbed_sp
  end
end

class Game_System
  attr_accessor :runic_compatible_element
  attr_accessor :runic_animation
  attr_accessor :runic_message
  alias tse_init initialize
  def initialize
    tse_init
    @runic_compatible_element = TSE::Runic::RUNIC_COMPATIBLE_ELEMENT
    @runic_animation = TSE::Runic::RUNIC_ANIMATION
    @runic_message = TSE::Runic::RUNIC_MESSAGE
  end
end

Or, for those who rather download it : Here!

Compatibility : Designed and tested for DBS. May or not work with exotic CBS and/or scripts that alter how a skill is cast on an unit.

Author Notes : I think the instructions on how to use this script is quite clear. However, please feel free to ask should you have any problem!
-privateWright
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 05:23 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker