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.

Skill Exhaustion

This Skill exhaustion makes battlers lose a turn/turns whenever that battler use a specific skill.

Example: Arshes use Cross cut, since cross cut has skill exhaustion of 1 arshes would skip 1 turn.. if cross cut has skill exhaustion of 2 he would skip 2turns and so on..

I was also wondering if this could be applied to an enemy battler

I hope that summarizes my request
 
You could say it's done.
Code:
class Game_Battler
  One_turn = 17
  Two_turn = 18
  Three_turn = 19
  
  
  
  attr_accessor :exhaustion
  
  alias old_initialize initialize
  def initialize
    old_initialize
    @exhaustion = 0
  end
  
  def inputable?
    return ((not @hidden and restriction <= 1) and @exhaustion == 0)
  end
  
  def movable?
    return ((not @hidden and restriction < 4) and @exhaustion == 0)
  end
  
  alias old_skill_effect skill_effect
  def skill_effect(user, skill)
    effective = old_skill_effect(user, skill)
    
    if skill.element_set.include?(One_turn)
      user.exhaustion += 2
    end
    
    if skill.element_set.include?(Two_turn)
      user.exhaustion += 3
    end
    
    if skill.element_set.include?(Three_turn)
      user.exhaustion += 4
    end
    
    
    return effective
  end
  
end


class Scene_Battle
  
  alias old_start_phase2 start_phase2
  def start_phase2
    if @last_turn == nil
      @last_turn = 0
    end
    if @last_turn != $game_temp.battle_turn
      for battler in $game_party.actors + $game_troop.enemies
        if battler.exhaustion > 0
          battler.exhaustion -= 1
        end
      end
      @last_turn = $game_temp.battle_turn
    end
    old_start_phase2
  end
  
  alias old_start_phase5 start_phase5
  def start_phase5
    for i in 0...$game_party.actors.size
      $game_party.actors[i].exhaustion =0
    end
    old_start_phase5
  end
  
  
end
It uses element tagging so just tag the exhausting skills with the elements (which can be selected at the start of the script) for them to delay the character for the set turns.

If you need any help just ask and you can easily modify this to make attacks which exhaust the target aswell as the user.
 

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