Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Adding a Buff Status before a Skill

What I am asking for is a character gets a buff before using a skill
(Example: Using a Skill call Power Slash it add Sharp state on self 1st before the strike to an enemy.) I also want this to buff a targeted ally too like sharpen Hero#1 and Hero #3 before the Skill strike"If not its fine". Eventing will not work because Force Action is too random when it come to targeting. and I can only add buff after a skill.

This is the CBS I am using
http://www.rmxp.org/forums/index.php?topic=11443.0

This is the last script I need for my Battle system to be finished
 

poccil

Sponsor

You will need to modify the skill_effect method of Game_Battler (found in Game_Battler 3):

Code:
  def skill_effect(user, skill)
    # Clear critical flag
    self.critical = false
    # If skill scope is for ally with 1 or more HP, and your own HP = 0,
    # or skill scope is for ally with 0, and your own HP = 1 or more
    if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
       ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
      # End Method
      return false
    end
######################
    skillBuffStates={
     20=>10,  # Syntax: SkillID=>StateID
     21=>12
    }
    if skillBuffStates.include?(skill.id)
      user.add_state(skillBuffStates[skill.id])
    end
######################    
    # Clear effective flag
    effective = false
    # Set effective flag if common ID is effective
    effective |= skill.common_event_id > 0
 
Ok. Let me see...

Code:
class RPG::Skill
  Skill_User_Buffs = {}
  Skill_User_Buffs.default = []
  def skill_user_buffs
    return Skill_User_Buffs[@id]
  end
end

class Game_Battler
  alias_method :seph_skilluserbuff_gmbtlr_se, :skill_effect
  def skill_effect(user, skill)
    skill.skill_user_buffs.each do |state_id|
      user.add_state(state_id)
    end
    return seph_skilluserbuff_gmbtlr_se(user, skill)
  end
end

Let me know if thats what you need or not.
   
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top