Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Blue Magic
#6
It's cause the stack error with f12 since the 'def skill_effect(user, skill)' don't exist on the Game_Actor. (The error happens only when an enemy use an skill after f12 is pressed)

I've made an test using super and got no error:

Code:
#==============================================================================
# ** Blue Magic
#------------------------------------------------------------------------------
#    by DerVVulfman
#    version 1.1
#    08-02-2011
#    RGSS / RPGMaker XP
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
#  This system allows you to learn skills from enemies when attacked.   These
#  learned skills may be exact copies, or may be similar or variations accor-
#  ding to what is defined in the script's configuration page.   As such, one
#  could let a hero learn the 'Fire' spell if hit with fire or even mass fire.
#
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
# LEARNED SKILL VALUE:
#  
#  The system creates a 'learned' value for actor battlers which it can pass
#  into Sprite_Battler and the RPG::Sprite class.  This permits the end user
#  to create a  'Learned'  damage pop showing  if a skill is learned or even
#  what type of skill is learned.  Using such a damage pop is optional.  The
#  value passed (learned) will be the same as the ID value of the skill that
#  is learned, or a value of '0' as a default, non-learned value.
#
#------------------------------------------------------------------------------
#
# CONFIGURABLES:
#
#  There are only three configurables:
#
#  BLUE_MAGIC_IDs:    This is an array that holds the IDs of the actors who
#                     are able to learn skills through being attacked.
#
#  BLUE_TRIGGER:      (optional)  This is a value that identifies a specific
#                     state effect that permits a character to learn through
#                     being attacked.  This is set to 'nil' by default so no
#                     state is required  to learn a skill.   (States such as
#                     Venom, Dizzy, Stun...)
#
#  BLUE_MAGIC_SKILL:  This is a hash array.   It identifies  the skill(s) that
#                     allow your actors to learn skills followed by the actual
#                     learned skill.   This may  differ from  other scripts in
#                     that you can define  one or more  skills that  can teach
#                     a different skill to your actors.
#
#                     The format: = { skill => learned, skill => learned, ... }
#
#==============================================================================



  BLUE_MAGIC_IDs    = [1,2]      # IDs of actors
  BLUE_TRIGGER      = nil         # State that permits skill learning
  BLUE_MAGIC_SKILL  = {7 => 7}    # IDs of skill and skill learned



#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :learned                  # Learned skill value
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    effective = super(user, skill)
    # Clear critical flag
    self.learned = 0    
    if BLUE_MAGIC_IDs.include?(self.id)
      # Acquire a learned skill if one exists
      new_skill = nil
      new_skill = BLUE_MAGIC_SKILL[skill.id] if BLUE_MAGIC_SKILL.include?(skill.id)
      # Perform skill learning if skill learnable
      if new_skill != nil
        # If there isn't a blue magic, skill learning state.
        if BLUE_TRIGGER == nil or self.states.include?(BLUE_TRIGGER)
          # Do not learn if learned already
          unless self.skills.include?(new_skill)
            # Learn the new skill
            self.learn_skill(new_skill)
            self.learned = new_skill
          end
        end
      end
    end
    return effective
  end
end
Reply }


Messages In This Thread
Blue Magic - by DerVVulfman - 11-10-2009, 04:17 AM
RE: Blue Magic - by xnadvance - 06-13-2011, 02:34 PM
RE: Blue Magic - by yamina-chan - 07-28-2011, 01:03 AM
RE: Blue Magic - by DerVVulfman - 08-03-2011, 03:48 AM
RE: Blue Magic - by yamina-chan - 08-03-2011, 02:21 PM
RE: Blue Magic - by Victor Sant - 08-04-2011, 05:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   DoubleX RMVXA Intercept Magic DoubleX 3 8,625 07-21-2015, 01:11 PM
Last Post: DoubleX
   Blue Mage Trickster 4 8,194 06-22-2012, 12:02 AM
Last Post: DerVVulfman
   MrMo DVV Add-On #5: Blue Magic DerVVulfman 0 4,353 04-29-2010, 04:20 AM
Last Post: DerVVulfman



Users browsing this thread: